:root {
  --ink: #eae6da;
  --dim: #9a978d;
  --sand: #d8c49b;
  --line: rgba(216, 196, 155, 0.16);
  --panel: rgba(10, 13, 17, 0.78);
  --bg: #06090c;
  --accent: #b8452f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* `hidden` must beat an inline display value, or a hidden panel keeps covering the page */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--dim); }
kbd {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 2px;
  padding: 1px 4px; color: var(--dim);
}

/* ---------------------------------------------------------------- chrome */
#chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; pointer-events: none;
}
/* the hero's sky is bright at the top; the chrome needs a scrim of its own */
#chrome::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,9,12,.82), rgba(6,9,12,.35) 55%, transparent);
}
#chrome > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 18px; height: 18px; display: block;
  background:
    linear-gradient(var(--sand), var(--sand)) 0 0 / 8px 8px no-repeat,
    linear-gradient(#7d9a5c, #7d9a5c) 10px 0 / 8px 8px no-repeat,
    linear-gradient(#4a6b8a, #4a6b8a) 0 10px / 8px 8px no-repeat,
    linear-gradient(#9a8b6b, #9a8b6b) 10px 10px / 8px 8px no-repeat;
  border-radius: 2px;
}
.word {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px; letter-spacing: 0.26em; color: var(--ink);
}
.word b { font-weight: 500; color: var(--sand); }
#chrome nav { display: flex; align-items: center; gap: 22px; }
#chrome nav a {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #cfcabb;
  transition: color .15s;
}
#chrome nav a:hover { color: #fff; }
#chrome nav a.cta {
  color: #17140f; background: var(--sand); padding: 8px 14px; border-radius: 2px;
}
#chrome nav a.cta:hover { background: #efdcb4; }

/* ---------------------------------------------------------------- hero */
#hero {
  position: relative; height: 100vh; min-height: 560px;
  display: flex; align-items: center;
  overflow: hidden;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,9,12,.94) 0%, rgba(6,9,12,.78) 38%, rgba(6,9,12,.12) 68%, rgba(6,9,12,.5) 100%);
}
.hero-copy {
  position: relative; z-index: 2; padding: 0 24px; max-width: 620px; margin-left: 4vw;
}
.kicker {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.36em; text-transform: uppercase; color: var(--sand); margin-bottom: 18px;
}
.hero-copy h1 {
  font-size: clamp(38px, 5.6vw, 74px); font-weight: 800; letter-spacing: -0.01em;
  line-height: 0.98; text-shadow: 0 4px 40px rgba(0,0,0,.7);
}
.hero-copy h1 em { font-style: normal; font-weight: 300; color: var(--sand); }
.hero-copy p {
  margin-top: 20px; font-size: 14.5px; line-height: 1.65; color: #c3bfb2; max-width: 46ch;
}
.hero-actions { display: flex; gap: 10px; margin-top: 26px; }
.btn {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 11px 18px; border: 1px solid var(--line);
  color: var(--ink); background: rgba(14,18,23,.7); border-radius: 2px; transition: .15s;
}
.btn:hover { border-color: rgba(216,196,155,.55); background: rgba(26,31,38,.85); }
.btn.primary { background: var(--sand); color: #17140f; border-color: var(--sand); font-weight: 600; }
.btn.primary:hover { background: #efdcb4; }
.hero-meta {
  margin-top: 22px; font-family: ui-monospace, "SF Mono", monospace;
  font-size: 9px; letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase;
}
.hero-hint {
  position: absolute; bottom: 20px; right: 24px; z-index: 2;
  font-family: ui-monospace, "SF Mono", monospace; font-size: 8.5px;
  letter-spacing: 0.2em; color: rgba(234,230,218,.4); text-transform: uppercase;
}

/* ---------------------------------------------------------------- sections */
main section { padding: 84px 24px; max-width: 1240px; margin: 0 auto; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.sec-head h2 {
  font-size: 22px; font-weight: 600; letter-spacing: 0.02em;
}
.count {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.22em; color: var(--dim); text-transform: uppercase;
}

/* ---------------------------------------------------------------- search */
.searchbar { position: relative; margin-bottom: 16px; }
.searchbar input {
  width: 100%; padding: 16px 52px 16px 18px; font-size: 15px;
  background: rgba(14,18,23,.8); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: inherit; outline: none; transition: border-color .15s;
}
.searchbar input::placeholder { color: #6d6a62; }
.searchbar input:focus { border-color: rgba(216,196,155,.5); }
.searchbar kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filters.tags { margin-bottom: 26px; }
.chip {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 6px 11px; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--line); color: var(--dim); background: transparent; transition: .13s;
}
.chip:hover { color: var(--ink); border-color: rgba(216,196,155,.45); }
.chip.on { background: var(--sand); color: #17140f; border-color: var(--sand); font-weight: 600; }

/* ---------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 226px; padding: 16px; border: 1px solid var(--line); border-radius: 3px;
  background: #0b0f13; overflow: hidden; transition: border-color .18s, transform .18s;
}
.card:hover { border-color: rgba(216,196,155,.5); transform: translateY(-2px); }
.card .glow {
  position: absolute; inset: 0; opacity: .9;
  background:
    radial-gradient(120% 80% at 20% 0%, var(--c1) 0%, transparent 62%),
    radial-gradient(90% 70% at 80% 100%, var(--c2) 0%, transparent 66%),
    linear-gradient(180deg, #101820, #080b0f);
}
.card .grain {
  position: absolute; inset: 0; opacity: .18; mix-blend-mode: overlay;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.4) 0 1px, transparent 1px 4px);
}
.card .body { position: relative; z-index: 1; }
.card .era {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 8px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--sand); opacity: .85;
}
.card h3 { font-size: 19px; font-weight: 700; margin-top: 5px; letter-spacing: 0.01em; }
.card .sub { font-size: 12px; color: #b6b2a6; margin-top: 2px; }
.card .sum {
  font-size: 11.5px; line-height: 1.5; color: #8f8c83; margin-top: 9px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .foot {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-family: ui-monospace, "SF Mono", monospace; font-size: 8.5px;
  letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase;
}
.card .badge {
  padding: 3px 7px; border: 1px solid rgba(216,196,155,.4); border-radius: 2px; color: var(--sand);
}
.card .badge.live { border-color: rgba(121,207,152,.5); color: #9fe0b8; }

.empty { text-align: center; padding: 60px 20px; }
.empty p { font-size: 14px; margin-bottom: 8px; }

/* ---------------------------------------------------------------- how */
.steps {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px;
  counter-reset: s;
}
.steps li { border: 1px solid var(--line); border-radius: 3px; padding: 20px; background: rgba(13,17,22,.5); }
.steps .n {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.24em; color: var(--sand);
}
.steps h3 { font-size: 15px; font-weight: 600; margin: 10px 0 7px; }
.steps p { font-size: 12.5px; line-height: 1.6; color: #a8a49a; }
.limits {
  margin-top: 26px; padding: 20px; border-left: 2px solid var(--accent);
  background: rgba(184,69,47,.05);
}
.limits h3 {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.limits p { font-size: 12.5px; line-height: 1.65; color: #a8a49a; max-width: 78ch; }

/* ---------------------------------------------------------------- foot */
#foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 24px; border-top: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim);
  max-width: 1240px; margin: 0 auto;
}
#foot a { color: var(--sand); }

@media (max-width: 760px) {
  #chrome nav a:not(.cta) { display: none; }
  .hero-copy { margin-left: 0; }
  main section { padding: 56px 18px; }
}

/* ---------------------------------------------------------------- scene page */
body.scene { overflow: hidden; }
#stage { position: fixed; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; }
#stage:active { cursor: grabbing; }
#scene-ui { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; }
#scene-ui > * { pointer-events: auto; }
.scene-top {
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 16px 22px;
}
/* copy sits over the sky, so both bands need their own scrim */
.scene-top::before {
  content: ''; position: absolute; inset: -16px -22px auto -22px; height: 190px; z-index: -1;
  background: linear-gradient(180deg, rgba(6,9,12,.90), rgba(6,9,12,.55) 55%, transparent);
  pointer-events: none;
}
.scene-title .era {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 8.5px;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--sand);
}
.scene-title h1 { font-size: 27px; font-weight: 800; letter-spacing: 0.01em; margin-top: 4px; line-height: 1.05; text-shadow: 0 2px 20px rgba(0,0,0,.85); }
.scene-title .sub { font-size: 13px; color: #d2cec2; margin-top: 3px; text-shadow: 0 1px 12px rgba(0,0,0,.9); }
.scene-title .place {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin-top: 7px;
}
.scene-actions { display: flex; gap: 7px; }
.scene-bottom {
  position: relative;
  margin-top: auto; padding: 16px 22px 20px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.scene-bottom::before {
  content: ''; position: absolute; inset: -60px -22px -20px -22px; z-index: -1;
  background: linear-gradient(0deg, rgba(6,9,12,.92), rgba(6,9,12,.60) 55%, transparent);
  pointer-events: none;
}
.scene-summary { max-width: 54ch; font-size: 12.5px; line-height: 1.6; color: #cdc9bd; }
.scene-summary .tags {
  margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap;
  font-family: ui-monospace, "SF Mono", monospace; font-size: 8px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim);
}
.scene-summary .tags span { border: 1px solid var(--line); padding: 3px 7px; border-radius: 2px; }
.timeline { min-width: 280px; }
.timeline .beat {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--sand); margin-bottom: 7px;
}
.timeline .say { font-size: 12px; line-height: 1.55; color: #d8d4c8; min-height: 2.6em; }
.timeline .ticks { display: flex; gap: 4px; margin-top: 10px; }
.timeline .tick {
  flex: 1; height: 3px; background: rgba(255,255,255,.13); cursor: pointer;
  border-radius: 2px; transition: background .15s;
}
.timeline .tick.on { background: var(--sand); }
.timeline .tick:hover { background: rgba(216,196,155,.5); }

.loading {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); z-index: 40;
  font-family: ui-monospace, "SF Mono", monospace; font-size: 9px;
  letter-spacing: 0.4em; text-transform: uppercase; color: var(--dim);
  transition: opacity .5s;
}
.loading.hide { opacity: 0; pointer-events: none; }