:root {
  --paper: #f5eddc;
  --paper-2: #e5d6bd;
  --ink: #141d22;
  --ink-soft: #35434b;
  --muted: #66747c;
  --line: rgba(20, 29, 34, 0.14);
  --copper: #b55d31;
  --copper-dark: #71351f;
  --teal: #1d747b;
  --teal-dark: #103f46;
  --cream: #fff8ea;
  --panel: rgba(255, 250, 239, 0.78);
  --panel-strong: rgba(255, 250, 239, 0.94);
  --terminal: #08151a;
  --terminal-2: #11272d;
  --terminal-ink: #d8f1e7;
  --shadow: 0 34px 100px rgba(47, 39, 30, 0.18);
  --display: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", serif;
  --sans: "Avenir Next", "Gill Sans", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --ui-corner-radius: 5px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 8% 8%, rgba(181, 93, 49, 0.22), transparent 30rem),
    radial-gradient(circle at 92% 12%, rgba(29, 116, 123, 0.18), transparent 32rem),
    linear-gradient(135deg, var(--paper), var(--paper-2));
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(rgba(20, 29, 34, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 29, 34, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 84%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.1;
  background-image:
    repeating-linear-gradient(0deg, rgba(20, 29, 34, 0.45) 0, rgba(20, 29, 34, 0.45) 1px, transparent 1px, transparent 7px);
  mix-blend-mode: multiply;
}

a {
  color: inherit;
}

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

/* ---------- Navigation ---------- */

.product-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: min(1180px, calc(100% - 32px));
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin: 14px auto 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  background: rgba(255, 250, 239, 0.76);
  box-shadow: 0 20px 60px rgba(47, 39, 30, 0.12);
  backdrop-filter: blur(18px);
}

.product-brand,
.product-links,
.nav-cta {
  display: inline-flex;
  align-items: center;
}

.product-brand {
  gap: 10px;
  padding-left: 6px;
  text-decoration: none;
  font-weight: 900;
}

.brand-glyph {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--ui-corner-radius);
  color: #fff9ee;
  background: linear-gradient(135deg, var(--copper), var(--teal));
  font-family: var(--mono);
  font-size: 12px;
}

.product-links {
  justify-content: center;
  gap: 2px;
}

.product-links a,
.nav-cta {
  min-height: 38px;
  padding: 0 13px;
  border-radius: var(--ui-corner-radius);
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
}

.product-links a:hover,
.nav-cta:hover {
  color: var(--ink);
  background: rgba(20, 29, 34, 0.08);
}

.nav-cta {
  color: #fff9ee;
  background: linear-gradient(180deg, var(--ink), #25343b);
}

/* ---------- Shell & Hero ---------- */

.site-shell {
  overflow: clip;
}

.hero {
  min-height: calc(100vh - 72px);
  width: min(1240px, calc(100% - 40px));
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(420px, 1.22fr);
  align-items: center;
  gap: clamp(48px, 7vw, 96px);
  margin: 0 auto;
  padding: 64px 0 96px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--copper-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.hero h1,
.chapter h2,
.final-cta h2,
.boundary-copy h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(72px, 11vw, 156px);
  line-height: 0.98;
}

.hero-subtitle {
  margin: 30px 0;
  color: var(--ink-soft);
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  text-decoration: none;
  font-weight: 900;
}

.button--primary {
  color: #fff9ee;
  background: linear-gradient(180deg, var(--copper), var(--copper-dark));
  box-shadow: 0 16px 34px rgba(113, 53, 31, 0.26);
}

.button--secondary {
  background: rgba(255, 250, 239, 0.72);
}

.hero-stage {
  position: relative;
  z-index: 1;
  min-height: clamp(560px, 58vw, 760px);
}

.hero-screen,
.hero-terminal {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--ui-corner-radius);
  background: #10242a;
  box-shadow: var(--shadow);
}

.hero-screen img {
  height: 100%;
  object-fit: cover;
}

.hero-screen--main {
  inset: 4% 3% 24% 6%;
  transform: rotate(-2.5deg);
}

.hero-screen--side {
  right: 0;
  bottom: 8%;
  width: 46%;
  height: 36%;
  transform: rotate(3.5deg);
}

.hero-terminal {
  left: 10%;
  right: 10%;
  bottom: 0;
  padding: 18px;
  color: var(--terminal-ink);
  background:
    radial-gradient(circle at 96% 8%, rgba(29, 116, 123, 0.34), transparent 36%),
    linear-gradient(180deg, var(--terminal), var(--terminal-2));
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: #8fb3ad;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 3px;
  transform: translateY(2px);
  background: #f0b65f;
  animation: cursor-blink 1.15s steps(2, start) infinite;
}

/* ---------- Chapters ---------- */

.chapter {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0;
}

.chapter-head {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(260px, 0.35fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 36px;
}

.chapter-head--wide {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.48fr);
}

.chapter-head--center {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.chapter-head--stack {
  grid-template-columns: 1fr;
}

.chapter h2,
.final-cta h2,
.boundary-copy h2 {
  font-size: clamp(38px, 6vw, 78px);
  line-height: 1.08;
}

.chapter-head p:not(.section-kicker),
.boundary-copy p,
.accelerator-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.chapter-head--center p:not(.section-kicker) {
  max-width: 560px;
}

.chapter-head--stack p:not(.section-kicker) {
  max-width: 620px;
  margin-top: 16px;
}

.chapter--pin {
  padding-top: 48px;
}

/* ---------- Motion track ---------- */

.motion-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(360px, 520px);
  gap: 16px;
  overflow-x: auto;
  padding: 8px 0 26px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.feature-panel {
  min-height: 470px;
  display: grid;
  align-content: end;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  scroll-snap-align: center;
  background:
    radial-gradient(circle at 84% 12%, rgba(29, 116, 123, 0.16), transparent 42%),
    var(--panel);
  box-shadow: 0 18px 62px rgba(47, 39, 30, 0.1);
}

.feature-panel--dark {
  color: #f6ead7;
  background:
    radial-gradient(circle at 92% 8%, rgba(29, 116, 123, 0.34), transparent 40%),
    linear-gradient(180deg, #15282e, #08151a);
}

.feature-panel span {
  color: var(--copper-dark);
  font-family: var(--mono);
  font-weight: 900;
}

.feature-panel--dark span {
  color: #f0b65f;
}

.feature-panel h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
}

.feature-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.feature-panel--dark p {
  color: rgba(246, 234, 215, 0.72);
}

/* ---------- Systems grid ---------- */

.foundation-section {
  width: min(1260px, calc(100% - 40px));
}

.foundation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.74fr) minmax(280px, 0.74fr);
  gap: 16px;
}

.foundation-card {
  min-height: 390px;
  display: grid;
  align-content: end;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  background:
    radial-gradient(circle at 86% 10%, rgba(29, 116, 123, 0.13), transparent 42%),
    var(--panel);
  box-shadow: 0 18px 70px rgba(47, 39, 30, 0.1);
  overflow-wrap: break-word;
}

.foundation-card--wide {
  min-height: 520px;
}

.foundation-card--dark {
  color: #f6ead7;
  background:
    radial-gradient(circle at 92% 10%, rgba(29, 116, 123, 0.36), transparent 44%),
    linear-gradient(180deg, #14282e, #08151a);
}

.foundation-card span {
  color: var(--copper-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.foundation-card--dark span {
  color: #f0b65f;
}

.foundation-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.18;
}

.foundation-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.foundation-card--dark p {
  color: rgba(246, 234, 215, 0.74);
}

.foundation-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.foundation-flow b {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(255, 250, 239, 0.64);
}

.systems-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.58fr);
  gap: 18px;
  align-items: stretch;
}

.systems-grid .chapter-head {
  grid-column: 1 / -1;
}

.evidence-shot,
.wide-shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--ui-corner-radius);
  background: #10242a;
  box-shadow: var(--shadow);
}

.evidence-shot img,
.wide-shot img {
  height: 100%;
  object-fit: cover;
}

.evidence-shot--terminal {
  min-height: 620px;
}

.systems-list {
  display: grid;
  gap: 14px;
}

.systems-list article {
  min-height: 190px;
  display: grid;
  align-content: end;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  background: var(--panel);
}

.systems-list b {
  color: var(--copper-dark);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.systems-list strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.systems-list p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

/* ---------- Inspect ---------- */

.inspect-section {
  width: min(1260px, calc(100% - 40px));
}

.architecture-shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(113, 53, 31, 0.2);
  border-radius: var(--ui-corner-radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.architecture-shot img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---------- Accelerator ---------- */

.accelerator-section {
  width: 100%;
  max-width: none;
  padding: 110px max(24px, calc((100vw - 1180px) / 2));
  color: #f6ead7;
  background:
    radial-gradient(circle at 88% 8%, rgba(29, 116, 123, 0.36), transparent 32rem),
    linear-gradient(180deg, #12262c, #071318);
}

.accelerator-section .section-kicker,
.accelerator-section h2 {
  color: #f6ead7;
}

.accelerator-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.46fr) minmax(0, 0.82fr);
  gap: 24px;
  align-items: stretch;
}

.accelerator-copy {
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 28px;
  border: 1px solid rgba(246, 234, 215, 0.16);
  border-radius: var(--ui-corner-radius);
  background: rgba(255, 255, 255, 0.06);
}

.accelerator-copy p {
  color: rgba(246, 234, 215, 0.74);
  font-size: 18px;
}

.chip-flow {
  display: grid;
  gap: 10px;
}

.chip-flow span {
  padding: 12px 14px;
  border: 1px solid rgba(246, 234, 215, 0.16);
  border-radius: var(--ui-corner-radius);
  color: #d8f1e7;
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(8, 21, 26, 0.52);
}

/* ---------- Prototype & Evidence ---------- */

.prototype-grid,
.evidence-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.prototype-grid article,
.metric-card {
  min-height: 300px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  background: var(--panel);
}

.prototype-grid span,
.metric-card span {
  color: var(--copper-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prototype-grid h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.08;
}

.prototype-grid p,
.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.metric-card strong {
  font-family: var(--display);
  font-size: clamp(64px, 8vw, 116px);
  line-height: 0.92;
  color: var(--teal-dark);
}

.metric-card--zero strong {
  color: var(--copper-dark);
}

/* ---------- Boundary & Final CTA ---------- */

.boundary-section {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 0.5fr);
  gap: 22px;
  align-items: center;
}

.boundary-copy h2 {
  margin: 0;
}

.boundary-copy .section-kicker {
  margin-bottom: 12px;
}

.boundary-copy p:not(.section-kicker) {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 520px;
}

.boundary-stack {
  display: grid;
  gap: 12px;
}

.boundary-stack div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--ui-corner-radius);
  background: var(--panel-strong);
  color: var(--ink-soft);
  font-weight: 800;
}

.final-cta {
  width: min(980px, calc(100% - 40px));
  min-height: 520px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  margin: 0 auto;
  padding: 96px 0 120px;
  text-align: center;
}

.final-cta .hero-actions {
  justify-content: center;
  margin-top: 0;
}

/* ---------- Reveal animations ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 720ms ease,
    transform 720ms ease;
}

[data-reveal="from-right"] {
  transform: translateX(54px);
}

[data-reveal="from-left"] {
  transform: translateX(-54px);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(32px);
  }

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

@keyframes cursor-blink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .product-nav {
    grid-template-columns: 1fr auto;
    border-radius: var(--ui-corner-radius);
  }

  .product-links {
    display: none;
  }

  .hero,
  .foundation-grid,
  .systems-grid,
  .accelerator-layout,
  .boundary-section,
  .chapter-head,
  .chapter-head--wide,
  .chapter-head--stack {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 520px;
  }

  .hero-screen--main {
    inset: 0 0 180px 0;
  }

  .hero-screen--side {
    display: none;
  }

  .hero-terminal {
    left: 0;
    right: 0;
  }

  .hero h1 {
    font-size: clamp(72px, 18vw, 140px);
  }

  .hero-stage {
    min-height: 560px;
  }

  .prototype-grid,
  .foundation-grid,
  .evidence-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .wide-shot,
  .evidence-shot--terminal {
    min-height: 420px;
  }

  .chapter-head--center {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 680px) {
  .product-nav,
  .hero,
  .chapter,
  .final-cta,
  .inspect-section {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: clamp(64px, 22vw, 110px);
  }

  .hero-stage {
    min-height: 460px;
  }

  .hero-screen--main {
    inset: 0 0 170px 0;
  }

  .hero-screen--side {
    display: none;
  }

  .hero-terminal {
    left: 0;
    right: 0;
  }

  .motion-track {
    grid-auto-columns: minmax(280px, 84vw);
  }

  .prototype-grid,
  .foundation-grid,
  .evidence-metrics {
    grid-template-columns: 1fr;
  }

  .architecture-shot {
    border-radius: var(--ui-corner-radius);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
