:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #16161a;
  --muted: #5d5d66;
  --line: #e4e2da;
  --taxi: #ffc629;
  --taxi-ink: #1a1400;
  --accent: #1f4fd6;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.06), 0 8px 24px rgba(20, 20, 30, 0.06);
  --radius: 14px;
  --staff: #6b3fd4;
  --member: #0f8a5f;
  --screener: #c2410c;
  --library: #1f4fd6;
  --anon: #5d5d66;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114;
    --surface: #1b1b20;
    --ink: #ececf0;
    --muted: #a3a3ad;
    --line: #2d2d35;
    --accent: #8aa9ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --staff: #b69cff;
    --member: #4fd1a1;
    --screener: #ff9a62;
    --library: #8aa9ff;
    --anon: #a3a3ad;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Hero */
.hero {
  background: #0d0d0f;
  color: #f4f4f6;
  border-bottom: 6px solid var(--taxi);
  background-image: repeating-linear-gradient(90deg, var(--taxi) 0 14px, transparent 14px 28px);
  background-size: 100% 8px;
  background-repeat: no-repeat;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--taxi);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  max-width: 18ch;
}
.lede {
  max-width: 70ch;
  color: #c9c9d1;
  font-size: 17px;
  margin: 0 0 32px;
}
.flow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: #1f1f24;
  color: #f4f4f6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #2e2e35;
  transition: background 0.15s, border-color 0.15s;
}
.flow a:hover { background: #2a2a31; border-color: var(--taxi); }
.flow span, .nav-num, .step-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--taxi);
  color: var(--taxi-ink);
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

/* Layout */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
}
.layout > *, .overview > *, .figure > * { min-width: 0; }
.toc {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.toc-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}
.toc a:hover { color: var(--ink); background: var(--surface); }
.toc a.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.toc .nav-num { width: 22px; height: 22px; font-size: 12px; background: var(--line); color: var(--muted); }
.toc a.active .nav-num { background: var(--taxi); color: var(--taxi-ink); }
.toc .nav-summary:first-of-type { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.toc .nav-summary a { padding-left: 42px; }

/* Overview */
.overview { display: grid; gap: 20px; margin-bottom: 56px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 6px; font-size: 20px; }
.card p { margin: 0 0 14px; color: var(--muted); }
.note { color: var(--muted); font-size: 14px; margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Steps */
.step { margin-bottom: 64px; }
.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.step-num { width: 40px; height: 40px; font-size: 18px; }
.step-head h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.01em; line-height: 1.2; }
.step-intro p { margin: 0 0 20px; color: var(--muted); max-width: 75ch; }

.figure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  align-items: start;
}
.figure-text p { margin: 0 0 10px; }
.figure-text ul { margin: 0 0 10px; padding-left: 20px; }
.figure-text li { margin-bottom: 6px; }
.figure-text strong:first-child { font-weight: 700; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.role-staff { --c: var(--staff); }
.role-member { --c: var(--member); }
.role-screener { --c: var(--screener); }
.role-library { --c: var(--library); }
.role-anon { --c: var(--anon); }

.shots { display: grid; gap: 12px; }
.shots-2 { grid-template-columns: 1fr 1fr; }
.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: zoom-in;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.shot:hover, .shot:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--taxi);
  outline: none;
}
.shot img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: top left;
}
.shot-name {
  display: block;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Summary sections */
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.summary h2 { margin: 0 0 12px; font-size: 22px; }
.summary h3 { margin: 18px 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.summary ul { margin: 0; padding-left: 20px; }
.summary li { margin-bottom: 8px; }
.summary p { margin: 0 0 10px; }
#what-works-today { border-left: 5px solid var(--member); }
#found-during-this-run { border-left: 5px solid var(--screener); }
#not-built-yet { border-left: 5px solid var(--anon); }

.foot { color: var(--muted); font-size: 14px; margin-top: 32px; }
.foot p { margin: 0 0 6px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0.94);
  display: flex;
  flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #f4f4f6;
  border-bottom: 1px solid #2a2a31;
}
.lb-caption { flex: 1; font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { font-size: 13px; color: #a3a3ad; font-variant-numeric: tabular-nums; }
.lb-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #34343c;
  background: #1f1f24;
  color: #f4f4f6;
  font-size: 18px;
  cursor: pointer;
}
.lb-btn:hover { border-color: var(--taxi); }
.lb-stage { flex: 1; overflow: auto; padding: 20px; text-align: center; }
.lb-stage img { max-width: min(100%, 1440px); height: auto; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
body.lb-open { overflow: hidden; }

/* Responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .toc {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 -24px 24px;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    max-height: none;
    overflow-x: auto;
  }
  .toc-title { display: none; }
  .toc ol { display: flex; gap: 4px; white-space: nowrap; }
  .toc .nav-summary { display: none; }
  .figure { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero-inner { padding: 44px 16px 28px; }
  .layout { padding: 0 16px 60px; }
  .toc { margin: 0 -16px 20px; }
  .shots-2 { grid-template-columns: 1fr; }
  .shot img { height: 220px; }
  .figure, .card, .summary { padding: 16px; }
}
