:root {
  color-scheme: dark;
  --background: #1d1f20;
  --surface: #252829;
  --foreground: #f4f2ed;
  --body: #c6c8c7;
  --muted: #adb1af;
  --line: #4a4d4e;
  --diagram-line: #8c9693;
  --accent: #a7bfff;
  --selected: #303b50;
  --content-width: 1104px;
  --column-gap: clamp(32px, 5vw, 64px);
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
}

a {
  color: inherit;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
}

button,
select {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
.topology-detail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: -80px;
  left: 16px;
  padding: 12px;
  background: var(--foreground);
  color: var(--background);
}

.skip-link:focus {
  top: 8px;
}

.page-width {
  width: min(100% - 112px, var(--content-width));
  margin-inline: auto;
}

.site-header,
.site-nav,
.site-footer,
.site-footer nav {
  display: flex;
  align-items: center;
}

.site-header {
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.wordmark {
  font-weight: 600;
  text-decoration: none;
}

.site-nav,
.site-footer nav {
  gap: 28px;
}

.site-header a,
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-nav a {
  text-decoration: none;
}

.intro {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: end;
  gap: var(--column-gap);
  padding-block: 74px 72px;
}

h1 {
  margin: 0;
  font-size: clamp(52px, 6.5vw, 84px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.role {
  margin: 20px 0 0;
  font-size: 21px;
  color: var(--body);
}

.intro-copy {
  max-width: 420px;
  margin: 0;
  padding-bottom: 4px;
  font-size: 20px;
  color: var(--body);
  line-height: 1.6;
}

.work {
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 25px 0 36px;
  font-size: 17px;
  font-weight: 500;
}

.featured-project {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: var(--column-gap);
  align-items: center;
  padding-bottom: 54px;
}

.project-copy h3 {
  margin: 0 0 18px;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.project-copy h3 a {
  text-decoration: none;
}

.project-copy p {
  margin: 0 0 22px;
  color: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

.project-link,
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-size: 16px;
}

.system-figure {
  margin: 0;
  padding: 26px 28px 20px;
  background: var(--surface);
}

.system-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.system-figure figcaption {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

.project-note {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--column-gap);
  padding: 30px 0 38px;
  border-top: 1px solid var(--line);
}

.project-note h3 {
  margin: 0;
  max-width: 430px;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.4;
}

.project-note p {
  margin: 0;
  align-self: center;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.about,
.case-study-body section {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: var(--column-gap);
  border-top: 1px solid var(--line);
  padding-block: 38px 56px;
}

.about h2,
.case-study-body h2,
.case-overview h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.about p,
.case-study-body p,
.case-study-body ul {
  margin: 0;
  color: var(--body);
  font-size: 18px;
  line-height: 1.7;
}

.case-study-body p + p,
.case-study-body p + ul {
  margin-top: 20px;
}

.case-study-body ul {
  padding-left: 20px;
}

.case-study-body li + li {
  margin-top: 10px;
}

.site-footer {
  justify-content: space-between;
  gap: 28px;
  padding-block: 20px 32px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.case-study {
  padding-top: 32px;
  padding-bottom: 48px;
}

.case-study-header {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  align-items: start;
  gap: var(--column-gap);
  padding-block: 44px 54px;
}

.case-study-header p {
  margin: 0;
  color: var(--body);
  font-size: 20px;
  line-height: 1.65;
}

.case-overview {
  border-top: 1px solid var(--line);
  padding-block: 32px 44px;
}

.decisions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin: 28px 0 0;
}

.decisions dt {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 600;
}

.decisions dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
}

.case-study-back {
  margin-top: 8px;
}

/* The map groups hosted services spatially; line styles explain relationships. */
.topology {
  padding-block: 36px 44px;
  border-top: 1px solid var(--line);
}

.topology-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 24px;
}

.topology-heading h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.topology-heading p {
  margin: 0;
  color: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

.topology-summary {
  max-width: 760px;
  margin: 0;
  color: var(--body);
  font-size: 18px;
  line-height: 1.7;
}

.topology.is-enhanced .topology-summary {
  display: none;
}

.topology-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.topology-toolbar button {
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--body);
  font-size: 15px;
  cursor: pointer;
}

.topology-toolbar button[aria-pressed="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.topology-toolbar button:hover,
.topology-neighbors button:hover {
  color: var(--foreground);
}

.topology-journey {
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.topology-path-description {
  margin: 0 0 16px;
  color: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

.topology-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.topology-steps button {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--body);
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}

.topology-steps button[aria-current="step"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.topology-next {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: var(--background);
  font-size: 15px;
  cursor: pointer;
}

.topology-next:hover {
  background: var(--foreground);
  border-color: var(--foreground);
}

.topology-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  gap: 32px;
  padding-top: 28px;
}

.topology-map {
  min-width: 0;
}

.topology-canvas {
  position: relative;
  isolation: isolate;
  height: 600px;
}

.topology-wires {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.topology-wire {
  fill: none;
  stroke: var(--diagram-line);
  stroke-width: 1.6;
}

.topology-wire--private {
  stroke-dasharray: 8 5;
}

.topology-wire--service {
  stroke-dasharray: 2 5;
}

.topology-wire--storage {
  stroke-dasharray: 10 4 2 4;
}

.topology-wire.is-active {
  stroke: var(--accent);
  stroke-width: 2.2;
}

.topology-wire.is-preview {
  stroke: var(--foreground);
  stroke-width: 2.5;
}

.topology-node {
  position: absolute;
  z-index: 2;
  width: 140px;
  min-height: 48px;
  padding: 10px 8px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--diagram-line);
  border-radius: 2px;
  background: var(--background);
  color: var(--foreground);
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}

.topology-node:disabled {
  cursor: default;
}

.topology-node:hover,
.topology-node:focus-visible {
  border-color: var(--foreground);
}

.topology-node[aria-pressed="true"] {
  border: 2px solid var(--accent);
  background: var(--selected);
  color: var(--foreground);
  font-weight: 600;
}

.topology-node--internet {
  top: 28px;
  left: 50%;
}

.topology-node--router {
  top: 138px;
  left: 50%;
}

.topology-node--pc {
  top: 138px;
  left: 14%;
}

.topology-node--cameras {
  top: 138px;
  left: 86%;
}

.topology-node--remote {
  top: 296px;
  left: 14%;
}

.topology-node--tailscale {
  top: 410px;
  left: 14%;
}

.topology-host {
  position: absolute;
  top: 256px;
  left: 34%;
  width: 66%;
  height: 328px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.topology-node--truenas {
  top: 32px;
  left: 50%;
  font-size: 20px;
}

.topology-node--jellyfin {
  top: 174px;
  left: 25%;
}

.topology-node--frigate {
  top: 174px;
  left: 75%;
}

.topology-node--zfs {
  top: 282px;
  left: 50%;
}

.topology-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--body);
  font-size: 14px;
}

.topology-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-line {
  width: 26px;
  border-top: 2px solid var(--diagram-line);
}

.legend-line--private {
  border-top-style: dashed;
}

.legend-line--service {
  border-top-style: dotted;
}

.legend-line--storage {
  border: 0;
  height: 2px;
  background: linear-gradient(to right, var(--diagram-line) 0 10px, transparent 10px 14px, var(--diagram-line) 14px 16px, transparent 16px 20px, var(--diagram-line) 20px);
}

.topology-mobile {
  display: none;
}

.topology-detail {
  min-width: 0;
  padding: 22px 0 22px 26px;
  border-left: 1px solid var(--line);
}

.topology-detail h3 {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.topology-description,
.topology-facts {
  color: var(--body);
  font-size: 15px;
  line-height: 1.7;
}

.topology-description {
  margin: 0;
}

.topology-detail .topology-detail-step {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 14px;
}

.topology-facts {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  padding: 20px 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.topology-connections h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.topology-neighbors {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin-top: 8px;
}

.topology-neighbors button {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.topology-footnote {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 1199px) {
  .topology-workspace {
    grid-template-columns: 1fr;
  }

  .topology-detail {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 28px 0 0;
  }

  .topology-facts {
    margin-bottom: 0;
  }
}

@media (max-width: 900px) {
  .topology-heading {
    display: block;
  }

  .topology-heading p {
    margin-top: 12px;
  }

  .topology.is-enhanced .topology-map {
    display: none;
  }

  .topology-mobile {
    display: grid;
    gap: 10px;
    font-size: 16px;
  }

  .topology-mobile select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--diagram-line);
    border-radius: 2px;
    background: var(--background);
    color: var(--foreground);
  }

  .topology-workspace {
    gap: 24px;
  }

  .topology-detail {
    display: block;
    padding-top: 24px;
  }

  .topology-facts {
    margin-bottom: 24px;
  }

}

@media (max-width: 800px) {
  .page-width {
    width: calc(100% - 40px);
  }

  .site-header {
    align-items: flex-start;
    gap: 8px 24px;
    flex-wrap: wrap;
    padding-block: 14px;
  }

  .site-nav {
    gap: 24px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block: 48px 42px;
  }

  h1 {
    font-size: clamp(48px, 10vw, 72px);
  }

  .role {
    margin-top: 16px;
    font-size: 19px;
  }

  .intro-copy {
    max-width: 560px;
    font-size: 18px;
  }

  .section-title {
    margin-bottom: 26px;
  }

  .featured-project {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 34px;
  }

  .project-copy h3 {
    font-size: 34px;
  }

  .project-copy p {
    font-size: 17px;
  }

  .system-figure {
    padding: 20px 12px;
  }

  .project-note {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-block: 28px;
  }

  .about,
  .case-study-body section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-block: 30px 38px;
  }

  .about p,
  .case-study-body p,
  .case-study-body ul {
    font-size: 17px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-footer nav {
    flex-wrap: wrap;
    gap: 4px 24px;
  }

  .case-study {
    padding-top: 20px;
    padding-bottom: 32px;
  }

  .case-study-header {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 30px 36px;
  }

  .case-study-header p {
    font-size: 18px;
  }

  .decisions {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .case-overview {
    padding-bottom: 32px;
  }

  .topology-toolbar {
    gap: 6px 24px;
  }

  .topology {
    padding-block: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
