:root {
  --bg: #0a0c0f;
  --bg-raised: #12161b;
  --line: #222932;
  --text: #e7eaee;
  --muted: #98a2ae;
  --accent: #ff9d45;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: var(--mono); font-size: 0.92em; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

/* ---------- nav ---------- */

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; max-width: var(--wrap); margin: 0 auto; padding: 22px 24px;
}
.wordmark {
  font-family: var(--mono); font-weight: 600; letter-spacing: -0.03em;
  font-size: 18px; color: var(--text);
}
.wordmark::before {
  content: "▶"; color: var(--accent); font-size: 0.8em; margin-right: 7px;
}
.nav nav { display: flex; gap: 22px; font-size: 15px; }
.nav nav a { color: var(--muted); }
.nav nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- layout ---------- */

main { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

section { padding: 72px 0; border-top: 1px solid var(--line); }
section:first-child { border-top: 0; padding-top: 40px; }

section > h2 {
  font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 14px; max-width: 22ch;
}
.section-lead { color: var(--muted); max-width: 68ch; margin: 0 0 28px; }

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px; align-items: start;
}
.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 54px); margin-bottom: 22px; letter-spacing: -0.035em;
}
.lead { font-size: 18px; margin: 0 0 18px; max-width: 46ch; }
.sub { color: var(--muted); margin: 0 0 30px; max-width: 50ch; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }

.copy {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 12px 16px; cursor: pointer; font: inherit;
}
.copy:hover { border-color: var(--accent); }
.copy code { color: var(--text); }
.copy code::before { content: "$ "; color: var(--muted); }
.copy-hint {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.copy.copied .copy-hint { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text);
}
.btn:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- the brief ---------- */

.brief {
  border-left: 2px solid var(--accent); padding: 2px 0 2px 18px; margin: 0 0 30px;
}
.brief-label {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.brief-text {
  font-size: 20px; line-height: 1.4; margin: 0 0 10px; max-width: 30ch;
}
.brief-text::before, .brief-text::after { content: "\201C"; color: var(--muted); }
.brief-text::after { content: "\201D"; }
.brief-note { color: var(--muted); font-size: 14.5px; margin: 0; max-width: 48ch; }

/* ---------- code ---------- */

figure.hero-code { margin: 0; }
figure.hero-code figcaption {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 8px;
}
pre {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; overflow-x: auto; margin: 0;
}
pre code { font-size: 12.8px; line-height: 1.65; color: #cfd6de; }
.k { color: #ff9d45; }
.s { color: #8ed7a6; }
.n { color: #7fb6ff; }
.c { color: #6c7885; }

/* ---------- card grids ---------- */

.cards { display: grid; gap: 20px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards article {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 10px; padding: 22px;
}
.cards h3 { font-size: 17px; margin-bottom: 10px; }
.cards p { color: var(--muted); margin: 0; font-size: 15px; }
.cards code { color: var(--text); }

.vocab-intro { color: var(--muted); margin: 36px 0 12px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}

/* ---------- films ---------- */

.film-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }

.film { display: flex; flex-direction: column; gap: 14px; }

.film-frame {
  position: relative; aspect-ratio: var(--ar, 4 / 5); background: #000;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.film-frame video { width: 100%; height: 100%; display: block; object-fit: cover; }
.film-frame button.play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to top, rgba(10,12,15,0.55), rgba(10,12,15,0.05) 45%);
  border: 0; cursor: pointer; color: var(--text);
}
.film-frame button.play span {
  display: flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(10,12,15,0.72); border: 1px solid rgba(255,255,255,0.28);
  font-size: 20px; padding-left: 5px; transition: transform 0.15s ease, border-color 0.15s ease;
}
.film-frame button.play:hover span { transform: scale(1.08); border-color: var(--accent); }
.film.playing button.play { display: none; }

.film-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.film h3 { font-size: 17px; }
.film .archetype {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
}
.film .runtime { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.film p { color: var(--muted); font-size: 14.5px; margin: 0; }
.film .subject { font-size: 13.5px; color: var(--muted); }

/* ---------- the agent loop ---------- */

.loop {
  list-style: none; counter-reset: step; padding: 0; margin: 0 0 44px;
  display: grid; gap: 22px;
}
.loop li {
  counter-increment: step; position: relative; padding-left: 52px; max-width: 74ch;
}
.loop li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}
.loop h3 { font-size: 17px; margin-bottom: 6px; padding-top: 4px; }
.loop p { color: var(--muted); margin: 0; }
.loop em, .steps em, .agent > .section-lead em { color: var(--text); font-style: normal; }

.routes-head { font-size: 20px; margin: 44px 0 18px; }

.steps { padding-left: 22px; margin: 0 0 26px; display: grid; gap: 10px; max-width: 78ch; }
.steps li { color: var(--muted); }
.steps strong { color: var(--text); font-weight: 600; }

.agent pre { margin-bottom: 26px; }
.agent pre code { font-size: 12.2px; }

pre.wrap code { white-space: pre-wrap; overflow-wrap: anywhere; }

.copy.small { padding: 8px 13px; margin-bottom: 10px; font-size: 13px; }
.copy.small span:first-child { font-family: var(--mono); color: var(--muted); }

/* ---------- quickstart, status ---------- */

.quickstart pre { margin-bottom: 24px; }
.status-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 78ch; }
.status-list li { color: var(--muted); }
.status-list strong { color: var(--text); font-weight: 600; }

/* ---------- footer ---------- */

footer {
  max-width: var(--wrap); margin: 0 auto; padding: 40px 24px 64px;
  border-top: 1px solid var(--line); font-size: 14px;
}
footer p { margin: 0 0 6px; }
footer .muted { color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .cards.three, .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  section { padding: 52px 0; }
  .nav nav { gap: 14px; font-size: 14px; }
  .cards.two, .cards.three, .cards.four, .film-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film-frame button.play span { transition: none; }
}
