:root {
  --hall: #2a2420;
  --hall-2: #342c28;
  --ink: #f6f1ea;
  --muted: #c4b8ae;
  --line: #4a403a;
  --copper: #c17a5a;
  --copper-deep: #8e4e36;
  --coolant: #6e93b0;
  --coolant-bright: #c5d7e6;
  --emerald: #8a9a6a;
  --emerald-lamp: #e3e6d4;
  --paper: #f3ede6;
  --paper-ink: #2a2420;
  --paper-muted: #6e655e;
  --max: 1180px;
  --nav: 72px;
  --serif: Fraunces, "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: Sora, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  color-scheme: light;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
::selection { background: var(--copper); color: var(--hall); }
[id] { scroll-margin-top: 88px; }
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--ink);
  color: var(--hall);
  padding: 10px 14px;
  z-index: 80;
}
.skip:focus { top: 12px; }

.nav-shell {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(246, 241, 234, 0.94);
  color: var(--paper-ink);
  border-bottom: 1px solid transparent;
}
.nav-shell.is-scrolled { border-bottom-color: rgba(42, 36, 32, 0.12); background: #f6f1ea; }
.nav-shell .brand-copy strong { color: var(--paper-ink); }
.nav-shell .brand-sub { color: var(--paper-muted); }
.nav-shell .desktop-nav a { color: var(--paper-muted); }
.nav-shell .desktop-nav a:hover { color: var(--paper-ink); }
.nav-shell .btn-primary { background: var(--paper-ink); color: var(--paper); }
.nav-shell .btn-primary:hover { background: #1a1614; }
.nav-shell .menu-btn { color: var(--paper-ink); border-color: rgba(42, 36, 32, 0.35); }

.brand, .hero-lockup, .footer-brand { display: flex; align-items: flex-start; gap: 10px; text-decoration: none; }
.hero-lockup { margin: 0 0 28px; }
.brand-mark { width: 23px; height: 15px; flex: none; display: block; margin-top: 1px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 15px; font-weight: 600; letter-spacing: 0.04em; line-height: 1; white-space: nowrap; }
.brand-sub { color: var(--paper-muted); font-weight: 600; }
.brand-tag { display: block; margin-top: 4px; font-family: var(--serif); font-size: 13px; color: var(--copper); letter-spacing: 0; }

.desktop-nav { display: flex; align-items: center; gap: 26px; }
.desktop-nav a { text-decoration: none; font-size: 14px; color: var(--muted); }
.desktop-nav a:hover { color: var(--ink); }
.nav-mobile-cta { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 2px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary { background: var(--paper-ink); color: var(--paper); }
.btn-primary:hover { background: #1a1614; }
.btn-ghost { background: transparent; border-color: rgba(42, 36, 32, 0.28); color: var(--paper-ink); }
.btn-ghost:hover { border-color: var(--paper-ink); }
.office .btn-primary { background: var(--paper-ink); color: #f4f7f9; }
.office .btn-primary:hover { background: #1a1614; }

.menu-btn {
  display: none;
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid rgba(231, 238, 243, 0.35);
  cursor: pointer;
}

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(420px, 1fr);
  grid-template-areas: "copy figure" "rail rail";
  gap: 28px 48px;
  align-items: center;
  padding: 112px 40px 36px;
  background: var(--paper);
}
.hero-copy { grid-area: copy; align-self: center; }
.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--paper-muted);
}
.hero-figure figcaption,
.rail dt,
.stack-intro p,
.chapter p,
.step-body p,
footer p { color: var(--paper-muted); }
.tick { width: 8px; height: 8px; background: var(--copper); flex: none; }
h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
}
h1 { font-size: clamp(48px, 5.6vw, 92px); max-width: 11ch; }
h2 { font-size: clamp(40px, 4.6vw, 68px); max-width: 16ch; }
.lede {
  max-width: 38rem;
  margin: 22px 0 0;
  color: var(--paper-muted);
  font-size: 18px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.hero-figure {
  grid-area: figure;
  margin: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
.hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}
.hall-svg { width: 100%; height: auto; }
.flow { stroke-dasharray: 7 11; animation: march 2.2s linear infinite; }
.flow.power { animation-duration: 2.8s; }
@keyframes march { to { stroke-dashoffset: -72; } }
.hero-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 0 6px;
  font-size: 12px;
  color: var(--paper-muted);
}

.rail {
  grid-area: rail;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #e0d6cc;
}
.rail div { padding: 18px 18px 6px 0; }
.rail dt { font-size: 13px; color: var(--paper-muted); }
.rail dd { margin: 6px 0 0; font-family: var(--serif); font-size: 28px; letter-spacing: -0.03em; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 2px 7px 3px;
  border: 1px solid currentColor;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: 4px;
  color: var(--copper-deep);
}
.chip:before { content: ""; width: 6px; height: 6px; background: currentColor; }

.stack { padding: 40px 40px 100px; }
.stack-intro { max-width: var(--max); margin: 0 auto 10px; padding-top: 48px; }
.stack-intro p, .chapter p { color: var(--paper-muted); }
.stack-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 460px);
  gap: 48px;
  align-items: stretch;
}
.layer { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.layer h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 3vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 14px;
}
.layer p { max-width: 38rem; margin: 0; font-size: 17px; }
.layer.is-active h3 { box-shadow: inset 3px 0 0 var(--copper); padding-left: 14px; }
.stack-visual-pin { position: sticky; top: 104px; }
.plates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plates button {
  width: 100%;
  text-align: left;
  background: #f7f4ef;
  border: 1px solid #e0d6cc;
  padding: 16px 16px 14px;
  min-height: 44px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plates button strong { font-weight: 600; font-size: 16px; color: var(--paper-ink); }
.plates button small { color: var(--paper-muted); font-size: 13px; }
.plates button { border-left-width: 3px; border-left-color: #e0d6cc; color: var(--paper-muted); }
.plates button[aria-current="true"] { background: #efe6dc; color: var(--paper-ink); }
.plates button[aria-current="true"] strong { color: var(--paper-ink); }
.plates button[data-kind="power"][aria-current="true"] { border-left-color: var(--copper); }
.plates button[data-kind="coolant"][aria-current="true"] { border-left-color: var(--coolant); }
.plates button[data-kind="control"][aria-current="true"] { border-left-color: var(--emerald-lamp); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--paper-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.swatch-power { background: var(--copper); }
.swatch-coolant { background: var(--coolant); }
.swatch-control { background: var(--emerald-lamp); }

.office { background: var(--paper); color: var(--paper-ink); color-scheme: light; padding: 120px 40px; }
.office .kicker { color: var(--paper-muted); }
.office .lede, .office .chapter-copy p { color: var(--paper-muted); }
.office h2 { color: var(--paper-ink); }

.engineering-layout {
  max-width: 1280px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px 48px;
  align-items: start;
}
.stage-tabs { display: flex; flex-direction: column; }
.stage-tab {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  padding: 11px 12px;
  min-height: 44px;
  color: var(--paper-muted);
  cursor: pointer;
}
.stage-tab[aria-selected="true"] {
  border-left-color: var(--copper-deep);
  color: var(--paper-ink);
  background: rgba(154, 91, 46, 0.08);
}
.drawing { min-width: 0; }
.schematic { width: 100%; height: auto; }
.schematic .bus { fill: none; stroke: #b7aea4; stroke-width: 2; }
.schematic .station circle { fill: var(--paper); stroke: #b7aea4; stroke-width: 2; }
.schematic .station text { fill: #6e655e; font-family: var(--sans); }
.schematic .station .sub { fill: #8a8076; }
.schematic[data-active="grid"] [data-stage="grid"] circle,
.schematic[data-active="switchgear"] [data-stage="switchgear"] circle,
.schematic[data-active="storage"] [data-stage="storage"] circle,
.schematic[data-active="rack"] [data-stage="rack"] circle { fill: var(--copper); stroke: var(--copper); }
.schematic[data-active="loop"] [data-stage="loop"] circle,
.schematic[data-active="heat"] [data-stage="heat"] circle { fill: var(--coolant); stroke: #4d6d86; }
.schematic[data-active="compute"] [data-stage="compute"] circle,
.schematic[data-active="telemetry"] [data-stage="telemetry"] circle { fill: var(--emerald); stroke: var(--emerald); }
.schematic[data-active="grid"] [data-stage="grid"] text,
.schematic[data-active="switchgear"] [data-stage="switchgear"] text,
.schematic[data-active="storage"] [data-stage="storage"] text,
.schematic[data-active="rack"] [data-stage="rack"] text,
.schematic[data-active="compute"] [data-stage="compute"] text,
.schematic[data-active="loop"] [data-stage="loop"] text,
.schematic[data-active="heat"] [data-stage="heat"] text,
.schematic[data-active="telemetry"] [data-stage="telemetry"] text { fill: var(--paper-ink); }
.path-note { margin: 8px 0 0; font-size: 13px; color: var(--paper-muted); }
.stage-panel { max-width: 42rem; margin-top: 8px; }
.stage-panel h3 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -0.03em; }
.stage-panel p { margin: 0; color: var(--paper-muted); }
.office .legend { color: var(--paper-muted); }
.office .swatch-control { background: var(--emerald); }

.office-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.panel {
  background: var(--hall);
  color: var(--ink);
  color-scheme: dark;
  padding: 28px;
  border: 1px solid #3a322c;
}
.metric { padding: 18px 0; border-top: 1px solid var(--line); }
.metric:first-of-type { border-top: 0; padding-top: 0; }
.metric .chip { margin: 0 0 10px; color: var(--emerald-lamp); }
.metric strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(40px, 4vw, 60px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.metric span:last-child { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
.disclaimer { margin: 28px 0 0; max-width: 40rem; font-size: 14px; line-height: 1.5; color: var(--paper-muted); }

.node-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.chapter { padding: 120px 40px; }
.chapter p { max-width: 40rem; }
.plain-list { list-style: none; margin: 26px 0 0; padding: 0; }
.plain-list li { position: relative; margin: 12px 0; padding-left: 18px; color: var(--paper-muted); }
.plain-list li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  background: var(--copper);
}
.capacity {
  margin: 0;
  background: #f7f4ef;
  border: 1px solid #e0d6cc;
  padding: 22px;
}
.capacity figcaption { font-size: 14px; color: var(--paper-muted); margin-bottom: 18px; }
.bar { height: 72px; background: #efe6dc; border: 1px solid #e0d6cc; }
.bar-fill {
  width: 30%;
  height: 100%;
  background: var(--copper);
  color: #1a1008;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-weight: 600;
  font-size: 14px;
}
.bar-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--paper-muted); }
.capacity .chip { margin: 18px 0 0; }
.capacity p { margin: 12px 0 0; color: var(--paper-muted); font-size: 14px; }

.sector-wrap { max-width: 1280px; margin: 48px auto 0; }
.sector-note { margin: 0 0 14px; font-size: 14px; color: var(--paper-muted); }
.sector-grid { display: grid; grid-template-columns: 1.25fr 0.9fr; gap: 12px; }
.sector {
  background: #f7f4ef;
  color: var(--paper-ink);
  color-scheme: light;
  border: 1px solid #e0d6cc;
  padding: 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
}
.sector.agriculture { background: linear-gradient(160deg, #f7f4ef, #f3e4da); }
.sector.health { background: linear-gradient(160deg, #f7f4ef, #e4edf3); }
.sector.industry { background: linear-gradient(160deg, #f7f4ef, #f6e7df); }
.sector.public { background: linear-gradient(160deg, #f7f4ef, #eeeae4); }
.motif { width: 72px; height: 72px; color: var(--copper-deep); }
.sector.health .motif { color: #4d6d86; }
.sector.industry .motif { color: var(--copper-deep); }
.sector.public .motif { color: #6e655e; }
.sector-name { margin: 18px 0 0; font-size: 14px; color: var(--paper-muted); }
.sector h3 {
  margin: 8px 0 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 2.4vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 16ch;
}
.sector p { margin: 0; color: var(--paper-muted); max-width: 36rem; }

.proof { padding-bottom: 80px; }
.steps { list-style: none; margin: 48px auto 0; padding: 0; max-width: 920px; border-top: 1px solid #e0d6cc; counter-reset: proof; }
.step { border-bottom: 1px solid #e0d6cc; counter-increment: proof; }
.step h3 { margin: 0; font-family: var(--sans); font-size: 16px; font-weight: 600; }
.step button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 18px 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.step .name:before { content: counter(proof) ". "; color: var(--copper); }
.markbox { width: 14px; height: 14px; border: 1.5px solid var(--copper); flex: none; }
.step button[aria-expanded="true"] .markbox { background: var(--copper); }
.step-body { padding: 0 0 22px; max-width: 40rem; }
.ask {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.step-body p { margin: 0; color: var(--paper-muted); }

.closing { padding: 140px 40px 120px; }
.closing h2 { max-width: 12ch; }
.closing .btn { margin-top: 28px; }

footer {
  padding: 36px 40px 48px;
  border-top: 1px solid #e0d6cc;
  display: grid;
  gap: 10px;
  background: #f7f4ef;
}
footer p { margin: 0; color: var(--paper-muted); font-size: 13px; }

@media (max-width: 980px) {
  .menu-btn { display: inline-flex; align-items: center; }
  .nav-cta { display: none; }
  .desktop-nav {
    display: none;
    position: fixed;
    top: var(--nav);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 20px 24px;
    background: #f6f1ea;
  }
  .desktop-nav.is-open { display: flex; }
  .nav-shell .desktop-nav.is-open a,
  .nav-shell .desktop-nav.is-open .nav-mobile-cta { color: var(--paper-ink); }
  .desktop-nav a { min-height: 44px; display: flex; align-items: center; }
  .nav-mobile-cta { display: flex; }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "copy" "figure" "rail";
    min-height: auto;
    padding: 104px 20px 28px;
  }
  .hero-figure img {
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .rail { grid-template-columns: 1fr 1fr; }
  .stack, .chapter, .office, .closing { padding-left: 20px; padding-right: 20px; }
  .stack-layout, .engineering-layout, .office-grid, .node-layout, .sector-grid { grid-template-columns: 1fr; }
  .layer { min-height: 0; padding: 28px 0; }
  .stack-visual { order: -1; }
  .stack-visual-pin { position: static; margin-bottom: 12px; }
  footer { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 640px) {
  h1 { font-size: 46px; }
  h2 { font-size: 38px; }
  .rail { grid-template-columns: 1fr; }
  .rail dd { font-size: 26px; }
  .bar-fill { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flow { animation: none; stroke-dasharray: none; }
}
