:root {
  color-scheme: light;
  --ink: #10130f;
  --ink-soft: #31382f;
  --paper: #f2f4ef;
  --paper-strong: #fffdf8;
  --sage: #6d7d61;
  --moss: #24564f;
  --amber: #c77f2e;
  --gold: #ffd60a;
  --rust: #b85236;
  --line: rgba(16, 19, 15, 0.16);
  --line-strong: rgba(16, 19, 15, 0.28);
  --shadow: 0 24px 80px rgba(16, 19, 15, 0.16);
  --max: 1180px;
  --measure: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: 76svh;
  display: grid;
  align-items: end;
  color: var(--paper-strong);
  overflow: hidden;
  background: #10130f;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(10, 14, 12, 0.92) 0%, rgba(10, 14, 12, 0.74) 48%, rgba(10, 14, 12, 0.36) 100%),
    linear-gradient(180deg, rgba(10, 14, 12, 0.16), rgba(10, 14, 12, 0.88)),
    url("/assets/stages/demo-analog-split.jpg");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.nav {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px max(22px, calc((100vw - var(--max)) / 2));
  color: rgba(255, 250, 240, 0.86);
  font-size: 0.88rem;
  font-weight: 680;
}

.nav__brand {
  margin-right: auto;
  color: var(--paper-strong);
  font-size: 1.04rem;
  font-weight: 820;
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
  padding: 132px 0 58px;
}

.kicker {
  margin: 0 0 14px;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 820;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

h1 {
  max-width: 980px;
  margin-bottom: 24px;
  font-size: 3.92rem;
  line-height: 0.98;
}

h2 {
  max-width: 940px;
  margin-bottom: 0;
  font-size: 3.05rem;
  line-height: 1.05;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.36rem;
  line-height: 1.18;
}

h4 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  line-height: 1.25;
}

p {
  font-size: 1rem;
  line-height: 1.66;
}

.hero__copy {
  max-width: 760px;
  color: rgba(255, 250, 240, 0.88);
  font-size: 1.2rem;
  line-height: 1.62;
}

.hero__visual-note {
  max-width: 660px;
  margin: 0 0 22px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.96rem;
  line-height: 1.52;
}

.hero__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid rgba(255, 250, 240, 0.52);
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.08);
  color: var(--paper-strong);
  font-weight: 760;
}

.section__inner {
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
}

.section__split {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(320px, 1fr);
  gap: 72px;
  align-items: start;
}

.section__heading {
  max-width: var(--measure);
}

.section__heading--wide {
  max-width: 980px;
  margin-bottom: 44px;
}

.section-intro {
  max-width: 760px;
  margin: 20px 0 0;
  color: rgba(16, 19, 15, 0.74);
  font-size: 1.1rem;
}

.section-intro--light {
  color: rgba(255, 250, 240, 0.78);
}

.lead-copy {
  max-width: var(--measure);
}

.lead-copy p {
  margin-bottom: 18px;
  color: rgba(16, 19, 15, 0.76);
  font-size: 1.12rem;
}

.lead-copy p:last-child {
  margin-bottom: 0;
}

.direction,
.app-state,
.model {
  padding: 88px 0;
  background: var(--paper-strong);
}

.app-state {
  background: #f7faf6;
}

.data-grid,
.stage-grid {
  display: grid;
  gap: 16px;
  margin-top: 54px;
}

.data-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.data-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stage-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.data-grid article,
.stage-card,
.compact-note {
  min-height: 196px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
}

.data-grid span,
.stage-card span {
  display: block;
  margin-bottom: 9px;
  color: var(--rust);
  font-size: 0.76rem;
  font-weight: 840;
  text-transform: uppercase;
}

.data-grid p,
.stage-card p,
.compact-note p {
  margin-bottom: 0;
  color: rgba(16, 19, 15, 0.72);
}

.visual-rationale {
  margin-top: 34px;
  padding: 18px 20px;
  border-left: 3px solid var(--amber);
  background: rgba(255, 253, 248, 0.66);
}

.visual-rationale--flush {
  margin: 0 0 18px;
}

.visual-rationale--dark {
  border-color: #ffc06f;
  background: rgba(255, 250, 240, 0.09);
}

.visual-rationale p {
  max-width: 860px;
  margin-bottom: 0;
  color: rgba(16, 19, 15, 0.72);
  font-size: 0.98rem;
  line-height: 1.58;
}

.visual-rationale--dark p {
  color: rgba(255, 250, 240, 0.74);
}

.demo-block {
  margin-bottom: 36px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.66);
}

.demo-copy {
  max-width: 820px;
}

.demo-copy h3 {
  margin-bottom: 12px;
}

.demo-copy p:last-child {
  margin-bottom: 0;
  color: rgba(16, 19, 15, 0.74);
}

code {
  padding: 0.12em 0.34em;
  border: 1px solid rgba(16, 19, 15, 0.14);
  border-radius: 4px;
  background: rgba(16, 19, 15, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.demo-figure {
  margin-top: 46px;
}

.demo-figure--inside {
  margin: 26px 0 0;
}

.demo-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 19, 15, 0.18);
}

.demo-figure figcaption {
  max-width: 860px;
  margin-top: 14px;
  color: rgba(16, 19, 15, 0.72);
  font-size: 0.94rem;
  line-height: 1.56;
}

.demo-figure figcaption strong {
  color: var(--ink);
}

.pipeline-section {
  padding: 92px 0;
  background: #e2e8e1;
}

.pipeline {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline-step {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.64) inset;
}

.pipeline-step--dark {
  color: var(--paper-strong);
  background: #161914;
  box-shadow: var(--shadow);
}

.step-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--moss);
  font-weight: 820;
}

.pipeline-step--dark .step-number {
  border-color: rgba(255, 250, 240, 0.18);
  background: var(--rust);
  color: var(--paper-strong);
}

.step-copy {
  max-width: 700px;
}

.step-copy p {
  margin-bottom: 0;
  color: rgba(16, 19, 15, 0.74);
  font-size: 1.06rem;
}

.pipeline-step--dark .step-copy p {
  color: rgba(255, 250, 240, 0.76);
}

.details {
  padding: 88px 0;
  color: var(--paper-strong);
  background: var(--moss);
}

.details .kicker {
  color: #ffc06f;
}

.details h2 {
  color: var(--paper-strong);
}

.stage-card {
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(16, 19, 15, 0.18);
}

.stage-card span {
  color: #ffc06f;
}

.stage-card p {
  color: rgba(255, 250, 240, 0.78);
}

.effect-example {
  margin: 20px 0 0;
}

.effect-example img {
  display: block;
  width: 100%;
  aspect-ratio: 45 / 28;
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: 8px;
  object-fit: cover;
}

.effect-example figcaption {
  margin-top: 10px;
  color: rgba(255, 250, 240, 0.68);
  font-size: 0.86rem;
  line-height: 1.45;
}

.evidence {
  padding: 88px 0;
  background: var(--paper);
}

.compact-note {
  min-height: 0;
  margin-top: 44px;
  background: rgba(255, 250, 240, 0.64);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px max(22px, calc((100vw - var(--max)) / 2));
  color: rgba(255, 250, 240, 0.72);
  background: var(--ink);
}

.footer a {
  color: var(--paper-strong);
  font-weight: 760;
}

.footer__links {
  display: flex;
  gap: 20px;
}

.legal-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  position: relative;
  min-height: 84px;
  color: var(--paper-strong);
  background: var(--ink);
}

.legal-main {
  flex: 1;
  width: min(100% - 44px, 860px);
  margin: 0 auto;
  padding: 72px 0 88px;
}

.legal-card {
  padding: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  max-width: none;
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

.legal-card h2 {
  max-width: none;
  margin: 42px 0 12px;
  font-size: 1.42rem;
}

.legal-card p,
.legal-card li {
  color: rgba(16, 19, 15, 0.78);
  font-size: 1.04rem;
  line-height: 1.66;
}

.legal-card ul {
  padding-left: 1.3rem;
}

.legal-lead {
  max-width: 700px;
  color: var(--ink) !important;
  font-size: 1.24rem !important;
}

.text-link {
  color: var(--moss);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.support-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  margin-top: 12px;
  padding: 0 20px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper-strong);
  font-weight: 760;
}

@media (max-width: 1080px) {
  .data-grid,
  .data-grid--three,
  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  h1 {
    font-size: 3.6rem;
  }

  h2 {
    font-size: 2.45rem;
  }

  .section__split,
  .pipeline-step {
    grid-template-columns: 1fr;
  }

  .section__split {
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 76svh;
  }

  .hero__content,
  .section__inner {
    width: min(100% - 28px, 362px);
    margin-left: 14px;
    margin-right: auto;
  }

  .hero__content {
    padding: 122px 0 54px;
  }

  .nav {
    padding: 18px 14px;
  }

  .nav a:not(.nav__brand) {
    display: none;
  }

  h1 {
    font-size: 1.82rem;
    line-height: 1.06;
  }

  h2 {
    font-size: 1.48rem;
    line-height: 1.12;
  }

  h3 {
    font-size: 1.22rem;
  }

  .hero__copy,
  .lead-copy p,
  .step-copy p {
    font-size: 1rem;
  }

  .direction,
  .app-state,
  .model,
  .pipeline-section,
  .details,
  .evidence {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .data-grid,
  .data-grid--three,
  .stage-grid {
    grid-template-columns: 1fr;
  }

  .data-grid article,
  .stage-card,
  .pipeline-step,
  .demo-block,
  .compact-note {
    padding: 22px;
  }

  .demo-figure {
    margin-top: 38px;
  }

  .pipeline-step {
    gap: 18px;
  }

  .footer {
    flex-direction: column;
    padding: 24px 14px;
  }

  .legal-main {
    width: min(100% - 28px, 520px);
    padding: 34px 0 56px;
  }

  .legal-card {
    padding: 26px 22px;
  }

  .legal-card h1 {
    font-size: 2.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
