:root {
  --ink: #0e0f12;
  --slate: #15171c;
  --card: #1d2027;
  --card-2: #23262e;
  --line: #34363c;
  --text: #e8e2d4;
  --muted: #a39d90;
  --amber: #d4a24c;
  --amber-hi: #e3b566;
  --evidence: #e9c46a;
  --oxblood: #8e2a2a;
  --oxblood-hi: #c65b5b;
  --sage: #5e7a5a;
  --paper: #ece5d3;
  --paper-ink: #1b1b1b;
  --radius: 4px;
  --max: 1200px;
  --serif: "Playfair Display", Georgia, serif;
  --type: "Special Elite", "Courier New", monospace;
  --body: "Lora", Georgia, serif;
  --ui: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--amber-hi); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 112px 0; }
.section.alt { background: var(--slate); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section.tight { padding: 64px 0; }
@media (max-width: 700px) { .section { padding: 64px 0; } body { font-size: 16px; } }

.eyebrow {
  font-family: var(--type);
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .15em;
  font-size: .85rem;
  margin: 0 0 1rem;
}
.lede { font-size: 1.2rem; color: var(--text); max-width: 46ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 15, 18, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-family: var(--type); letter-spacing: .15em; color: var(--text); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.brand span { color: var(--amber); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  font-family: var(--ui); font-size: .9rem; font-weight: 600;
  color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: var(--radius);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a.nav-accuse { background: var(--amber); color: var(--ink); margin-left: 8px; }
.nav a.nav-accuse:hover { background: var(--amber-hi); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 6px 10px; font-family: var(--ui); }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--ink); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav a.nav-accuse { margin: 8px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ui); font-weight: 600; font-size: 1rem;
  padding: 14px 22px; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; border: 1px solid var(--amber);
  transition: background .15s, color .15s;
}
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: var(--amber-hi); color: var(--ink); }
.btn-secondary { background: transparent; color: var(--amber); }
.btn-secondary:hover { background: rgba(212, 162, 76, .1); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: min(calc(100vh - 64px), 760px);
  display: flex; align-items: center;
  background:
    radial-gradient(ellipse 60% 70% at 15% 20%, rgba(212, 162, 76, .18), transparent 70%),
    radial-gradient(ellipse 50% 60% at 90% 100%, rgba(142, 42, 42, .18), transparent 70%),
    var(--ink);
  border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero .wrap { width: 100%; position: relative; z-index: 1; padding-top: 64px; padding-bottom: 64px; }
.hero h1 { max-width: 14ch; }

/* ---------- Page header ---------- */
.page-head { padding: 80px 0 48px; border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 50% 90% at 10% 0%, rgba(212, 162, 76, .12), transparent 70%); }
.page-head p { color: var(--muted); max-width: 60ch; margin: 0; }
.page-head p.eyebrow { color: var(--amber); margin-bottom: 1rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: .35em; }
.step-num { font-family: var(--serif); font-size: 3rem; color: var(--amber); line-height: 1; margin-bottom: 12px; }

.paper {
  background: var(--paper); color: var(--paper-ink);
  font-family: var(--type); font-size: 1rem; line-height: 1.7;
  padding: 40px 44px; border-radius: 2px;
  transform: rotate(-.6deg);
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 20px 40px rgba(0,0,0,.35);
  max-width: 680px; margin: 0 auto;
}
.paper h3 { font-family: var(--type); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; font-size: 1.1rem; }
.paper .sig { margin-top: 1.5em; }
@media (max-width: 620px) { .paper { padding: 28px 22px; transform: none; } }

.callout { border-left: 3px solid var(--amber); background: var(--card); padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- Evidence ---------- */
.evidence { position: relative; padding-top: 52px; }
.evidence .tag {
  position: absolute; top: 16px; left: 16px;
  font-family: var(--type); color: var(--ink); background: var(--evidence);
  padding: 2px 10px; border-radius: 2px; font-size: .85rem; letter-spacing: .08em;
}
.evidence .note { color: var(--muted); font-size: .95rem; margin: 0; }
.evidence strong { color: var(--text); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 760px; }
.timeline::before { content: ""; position: absolute; left: 112px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 32px; padding: 10px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 108px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.timeline time { font-family: var(--type); color: var(--amber); text-align: right; font-size: .95rem; padding-top: 2px; }
@media (max-width: 620px) {
  .timeline::before { left: 4px; } .timeline li::before { left: 0; }
  .timeline li { grid-template-columns: 1fr; gap: 0; padding-left: 24px; }
  .timeline time { text-align: left; }
}

/* ---------- Role tags ---------- */
.role { display: inline-block; font-family: var(--type); font-size: .75rem; letter-spacing: .12em; padding: 2px 8px; border-radius: 2px; color: var(--text); }
.role.suspect { background: var(--oxblood); }
.role.witness { background: var(--sage); }

/* ---------- Portraits ---------- */
.portrait { width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--card-2); border: 1px solid var(--line); }
.portrait svg { width: 100%; height: 100%; }

/* ---------- Lineup ---------- */
.lineup { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .lineup { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .lineup { gap: 12px; } }
.suspect-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.suspect-card:hover { border-color: var(--amber); transform: translateY(-2px); color: var(--text); }
.suspect-card h3 { margin: 0; font-size: 1.25rem; }
.suspect-card .bio { color: var(--muted); font-size: .95rem; margin: 0; flex: 1; }
.suspect-card .cta { font-family: var(--ui); font-weight: 600; font-size: .95rem; color: var(--amber); }
@media (max-width: 480px) { .suspect-card { padding: 10px; } .suspect-card .bio { display: none; } .suspect-card h3 { font-size: 1rem; } }

/* ---------- Dossier tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  font-family: var(--ui); font-weight: 600; font-size: .95rem; padding: 12px 14px; cursor: pointer; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--amber); }
.dossier-panel[hidden] { display: none; }
.dossier-panel ul { padding-left: 1.1em; margin: 0; }
.dossier-panel li { margin-bottom: .4em; }

/* ---------- Room ---------- */
.room { display: grid; grid-template-columns: 96px 1fr 340px; min-height: calc(100vh - 64px); }
.room > * { min-width: 0; }
.rail { border-right: 1px solid var(--line); background: var(--slate); padding: 16px 12px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.rail a { display: block; text-decoration: none; color: var(--muted); font-family: var(--ui); font-size: .7rem; text-align: center; font-weight: 600; }
.rail a .portrait { margin-bottom: 4px; transition: border-color .15s; }
.rail a[aria-current="page"] { color: var(--text); }
.rail a[aria-current="page"] .portrait, .rail a:hover .portrait { border-color: var(--amber); }
.room-main { padding: 48px clamp(20px, 4vw, 56px); }
.room-head { display: grid; grid-template-columns: 180px 1fr; gap: 32px; align-items: end; margin-bottom: 36px; }
.room-head h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: .2em; }
.legend-stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 28px; }
.legend-stage .welcome { font-family: var(--serif); font-style: italic; font-size: 1.3rem; border-left: 3px solid var(--amber); padding-left: 18px; margin: 0 0 18px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 8px; vertical-align: middle; }
.status-dot.live { background: #6fbf73; box-shadow: 0 0 0 4px rgba(111,191,115,.15); }
.room-notes { border-left: 1px solid var(--line); background: var(--slate); padding: 24px; position: sticky; top: 64px; height: calc(100vh - 64px); display: flex; flex-direction: column; }
.room-notes textarea { flex: 1; min-height: 200px; }
@media (max-width: 1100px) {
  .room { grid-template-columns: 84px 1fr; }
  .room-notes { grid-column: 2; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .room { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 64px; z-index: 10; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .rail a { flex: 0 0 60px; }
  .room-notes { grid-column: 1; }
  .room-head { grid-template-columns: 96px 1fr; gap: 16px; }
  .room-main { padding: 32px 16px; }
}

/* ---------- Forms ---------- */
label { display: block; font-family: var(--ui); font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
select, textarea {
  width: 100%; background: var(--ink); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--body); font-size: 1rem; padding: 12px 14px;
}
select { font-family: var(--ui); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%), linear-gradient(135deg, var(--amber) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea { line-height: 1.6; resize: vertical; }
select:focus, textarea:focus { outline: none; border-color: var(--amber); }
.field { margin-bottom: 22px; }

.board-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.board-row:last-child { border-bottom: 0; }
.board-row span { font-family: var(--serif); }
.board-row select { padding: 8px 36px 8px 10px; font-size: .9rem; }

.result { font-family: var(--serif); font-size: 1.25rem; min-height: 1.6em; margin: 20px 0 6px; }
.result.ok { color: var(--evidence); }
.result.bad { color: var(--oxblood-hi); }
.epilogue { white-space: pre-line; margin-top: 32px; }

.tip { border-left: 3px solid var(--amber); background: var(--card); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }

.notebook-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 40;
  background: var(--card); border: 1px solid var(--amber); color: var(--amber);
  font-family: var(--ui); font-weight: 600; font-size: .9rem;
  padding: 10px 14px; border-radius: var(--radius); text-decoration: none;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .85rem; font-family: var(--ui); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.fade-up { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-up { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Wix Legends promo ---------- */
.promo { background: radial-gradient(ellipse 70% 80% at 85% 0%, rgba(212, 162, 76, .14), transparent 70%), var(--slate); border-top: 1px solid var(--line); }
.promo-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-top: 32px; padding: 28px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--amber);
}
.promo-cta > div { flex: 1 1 320px; }
.legend-badge {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 24px; padding: 16px 20px; border: 1px dashed var(--line); border-radius: var(--radius);
}
.legend-badge p { flex: 1 1 260px; color: var(--muted); }
.legend-badge .btn { padding: 10px 16px; font-size: .9rem; }
