/* Resistance Night · site system.
   Every value here comes from Design System.html. If it isn't there, it doesn't belong here. */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@500;600;700;800&family=Instrument+Serif:ital@0;1&family=Lora:wght@600;700&display=swap');

:root {
  --night: #0b0e26; --navy: #141a3e; --navy2: #1c2454; --paper: #1f2858; --panel: #243066;
  --hill: #2a2450; --pine: #0a0c20;
  --ink: #f4e8c8; --inkdim: #d8cdab; --muted: #8a92b8;
  --gold: #c89858; --goldbright: #e0a94e; --goldlite: #f2d08a; --golddeep: #8a6a36;
  --ruby: #d92b46; --ruby2: #b01535; --rubydeep: #7a0f22;
  --emerald: #3fb083; --azure: #5fa8d8;
  --line: rgba(224, 169, 78, .18); --line2: rgba(224, 169, 78, .4);
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --ui: 'Lora', Georgia, serif;

  /* three easings, no more */
  --enter: cubic-bezier(.215, .61, .355, 1);      /* easeOutCubic · .55s */
  --draw: cubic-bezier(.445, .05, .55, .95);      /* easeInOutSine · .9s */
  --pop: cubic-bezier(.175, .885, .32, 1.275);    /* easeOutBack · .5s */

  --wrap: 1120px;
  --gut: clamp(20px, 4vw, 44px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--night); color: var(--ink);
  font-family: var(--sans); font-weight: 500; font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; min-height: 100vh;
}
a { color: inherit; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--goldlite); outline-offset: 3px; }
::selection { background: var(--goldbright); color: var(--navy); }

/* ---------- type ---------- */
.kicker { font: 800 13px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--goldbright); }
.label { font: 700 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.display { font: 400 clamp(38px, 6vw, 86px)/.96 var(--serif); letter-spacing: .005em; color: var(--ink); text-wrap: balance; }
.display-2 { font: 400 clamp(32px, 4.4vw, 60px)/.98 var(--serif); color: var(--ink); text-wrap: balance; }
.lead { font: 500 clamp(18px, 1.6vw, 21px)/1.4 var(--sans); color: var(--inkdim); text-wrap: pretty; max-width: 34ch; }
.quote { font: italic 400 clamp(30px, 4.6vw, 64px)/1 var(--serif); color: var(--goldlite); text-wrap: balance; }

/* ---------- logo lockup: every value is a ratio of S ---------- */
.lockup { --S: 18px; display: inline-flex; align-items: center; gap: calc(var(--S) * .34); text-decoration: none;
  font: 800 var(--S)/1 var(--sans); letter-spacing: calc(var(--S) * .025); text-transform: uppercase; white-space: nowrap; color: var(--inkdim); }
.lockup svg { width: calc(var(--S) * 1.14); height: calc(var(--S) * 1.09); color: var(--gold); overflow: visible; flex: none; display: block; }

/* ---------- buttons: from the app. radius 0, cream fill, hard offset. tap is the only state. ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border: 0; border-radius: 0; cursor: pointer; text-decoration: none;
  font: 700 16px/1.2 var(--ui); letter-spacing: .05em; text-transform: lowercase;
  background: var(--ink); color: var(--navy); box-shadow: 3px 3px 0 var(--gold);
  transition: transform .12s var(--enter);
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .3; cursor: default; }
.btn.small { padding: 10px 16px; font-size: 13px; box-shadow: 2px 2px 0 var(--gold); }
.btn.full { width: 100%; }
.btn .arrow { font-size: 20px; line-height: .8; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border: 1.5px solid var(--line2); border-radius: 0; cursor: pointer; text-decoration: none;
  font: 700 16px/1.2 var(--ui); letter-spacing: .05em; text-transform: lowercase;
  background: transparent; color: var(--ink); transition: transform .12s var(--enter);
}
.btn-ghost:active { transform: scale(.97); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--line2); border-radius: 0; background: transparent; color: var(--inkdim);
  font: 700 10px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; transition: transform .12s var(--enter);
}
.chip:active { transform: scale(.97); }

/* ---------- panels: 2px, hairline, hard offset. never blurred. ---------- */
.panel { background: var(--paper); border: 1.5px solid var(--line); border-radius: 2px; box-shadow: 5px 6px 0 rgba(6, 9, 26, .6); }

/* ---------- texture: grain 17% overlay + vignette on illustrated frames ---------- */
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 9; mix-blend-mode: overlay; opacity: .17;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}
.vignette::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 8;
  background: radial-gradient(115% 78% at 50% 46%, rgba(11, 14, 38, 0) 0%, rgba(11, 14, 38, .4) 62%, rgba(11, 14, 38, .72) 100%);
}

/* ---------- nav ---------- */
.site-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 30; padding: 22px var(--gut); }
.site-nav.solid { position: relative; background: var(--night); border-bottom: 1.5px solid var(--line); }
.site-nav-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.nav-link { font: 700 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--inkdim); text-decoration: none; padding: 8px 0; border-bottom: 1.5px solid transparent; }
.nav-link.active { color: var(--goldbright); border-bottom-color: var(--goldbright); }
@media (max-width: 760px) {
  .site-nav-inner { flex-wrap: wrap; row-gap: 12px; }
  .nav-links { width: 100%; overflow-x: auto; scrollbar-width: none; gap: 18px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links .btn { display: none; }
  .nav-link { white-space: nowrap; }
}

/* ---------- footer ---------- */
.site-foot { background: var(--night); border-top: 1.5px solid var(--line); padding: 44px var(--gut) 60px; }
.site-foot-inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 22px 44px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 26px; }
.foot-links a { font: 700 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.foot-meta { width: 100%; font: 700 11px/1.5 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- star rule ---------- */
.divider { display: flex; align-items: center; gap: 16px; color: var(--goldbright); margin: 44px 0; }
.divider-line { flex: 1; height: 1.5px; background: currentColor; opacity: .3; }
.divider .sigil { width: 14px; height: 14px; fill: currentColor; flex: none; }

/* ==========================================================
   Inner pages (codex, story, terms, privacy)
   ========================================================== */
.container { max-width: 760px; margin: 0 auto; padding: 60px var(--gut) 90px; }
.header-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.eyebrow { font: 800 13px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--goldbright); margin-bottom: 8px; }
.hero-title, .title { font: 400 clamp(44px, 8vw, 86px)/.96 var(--serif); color: var(--ink); text-wrap: balance; margin: 0; }
.hero-title + .hero-title { margin-top: -12px; }
.title-italic { font: italic 400 clamp(44px, 8vw, 86px)/.96 var(--serif); color: var(--goldlite); margin-top: -12px; }
.hero-sub { font: 500 clamp(18px, 2vw, 21px)/1.4 var(--sans); color: var(--inkdim); max-width: 40ch; margin-top: 8px; }
.section-label { font: 700 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.codex-sections { display: flex; flex-direction: column; gap: 16px; }
.section-card { display: flex; gap: 22px; align-items: flex-start; padding: 22px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 2px; box-shadow: 5px 6px 0 rgba(6, 9, 26, .6); }
a > .section-card { color: var(--ink); }
.roman-numeral { font: 400 34px/1 var(--serif); color: var(--goldlite); min-width: 34px; flex: none; }
.card-content { min-width: 0; }
.card-title { font: 400 26px/1.05 var(--serif); color: var(--ink); margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.card-body { font: 500 16px/1.55 var(--sans); color: var(--inkdim); max-width: 62ch; }
.card-body strong, .prose strong { color: var(--ink); font-weight: 700; }
.card-badge { font: 700 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1.5px solid var(--goldbright); color: var(--goldbright); }
.card-badge.evil { border-color: var(--ruby); color: var(--ruby); }
.link-highlight { color: var(--goldlite); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 4px; }
.prose-section { margin-bottom: 44px; }
.prose-heading { font: 400 34px/1 var(--serif); color: var(--ink); margin-bottom: 16px; }
.prose { display: flex; flex-direction: column; gap: 16px; font: 500 17px/1.6 var(--sans); color: var(--inkdim); max-width: 62ch; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat-tile { padding: 22px 16px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 2px; box-shadow: 5px 6px 0 rgba(6, 9, 26, .6); }
.stat-number { font: 400 60px/1 var(--serif); color: var(--goldlite); font-variant-numeric: tabular-nums; }
.stat-label { font: 700 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.btn-container, .btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 44px; }
.ghost-btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 22px; border: 1.5px solid var(--line2); border-radius: 0; text-decoration: none; font: 700 16px/1.2 var(--ui); letter-spacing: .05em; text-transform: lowercase; color: var(--ink); }
.ghost-btn:active { transform: scale(.97); }

/* ==========================================================
   Shared interactive pieces (shared.js)
   ========================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popin { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.js .reveal:not(.in) { opacity: 0; }
.reveal.in { animation: rise .55s var(--enter) both; animation-delay: var(--d, 0s); }

.hood { --rim: var(--goldbright); --cloak: #101638; display: block; width: 100%; height: auto; overflow: visible; }
.hood.traitor { --rim: var(--ruby); --cloak: #12122e; }
.h-cloak { fill: var(--cloak); transition: fill .55s var(--enter); }
.h-rim { fill: var(--rim); opacity: .34; transition: fill .55s var(--enter), opacity .55s var(--enter); }
.lit .h-rim { opacity: .84; }
.h-acc, .h-clasp { fill: var(--rim); transition: fill .55s var(--enter); }
.h-clasp { opacity: .55; }
.h-eye { fill: var(--ruby); }
.h-glow { fill: var(--ruby); opacity: .28; }
.f-sigil, .f-eyes { opacity: 0; transition: opacity .55s var(--enter); }
.show-sigil .f-sigil, .show-eyes .f-eyes { opacity: 1; }
.show-eyes.hot .h-glow { animation: ember 1.8s var(--draw) infinite alternate; }
@keyframes ember { from { opacity: .18; } to { opacity: .5; } }
.flash { position: absolute; inset: 0; z-index: 7; background: var(--ruby); mix-blend-mode: screen; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .5s var(--draw); }
@keyframes flash { 0% { opacity: 0; } 30% { opacity: .55; } 100% { opacity: 0; } }

.seg { display: inline-flex; border: 1.5px solid var(--line2); }
.seg button { background: transparent; border: 0; border-right: 1.5px solid var(--line2); padding: 11px 18px; cursor: pointer; font: 700 14px/1 var(--ui); letter-spacing: .05em; text-transform: lowercase; color: var(--inkdim); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--navy); }
.seg button:active { transform: scale(.97); }

.play { --c: var(--goldbright); display: flex; flex-direction: column; overflow: hidden; }
.play-art { position: relative; aspect-ratio: 360 / 240; background: #0e1232; border-bottom: 1.5px solid var(--line); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.play-art svg { display: block; width: 100%; height: 100%; }
.play-copy { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.play .side { font: 700 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.play h3 { font: 400 30px/1.05 var(--serif); color: var(--ink); }
.play-msg { font: 500 15px/1.45 var(--sans); color: var(--inkdim); min-height: 44px; }
.play-msg.swap { animation: rise .55s var(--enter) both; }
.claim { cursor: pointer; }
.claim-t { font: 700 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; fill: var(--inkdim); animation: rise .55s var(--enter) both; }
.claim:focus-visible { outline: none; } .claim:focus-visible .h-rim { opacity: .84; }

.mini { width: 64px; flex: none; display: block; }
.mini svg { display: block; width: 100%; height: auto; overflow: visible; }
.role-row { cursor: pointer; align-items: center; }
.role-row:active { transform: scale(.99); }

/* the reveal: card turns, portrait shows, then the secret */
.reveal-ov { position: fixed; inset: 0; z-index: 100; background: rgba(11, 14, 38, .95); display: grid; place-items: center; padding: 20px; overflow: auto; animation: fadein .55s var(--enter); }
.reveal-ov .flash { position: fixed; }
.reveal-box { position: relative; z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; max-width: 520px; }
.rv-card { width: min(270px, 56vw, 34vh); aspect-ratio: 200 / 250; perspective: 1100px; }
.rv-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--draw); }
.open .rv-in { transform: rotateY(180deg); }
.rv-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.rv-back { background: var(--navy); border: 1.5px solid var(--line2); border-radius: 2px; box-shadow: 5px 6px 0 rgba(6, 9, 26, .6); color: rgba(224, 169, 78, .5); margin: 10% 12%; }
.rv-back svg { width: 40%; }
.rv-front { transform: rotateY(180deg); }
.rv-front svg { width: 100%; height: 100%; display: block; overflow: visible; }
.open .rv-front .sitter { animation: sit 4.2s var(--draw) infinite alternate; }
@keyframes sit { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.open .rv-front .riso { animation: riso 3s var(--draw) infinite alternate; }
@keyframes riso { from { transform: translate(4px, 5px); } to { transform: translate(8px, 9px); } }
.rv-copy { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rv-copy > * { opacity: 0; }
.told .rv-copy > * { animation: rise .55s var(--enter) both; }
.told .rv-copy > :nth-child(2) { animation-delay: .12s; } .told .rv-copy > :nth-child(3) { animation-delay: .24s; } .told .rv-copy > :nth-child(4) { animation-delay: .36s; }
.bad .rv-side { color: var(--ruby); }
.rv-knows { font: 500 18px/1.4 var(--sans); color: var(--inkdim); max-width: 34ch; text-wrap: pretty; }
.rv-tip { font: italic 400 26px/1.1 var(--serif); color: var(--goldlite); max-width: 22ch; text-wrap: balance; }
.rv-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }

/* the table, by the numbers */
.team-tool { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.tt-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.tt-seats { display: flex; justify-content: center; align-items: flex-end; gap: 2px; min-height: 92px; }
.tt-seats span { width: clamp(28px, 8.4vw, 62px); animation: rise .55s var(--enter) both; animation-delay: var(--d); }
.tt-line { font: 400 26px/1.15 var(--serif); color: var(--ink); text-align: center; text-wrap: balance; }
.tt-line.swap { animation: rise .55s var(--enter) both; }
.tt-quests { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tt-q { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; animation: popin .5s var(--pop) both; animation-delay: var(--d); }
.tt-q b { width: clamp(44px, 11vw, 64px); aspect-ratio: 1; border-radius: 999px; border: 1.5px solid var(--line2); background: #111737; display: grid; place-items: center; font: 400 clamp(24px, 6vw, 34px)/1 var(--serif); color: var(--goldlite); }
.tt-q.two b { border-color: var(--ruby); color: var(--ruby); }
.tt-q span { font: 700 10px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tt-q em { font: 700 10px/1.2 var(--sans); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--ruby); }
@media (max-width: 520px) { .seg button { padding: 11px 13px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
