*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #090908;
  --ink: #f5f0e7;
  --muted: rgba(245, 240, 231, 0.68);
  --faint: rgba(245, 240, 231, 0.42);
  --line: rgba(245, 240, 231, 0.16);
  --line-strong: rgba(245, 240, 231, 0.34);
  --panel: #12110f;
  --panel-alt: #1b1a17;
  --accent: #aab7a6;
  --warm: #d8b77e;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 9, 8, 0.86);
  backdrop-filter: blur(18px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.nav-links,
.lang-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 10px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(245, 240, 231, 0.06);
}

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

.hero {
  min-height: calc(100svh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: end;
  padding: clamp(56px, 9vw, 112px) 0 clamp(36px, 6vw, 70px);
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-kicker,
.metric-label,
.caption,
.slot-label,
.tech-note,
.chapter-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero-title {
  margin: 14px 0 18px;
  max-width: 16ch;
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.95;
  font-weight: 120;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-lead {
  margin: 0;
  color: rgba(245, 240, 231, 0.82);
  font-size: clamp(17px, 1.7vw, 22px);
  max-width: 650px;
}

.hero-actions,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.button,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  background: rgba(245, 240, 231, 0.05);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.button.secondary,
.tag {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}

.button:hover {
  border-color: var(--ink);
  background: rgba(245, 240, 231, 0.1);
}

.hero-media {
  margin: 0;
}

.video-frame {
  border: 1px solid var(--line);
  background: #000;
}

.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.caption {
  padding: 10px 0 0;
  line-height: 1.6;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 clamp(42px, 7vw, 78px);
  border: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-height: 112px;
  padding: 18px;
  background: var(--panel);
}

.metric-value {
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.35;
}

.section {
  padding: clamp(46px, 8vw, 90px) 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.58fr) minmax(280px, 0.42fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: start;
  margin-bottom: clamp(28px, 5vw, 52px);
}

.section-title {
  margin: 9px 0 0;
  font-size: clamp(30px, 5vw, 68px);
  line-height: 1.02;
  font-weight: 150;
  letter-spacing: 0;
}

.section-lead {
  margin: 0;
  color: rgba(245, 240, 231, 0.78);
  font-size: clamp(16px, 1.4vw, 19px);
}

.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.body-copy p {
  margin: 0 0 18px;
  color: var(--muted);
}

.chapter-grid,
.slot-grid,
.reference-grid,
.validation-grid {
  display: grid;
  gap: 16px;
}

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

.chapter,
.slot,
.validation-item {
  border: 1px solid var(--line);
  background: var(--panel);
}

.chapter img,
.slot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050505;
}

.chapter-body,
.slot-body,
.validation-item {
  padding: 16px;
}

.chapter h3,
.slot h3,
.validation-item h3 {
  margin: 6px 0 8px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 260;
}

.chapter p,
.slot p,
.validation-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.story-board {
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.story-board img {
  width: 100%;
  object-fit: contain;
  background: #000;
}

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

.reference-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.reference-media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(150px, 15vw, 220px);
  padding: 10px;
  background: #f5f5f3;
}

.reference-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

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

.tech-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.tech-item {
  padding: 18px;
  background: var(--panel-alt);
}

.tech-item strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 17px;
  font-weight: 320;
}

.tech-item span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

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

.footer-panel {
  padding: 44px 0 70px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

@media (max-width: 940px) {
  .hero,
  .section-head,
  .body-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 44px;
  }

  .meta-strip,
  .tech-stack,
  .chapter-grid,
  .slot-grid,
  .reference-grid,
  .validation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-media {
    height: clamp(150px, 26vw, 210px);
  }
}

@media (max-width: 640px) {
  .site-nav {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav a {
    min-height: 32px;
    padding: 7px 9px;
  }

  .shell {
    width: min(100% - 28px, 1180px);
  }

  .meta-strip,
  .tech-stack,
  .chapter-grid,
  .slot-grid,
  .reference-grid,
  .validation-grid {
    grid-template-columns: 1fr;
  }

  .reference-media {
    height: 168px;
  }

  .footer-panel {
    flex-direction: column;
  }
}
