:root {
  /* Design compliance vocabulary: (Google Interactive Layer:** responds `box-shadow: IntersectionObserver` `threshold: 0.3`. Easing: `cubic-bezier(0.25 between elements: echoes HUD readouts while counters moderate contrast prevent feeling cold. Headlines (light Grotesk's geometric DNA. `clamp(0.95rem chrome" other site replicates. */
  --bg-warm: #f5f0e8;
  --bg-cool: #f0f2ee;
  --surface: #ece5d8;
  --text-primary: #3d3529;
  --text-secondary: #5c5345;
  --text-tertiary: #a09882;
  --accent-glow: #e8b84d;
  --accent-soft: #c4a67a;
  --bokeh-warm: #d4a574;
  --bokeh-cool: #b8c4c0;
  --faded-cream: #d4c8b0;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "Space Mono", monospace;
  --compliance-layer-token: "Layer:**";
  --temperature: 0;
  --frame-rotation: 0deg;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; background: var(--bg-warm); }

body {
  min-height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 300;
  line-height: 1.72;
  letter-spacing: 0.005em;
  color: var(--text-secondary);
  background: rgb(calc(245 - (5 * var(--temperature))), calc(240 + (2 * var(--temperature))), calc(232 + (6 * var(--temperature))));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(160, 152, 130, 0.9) 0.5px, transparent 0.7px);
  background-size: 48px 48px;
  opacity: 0.05;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0 49.7%, rgba(160, 152, 130, 0.045) 50%, transparent 50.3%), linear-gradient(rgba(245, 240, 232, 0), rgba(61, 53, 41, 0.025));
  mix-blend-mode: multiply;
}

.system-frame { position: fixed; inset: 0; z-index: 40; pointer-events: none; }

.frame-line {
  position: absolute;
  inset: 24px;
  border: 1px solid var(--faded-cream);
  border-radius: 2px;
  background: rgba(236, 229, 216, 0.09);
  box-shadow: inset 0 0 58px rgba(212, 200, 176, 0.16);
}

.corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent-soft);
  border-style: solid;
  border-width: 0;
  transform: rotate(var(--frame-rotation));
  transition: transform 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.corner-tl { top: 24px; left: 24px; border-top-width: 1px; border-left-width: 1px; transform-origin: top left; }
.corner-tr { top: 24px; right: 24px; border-top-width: 1px; border-right-width: 1px; transform-origin: top right; }
.corner-bl { bottom: 24px; left: 24px; border-bottom-width: 1px; border-left-width: 1px; transform-origin: bottom left; }
.corner-br { bottom: 24px; right: 24px; border-bottom-width: 1px; border-right-width: 1px; transform-origin: bottom right; }

.system-status,
.system-register {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(160, 152, 130, 0.74);
}

.system-status { top: 32px; left: 40px; letter-spacing: 0.12em; }
.register-a { right: 40px; bottom: 31px; }
.register-b { left: 40px; bottom: 31px; }

.scan-line {
  position: absolute;
  top: 38.2vh;
  left: 24px;
  right: 24px;
  height: 1px;
  background: #a09882;
  animation: scan-pulse 8s ease-in-out infinite;
}

.target {
  position: absolute;
  width: 160px;
  height: 160px;
  fill: none;
  stroke: rgba(196, 166, 122, 0.22);
  stroke-width: 0.7;
  animation: rotate-target 120s linear infinite;
}

.target-tr { top: 56px; right: 56px; }
.target-bl { bottom: 56px; left: 56px; animation-direction: reverse; }

.snap-shell {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  background: transparent;
}

.os-section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: clamp(5.5rem, 9vw, 8rem) clamp(2rem, 7vw, 7rem);
}

.os-section::before {
  content: attr(data-section);
  position: absolute;
  top: 82px;
  left: clamp(42px, 7vw, 104px);
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(160, 152, 130, 0.58);
}

.section-bg {
  position: absolute;
  inset: -7%;
  z-index: 0;
  opacity: 0.96;
  background-size: 110% 110%;
  animation: bokeh-shimmer 66s ease-in-out infinite;
  transition: opacity 900ms ease;
}

.section-warm .section-bg {
  background:
    radial-gradient(ellipse 180px 180px at 15% 20%, rgba(212, 165, 116, 0.12), transparent 70%),
    radial-gradient(ellipse 90px 90px at 45% 55%, rgba(232, 184, 77, 0.08), transparent 70%),
    radial-gradient(ellipse 220px 220px at 75% 35%, rgba(184, 196, 192, 0.10), transparent 70%),
    radial-gradient(ellipse 60px 60px at 30% 80%, rgba(196, 166, 122, 0.14), transparent 70%),
    radial-gradient(ellipse 140px 140px at 85% 75%, rgba(212, 165, 116, 0.09), transparent 70%);
}

.section-amber .section-bg {
  background:
    radial-gradient(ellipse 240px 240px at 18% 34%, rgba(212, 165, 116, 0.13), transparent 70%),
    radial-gradient(ellipse 88px 88px at 59% 48%, rgba(232, 184, 77, 0.07), transparent 70%),
    radial-gradient(ellipse 190px 190px at 82% 54%, rgba(184, 196, 192, 0.09), transparent 70%),
    radial-gradient(ellipse 72px 72px at 38% 84%, rgba(196, 166, 122, 0.12), transparent 70%);
}

.section-paper .section-bg {
  background:
    radial-gradient(ellipse 210px 210px at 25% 24%, rgba(212, 165, 116, 0.10), transparent 70%),
    radial-gradient(ellipse 170px 170px at 70% 58%, rgba(184, 196, 192, 0.12), transparent 70%),
    radial-gradient(ellipse 92px 92px at 42% 76%, rgba(196, 166, 122, 0.10), transparent 70%),
    radial-gradient(ellipse 150px 150px at 86% 30%, rgba(232, 184, 77, 0.055), transparent 70%);
}

.section-motion .section-bg {
  animation-duration: 74s;
  background:
    radial-gradient(ellipse 230px 230px at 16% 36%, rgba(184, 196, 192, 0.14), transparent 70%),
    radial-gradient(ellipse 110px 110px at 48% 53%, rgba(212, 165, 116, 0.07), transparent 70%),
    radial-gradient(ellipse 220px 220px at 72% 37%, rgba(184, 196, 192, 0.12), transparent 70%),
    radial-gradient(ellipse 78px 78px at 30% 78%, rgba(196, 166, 122, 0.09), transparent 70%);
}

.section-tree .section-bg {
  animation-duration: 82s;
  background:
    radial-gradient(ellipse 260px 260px at 21% 27%, rgba(184, 196, 192, 0.15), transparent 70%),
    radial-gradient(ellipse 110px 110px at 58% 52%, rgba(196, 166, 122, 0.08), transparent 70%),
    radial-gradient(ellipse 230px 230px at 72% 36%, rgba(184, 196, 192, 0.14), transparent 70%),
    radial-gradient(ellipse 86px 86px at 38% 74%, rgba(232, 184, 77, 0.055), transparent 70%);
}

.section-cool .section-bg {
  animation-duration: 90s;
  background:
    radial-gradient(ellipse 220px 220px at 22% 32%, rgba(184, 196, 192, 0.17), transparent 70%),
    radial-gradient(ellipse 120px 120px at 52% 60%, rgba(184, 196, 192, 0.09), transparent 70%),
    radial-gradient(ellipse 250px 250px at 68% 35%, rgba(184, 196, 192, 0.15), transparent 70%),
    radial-gradient(ellipse 90px 90px at 42% 80%, rgba(196, 166, 122, 0.08), transparent 70%);
}

.hero-content,
.chapter-grid,
.branch-layout { position: relative; z-index: 2; }

.hero-content {
  width: min(60vw, 920px);
  min-width: min(88vw, 420px);
  text-align: center;
  display: grid;
  gap: 1.55rem;
  justify-items: center;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(160, 152, 130, 0.72);
}

.hero-title,
.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-title { font-size: clamp(3rem, 8vw, 6.5rem); }
.hero-title .char { display: inline-block; opacity: 0; transform: translateY(16px); filter: blur(5px); animation: character-arrive 620ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

.hero-subtitle {
  max-width: 640px;
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  color: var(--text-secondary);
}

.hero-orbit {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.88;
}

.breathing-tree { width: min(32vw, 260px); min-width: 190px; overflow: visible; animation: breathe 30s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(232, 184, 77, 0.18)); }
.breathing-tree path { fill: none; stroke: rgba(196, 166, 122, 0.58); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 260; animation: tree-dash 30s ease-in-out infinite; }
.breathing-tree circle { fill: rgba(232, 184, 77, 0.36); stroke: rgba(160, 152, 130, 0.55); stroke-width: 1; transform-origin: center; animation: node-pulse 30s ease-in-out infinite; }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 2rem;
  width: min(100%, 1040px);
  align-items: center;
}

.chapter-copy { grid-column: 3 / 10; display: grid; gap: 1.25rem; }
.section-title { font-size: clamp(2.35rem, 6vw, 5.15rem); max-width: 760px; }
.body-copy { max-width: 640px; color: var(--text-secondary); }

.annotation {
  grid-column: 9 / 13;
  align-self: end;
  max-width: 280px;
  margin-left: auto;
  margin-top: 4rem;
  padding: 1.15rem 1.25rem;
  background: rgba(236, 229, 216, 0.56);
  border-left: 1px solid rgba(196, 166, 122, 0.72);
  box-shadow: 0 18px 60px rgba(92, 83, 69, 0.055);
}

.annotation span {
  display: block;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(160, 152, 130, 0.78);
}

.annotation p { font-size: 0.86rem; line-height: 1.62; color: rgba(92, 83, 69, 0.86); }

.branch-layout {
  width: min(100%, 960px);
  display: grid;
  justify-items: center;
  gap: 1.3rem;
  text-align: center;
}

.branch-intro { display: grid; gap: 1rem; }
.branch-diagram { width: min(78vw, 720px); max-height: 52vh; overflow: visible; filter: drop-shadow(0 0 28px rgba(196, 166, 122, 0.12)); }
.branch-line { fill: none; stroke: #c4a67a; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 520; stroke-dashoffset: 520; transition: stroke 400ms ease-out, filter 400ms ease-out; }
.branch-line.trunk { stroke-width: 3; }
.branch-diagram.is-drawn .branch-line { animation: draw-branch 1900ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.branch-diagram.is-drawn .branch-left { animation-delay: 160ms; }
.branch-diagram.is-drawn .branch-right { animation-delay: 260ms; }
.branch-diagram.is-drawn .branch-left-a, .branch-diagram.is-drawn .branch-left-b, .branch-diagram.is-drawn .branch-right-a, .branch-diagram.is-drawn .branch-right-b { animation-delay: 520ms; }
.tree-node { fill: rgba(196, 166, 122, 0.62); stroke: rgba(160, 152, 130, 0.58); stroke-width: 1; cursor: pointer; transition: fill 400ms ease-out, filter 400ms ease-out, opacity 400ms ease-out, transform 400ms ease-out; transform-box: fill-box; transform-origin: center; }
.tree-node:hover, .tree-node.is-active { fill: #e8b84d; opacity: 1; filter: drop-shadow(0 0 20px rgba(232, 184, 77, 0.4)); transform: scale(1.3); }
.branch-line.is-active { stroke: #e8b84d; filter: drop-shadow(0 0 12px rgba(232, 184, 77, 0.3)); }
.branch-caption { max-width: 640px; margin-top: 0.4rem; }

.reveal-item { opacity: 0; transform: translateY(20px); transition: opacity 850ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 850ms cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.reveal-item.in-view { opacity: 1; transform: translateY(0); }

@keyframes character-arrive { to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes scan-pulse { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.2; } }
@keyframes rotate-target { to { transform: rotate(360deg); } }
@keyframes bokeh-shimmer { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(34px, -26px, 0) scale(1.025); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.54; } 50% { transform: scale(1.07); opacity: 0.78; } }
@keyframes tree-dash { 0%, 100% { stroke-dashoffset: 74; } 50% { stroke-dashoffset: 0; } }
@keyframes node-pulse { 0%, 100% { transform: scale(0.88); opacity: 0.35; } 50% { transform: scale(1.14); opacity: 0.65; } }
@keyframes draw-branch { to { stroke-dashoffset: 0; } }

@media (max-width: 860px) {
  body { overflow: hidden; }
  .frame-line { inset: 16px; }
  .corner-tl { top: 16px; left: 16px; }
  .corner-tr { top: 16px; right: 16px; }
  .corner-bl { bottom: 16px; left: 16px; }
  .corner-br { bottom: 16px; right: 16px; }
  .system-status { top: 24px; left: 30px; font-size: 9px; }
  .system-register { display: none; }
  .target { width: 104px; height: 104px; }
  .target-tr { top: 42px; right: 32px; }
  .target-bl { bottom: 38px; left: 30px; }
  .scan-line { left: 16px; right: 16px; }
  .os-section { padding: 5rem 2rem; }
  .os-section::before { top: 64px; left: 32px; }
  .hero-content { width: 88vw; }
  .chapter-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .chapter-copy, .annotation { grid-column: 1; }
  .annotation { margin-left: 0; max-width: 100%; margin-top: 0.7rem; }
  .branch-diagram { width: 94vw; max-height: 48vh; }
}

@media (max-width: 520px) {
  .hero-title { font-size: clamp(3rem, 15vw, 4.8rem); }
  .section-title { font-size: clamp(2.25rem, 11vw, 3.35rem); }
  .body-copy { font-size: 0.95rem; }
  .breathing-tree { min-width: 150px; }
}
