/* A.P.O.C site previews. One deliberate dark world (the game's own UI): ash ground, bone type, ember for danger,
   amber for the live broadcast, paper for anything that is a document (survivor files, notes, the chronicle).
   Layout: a broadcast strip on top, then wide cinematic plates and narrow working columns. */
:root {
    color-scheme: dark;
    --ground: #0d0b0a;
    --ground-2: #15120f;
    --ground-3: #1d1915;
    --line: rgba(232, 225, 211, .12);
    --line-2: rgba(232, 225, 211, .22);
    --bone: #e8e1d3;
    --bone-dim: #a39c8f;
    --ash: #6b655b;
    --ember: #d8352a;
    --ember-deep: #6d110b;
    --amber: #e0a33a;
    --ok: #7fa36a;
    --paper: #e9e2cf;
    --paper-2: #ddd4bd;
    --paper-ink: #2a2622;
    --paper-dim: #6f675b;
    --stamp: #a3261c;

    --display: 'Big Shoulders Display', 'Oswald', 'Arial Narrow', sans-serif;
    --body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
    --label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --type: 'Special Elite', 'Courier New', monospace;
    --mono: 'Share Tech Mono', ui-monospace, Consolas, monospace;

    --gutter: clamp(16px, 4vw, 56px);
    --max: 1240px;
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--bone); font-family: var(--body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { /* film grain, the game's wear */
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .07; mix-blend-mode: overlay;
    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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: .95; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---- the broadcast strip ---- */
.strip { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: #000; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--bone-dim); }
.strip .wrap { display: flex; align-items: center; gap: 18px; min-height: 34px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.strip .wrap::-webkit-scrollbar { display: none; }
.strip b { color: var(--bone); font-weight: 400; }
.strip .live { color: var(--amber); display: inline-flex; align-items: center; gap: 8px; }
.strip .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); animation: pulse 1.6s infinite; }
.strip .sep { width: 1px; height: 12px; background: var(--line-2); flex: none; }
.strip .sample { margin-left: auto; color: var(--ash); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---- nav ---- */
.nav { border-bottom: 1px solid var(--line); background: rgba(13, 11, 10, .86); backdrop-filter: blur(8px); position: sticky; top: calc(env(safe-area-inset-top, 0px) + 34px); z-index: 39; }
.nav .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.nav .mark { height: 22px; width: auto; }
.nav .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---- buttons: the survivor screen's glow-border button ---- */
.btn { --c: var(--bone); display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; font-family: var(--label); font-weight: 700; font-size: 15px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: var(--c); background: rgba(0, 0, 0, .35); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); cursor: pointer; transition: box-shadow .2s, background .2s, border-color .2s; }
.btn:hover { border-color: var(--c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), 0 0 22px color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.btn.hot { --c: var(--ember); color: var(--bone); background: color-mix(in srgb, var(--ember) 22%, transparent); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---- labels and type scale ---- */
.eyebrow { font-family: var(--label); font-weight: 600; font-size: 13px; letter-spacing: .32em; text-transform: uppercase; color: var(--amber); }
.eyebrow.red { color: var(--ember); }
.h-xl { font-size: clamp(56px, 10vw, 148px); }
.h-l { font-size: clamp(40px, 6vw, 80px); }
.h-m { font-size: clamp(28px, 3.4vw, 44px); }
.h-s { font-size: 24px; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--bone-dim); max-width: 62ch; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--bone-dim); }
.section { padding-block: clamp(56px, 8vw, 110px); }
.section + .section { border-top: 1px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- plates (the game's key art) ---- */
.plate { position: relative; overflow: hidden; background: var(--ground-2); }
.plate > img { width: 100%; height: 100%; object-fit: cover; }
.plate::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 11, 10, 0) 40%, var(--ground) 100%); pointer-events: none; }
.vignette::after { background: radial-gradient(ellipse at center, rgba(13, 11, 10, 0) 35%, rgba(13, 11, 10, .9) 100%), linear-gradient(180deg, rgba(13, 11, 10, 0) 55%, var(--ground) 100%); }

/* ---- panels ---- */
.panel { background: var(--ground-2); border: 1px solid var(--line); padding: 22px; min-width: 0; }
.panel h3 { font-size: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 15px; }
.kv dt { font-family: var(--label); letter-spacing: .16em; text-transform: uppercase; font-size: 12.5px; color: var(--bone-dim); padding-top: 2px; }
.kv dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--bone-dim); white-space: nowrap; }
.chip.red { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 50%, transparent); }
.chip.amber { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 50%, transparent); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }

.bar { height: 6px; background: var(--ground-3); position: relative; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--bone); }
.bar.red > i { background: var(--ember); }
.bar.amber > i { background: var(--amber); }

/* ---- paper: anything that is a document ---- */
.paper { background: var(--paper); color: var(--paper-ink); position: relative; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); }
.paper::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55; mix-blend-mode: multiply;
    background: radial-gradient(ellipse at 15% 10%, rgba(120, 90, 50, .18), transparent 45%), radial-gradient(ellipse at 90% 95%, rgba(90, 60, 30, .22), transparent 50%); }
.paper .typed { font-family: var(--type); }
.stamp { display: inline-block; font-family: var(--label); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--stamp); border: 3px double var(--stamp); padding: 4px 12px; transform: rotate(-4deg); opacity: .85; mix-blend-mode: multiply; }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); padding-block: 40px; font-size: 14px; color: var(--bone-dim); }
.foot .wrap { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.foot .mark { height: 18px; opacity: .7; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 720px) {
        .nav .right .btn:not(.hot) { display: none; }
}


/* ---- grouped nav (dropdowns on desktop, a drawer on phones) ---- */
.nav .links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav .links > li { position: relative; }
.nav .top { display: block; padding: 8px 12px; font: 600 15px/1.2 var(--label); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--bone-dim); border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; }
.nav .top:hover { color: var(--bone); }
.nav .top[aria-current='page'], .nav .top[data-here] { color: var(--bone); border-bottom-color: var(--ember); }
.nav .grp > .top::after { content: ''; display: inline-block; margin-left: 7px; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.nav .menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 270px; background: #0a0908; border: 1px solid var(--line-2); padding: 6px; box-shadow: 0 24px 50px rgba(0,0,0,.7); z-index: 5; }
.nav .grp.open .menu { display: grid; }
.nav .menu a { display: grid; gap: 1px; padding: 10px 12px; text-decoration: none; border-left: 2px solid transparent; }
.nav .menu a:hover, .nav .menu a[aria-current='page'] { background: var(--ground-2); border-left-color: var(--ember); }
.nav .menu b { font: 700 15px/1.2 var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--bone); }
.nav .menu span { font-size: 13px; color: var(--bone-dim); }
.nav .burger { display: none; margin-left: auto; width: 42px; height: 38px; border: 1px solid var(--line-2); background: none; cursor: pointer; padding: 10px; flex-direction: column; justify-content: space-between; }
.nav .burger i { display: block; height: 2px; background: var(--bone); }
@media (max-width: 1000px) {
    .nav .burger { display: flex; }
    .nav .links { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
    .nav.open .links { display: flex; }
    .nav .menu { position: static; box-shadow: none; border: 0; border-left: 1px solid var(--line-2); margin: 0 0 6px 12px; min-width: 0; }
    .nav .right { margin-left: 0; }
    .nav .wrap { gap: 14px; }
}

/* ---- live data states (api.js) ---- */
.strip .live.off { color: var(--ash); }
.strip .live.off::before { background: var(--ash); box-shadow: none; animation: none; }
.gate { display: grid; gap: 10px; max-width: 64ch; }
.gate h3 { font-size: 26px; }
.gate p, .gate ol { font-size: 15.5px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ground-3); border: 1px solid var(--line-2); padding: 12px 18px; font-size: 15px; max-width: calc(100% - 32px); }
.wait { color: var(--bone-dim); font-family: var(--mono); font-size: 13px; letter-spacing: .06em; }
.nav .right #nav-signin span { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
