/* Define the chassis palette and typography shared across the page. */
:root {
  color-scheme: dark;
  --chassis: #090c0f;
  --panel: #10161a;
  --panel-raised: #151d22;
  --powder: #f1eee6;
  --muted: #9aa5a9;
  --dim: #606c72;
  --copper: #d8894d;
  --copper-soft: #f0b47c;
  --signal: #74d2dc;
  --line: rgba(194, 215, 220, 0.17);
  --line-strong: rgba(194, 215, 220, 0.3);
  --display: "Arial Narrow", "Aptos Narrow", "Roboto Condensed", sans-serif;
  --body: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --utility: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--chassis);
  color: var(--powder);
  font-family: var(--body);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  background: var(--chassis);
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 76% 8%, rgba(31, 103, 114, 0.16), transparent 30rem),
    linear-gradient(135deg, #090c0f 0%, #0b1013 52%, #080b0d 100%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 20;
  padding: 10px 14px;
  color: var(--chassis);
  background: var(--powder);
  font-family: var(--utility);
  font-size: 13px;
  transform: translate(-50%, -160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

/* Frame the page as a physical rack with numbered side rails. */
.rack-shell {
  width: min(100%, 1500px);
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(7, 10, 12, 0.46);
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.34);
}

.rack-rail {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.05) 50%, transparent 52%),
    #0d1215;
}

.rack-rail::before,
.rack-rail::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid #394349;
  border-radius: 50%;
  background: #070a0c;
  box-shadow: inset 0 0 0 2px #11171b;
  transform: translateX(-50%);
}

.rack-rail::before {
  top: 18px;
}

.rack-rail::after {
  bottom: 18px;
}

.rack-unit {
  position: absolute;
  left: 50%;
  color: #4e5b61;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  transform: translateX(-50%);
}

.rack-unit:nth-child(1) {
  top: 12%;
}

.rack-unit:nth-child(2) {
  top: 36%;
}

.rack-unit:nth-child(3) {
  top: 60%;
}

.rack-unit:nth-child(4) {
  top: 84%;
}

.chassis {
  width: 100%;
  min-width: 0;
  padding: 0 clamp(22px, 4.5vw, 70px);
}

/* Present node identity, local date and time, and signal state. */
.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  font-family: var(--utility);
  animation: reveal 650ms ease both;
}

.identity {
  display: flex;
  align-items: baseline;
  gap: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity strong {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.13em;
}

.identity span {
  color: var(--dim);
  font-size: 10px;
}

.telemetry {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 32px);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.telemetry time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.signal-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--signal);
}

.signal-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 18px rgba(116, 210, 220, 0.75);
  animation: pulse 2.8s ease-in-out infinite;
}

/* Pair the homelab thesis with its physical server-room view. */
.hero {
  min-height: min(760px, calc(100svh - 86px));
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  align-items: stretch;
  gap: clamp(30px, 5vw, 76px);
  padding: clamp(52px, 8vh, 104px) 0 clamp(46px, 7vh, 82px);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  align-self: center;
  animation: reveal 750ms 90ms ease both;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--copper-soft);
  font-family: var(--utility);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 870px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(64px, 8.5vw, 138px);
  font-stretch: condensed;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.79;
  text-transform: uppercase;
}

h1 span {
  display: block;
}

h1 em {
  color: var(--copper);
  font-family: var(--body);
  font-size: 0.82em;
  font-weight: 400;
  letter-spacing: -0.08em;
  text-transform: none;
}

.lede {
  max-width: 650px;
  margin: 34px 0 0;
  color: #c5c9c6;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.5;
}

.readings {
  margin: clamp(44px, 8vh, 78px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  list-style: none;
}

.reading {
  min-width: 0;
  margin: 0;
  padding: 16px 18px 0 0;
}

.reading + .reading {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.reading-label {
  display: block;
  margin-bottom: 8px;
  color: var(--dim);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.reading-value {
  display: block;
  margin: 0;
  color: var(--powder);
  font-family: var(--display);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.rack-window {
  position: relative;
  min-height: 500px;
  align-self: stretch;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  animation: reveal 850ms 160ms ease both;
}

.rack-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 12, 15, 0.04), rgba(9, 12, 15, 0.44)),
    repeating-linear-gradient(180deg, transparent 0, transparent 4px, rgba(116, 210, 220, 0.025) 5px);
}

.rack-window::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rack-window img {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
  object-position: 68% center;
  filter: saturate(0.82) contrast(1.06);
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0, 1);
}

.rack-window:hover img {
  transform: scale(1.025);
}

.window-label,
.window-coordinates {
  position: absolute;
  z-index: 4;
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.window-label {
  top: 28px;
  left: 28px;
  padding: 7px 9px;
  color: #101316;
  background: var(--copper);
}

.window-coordinates {
  right: 28px;
  bottom: 28px;
  color: rgba(241, 238, 230, 0.7);
}

.reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(116, 210, 220, 0.32);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(116, 210, 220, 0.42);
  transform: translate(-50%, -50%);
}

.reticle::before {
  width: 96px;
  height: 1px;
}

.reticle::after {
  width: 1px;
  height: 96px;
}

/* Map the local, private, and edge principles along one signal path. */
.backbone {
  padding: clamp(70px, 10vh, 120px) 0 clamp(64px, 9vh, 104px);
  animation: reveal 800ms 240ms ease both;
}

.backbone-header {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(280px, 1.45fr);
  gap: 30px;
  align-items: baseline;
  margin-bottom: clamp(48px, 7vh, 80px);
}

.section-label {
  color: var(--copper-soft);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.backbone-header h2 {
  max-width: 760px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(38px, 5.5vw, 76px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
}

.topology {
  width: 100%;
  height: auto;
  margin: 0 0 18px;
  overflow: visible;
}

.topology .guide {
  fill: none;
  stroke: rgba(154, 165, 169, 0.22);
  stroke-width: 1;
}

.topology .flow {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-dasharray: 1 16;
  stroke-linecap: round;
  animation: link-flow 12s linear infinite;
}

.topology circle {
  fill: var(--chassis);
  stroke: var(--copper);
  stroke-width: 2;
}

.topology text {
  fill: var(--muted);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.principle {
  position: relative;
  min-height: 240px;
  padding: 30px clamp(18px, 2.4vw, 34px) 34px 0;
}

.principle + .principle {
  padding-left: clamp(18px, 2.4vw, 34px);
  border-left: 1px solid var(--line);
}

.principle-index {
  display: block;
  margin-bottom: 54px;
  color: var(--signal);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.principle h3 {
  max-width: 300px;
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(23px, 2.4vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.principle p {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

/* Close the chassis with its operating location and public posture. */
footer {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--dim);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.footer-signal {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.footer-signal::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--copper);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

/* Coordinate the restrained entry and telemetry motion. */
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes link-flow {
  to {
    stroke-dashoffset: -170;
  }
}

/* Collapse the hero to one column on tablets and compact desktops. */
@media (max-width: 980px) {
  .rack-shell {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
  }

  .chassis {
    padding: 0 clamp(20px, 4vw, 42px);
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 790px;
    font-size: clamp(64px, 13.5vw, 112px);
  }

  .rack-window {
    min-height: 440px;
    aspect-ratio: 16 / 10;
  }

  .rack-window img {
    min-height: 440px;
  }
}

/* Preserve the date and core content while simplifying mobile telemetry. */
@media (max-width: 700px) {
  .rack-shell {
    display: block;
    border: 0;
  }

  .rack-rail {
    display: none;
  }

  .chassis {
    padding: 0 clamp(22px, 6vw, 28px);
  }

  .topbar {
    min-height: 72px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 0;
  }

  .identity span,
  .signal-state {
    display: none;
  }

  .telemetry time {
    display: inline;
    font-size: 9px;
    letter-spacing: 0.05em;
  }

  .hero {
    gap: 42px;
    padding: 54px 0 46px;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 9px;
  }

  h1 {
    font-size: clamp(54px, 17.5vw, 86px);
    line-height: 0.84;
  }

  h1 span {
    font-size: 0.74em;
    letter-spacing: -0.035em;
  }

  h1 em {
    font-size: 1em;
  }

  .lede {
    margin-top: 26px;
    font-size: 18px;
  }

  .readings {
    margin-top: 42px;
    grid-template-columns: 1fr;
  }

  .reading {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .reading + .reading {
    padding-left: 0;
    border-left: 0;
  }

  /* Remove the visual feed when vertical space is limited. */
  .rack-window {
    display: none;
  }

  .backbone-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .topology {
    display: none;
  }

  .principles {
    grid-template-columns: 1fr;
  }

  .principle {
    min-height: 0;
    padding: 28px 0 32px;
  }

  .principle + .principle {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .principle-index {
    margin-bottom: 24px;
  }

  footer {
    min-height: 104px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }
}

/* Respect visitors who prefer a static interface. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
