/* ============================================================================
   IM GONE — dev log
   The palette is lifted from the game's own constants so the page and the build
   can't drift apart: fog #bfd8e8 (CONFIG.render.fogColor), airdrop beacon
   #ffcf4a, low-health #d4452f, grass/infection #5fa83f.
   ========================================================================= */

:root {
  --void:    #08090b;
  --panel:   #10141a;
  --panel-2: #161c24;
  --fog:     #bfd8e8;
  --amber:   #ffcf4a;
  --blood:   #d4452f;
  --infect:  #5fa83f;
  --steel:   #8b97a4;
  --text:    #d7dee6;

  --edge:      rgba(191, 216, 232, 0.11);
  --edge-soft: rgba(191, 216, 232, 0.06);

  /* driven by JS as you scroll — the page runs the game's day cycle */
  --ambient: #0d1119;
  --ambient-warm: #0a0c11;

  --rail: 190px;
  --measure: 68ch;

  --f-mark: 'Black Ops One', system-ui, sans-serif;
  --f-head: 'Oswald', system-ui, sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, sans-serif;
  --f-data: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* the ambient layer is what shifts from dawn to night as you read */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--ambient) 0%, var(--void) 62%),
    linear-gradient(180deg, var(--ambient-warm) 0%, var(--void) 40%);
  transition: background 1.4s linear;
}
@media (prefers-reduced-motion: reduce) { body::before { transition: none; } }

/* film grain — one layer, no scanlines. Restraint. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

.skip {
  position: absolute; left: -9999px;
  background: var(--amber); color: #000; padding: 0.6rem 1rem;
  font-family: var(--f-head); text-transform: uppercase; z-index: 50;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ── status bar ───────────────────────────────────────────────────────── */
.statusbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.6rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}
.statusbar__mark {
  font-family: var(--f-mark);
  font-size: 0.9rem;
  letter-spacing: 0.09em;
  color: var(--text);
}
/* language switch — two real links, so each language keeps its own URL */
.lang {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--edge-soft);
  border: 1px solid var(--edge);
}
.lang a {
  padding: 0.22rem 0.6rem;
  background: var(--panel);
  font-family: var(--f-data);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--steel);
  text-decoration: none;
  transition: color 0.18s, background-color 0.18s;
}
.lang a:hover { color: var(--text); background: var(--panel-2); }
.lang a[aria-current='true'] { color: var(--amber); background: rgba(255, 207, 74, 0.08); }

.statusbar__clock {
  font-family: var(--f-data);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  letter-spacing: 0.06em;
}
.statusbar__meta {
  font-family: var(--f-head);
  font-weight: 400;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--steel);
}

/* ── vitals: a replica of the game's own bars ─────────────────────────── */
.vitals { display: grid; gap: 5px; }
.vital {
  display: block;
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
}
.vital > i {
  display: block;
  height: 100%;
  width: var(--fill, 50%);
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 1.2s linear;
}
@media (prefers-reduced-motion: reduce) { .vital > i { transition: none; } }

.vital--hp    > i { background: var(--blood); }
.vital--food  > i { background: #e0a020; }
.vital--water > i { background: #4a90d9; }
.vital--stam  > i { background: #d9c832; }
.vital--noise > i { background: var(--infect); }

/* On wide screens the vitals sit opposite the stats so the two HUD elements
   frame the hero instead of stacking on top of each other. */
.vitals--hero {
  position: absolute;
  left: clamp(1rem, 4vw, 3.5rem);
  bottom: clamp(1.4rem, 4vw, 2.6rem);
  width: min(210px, 34vw);
  z-index: 3;
}
@media (min-width: 900px) {
  .vitals--hero {
    left: auto;
    right: clamp(1.5rem, 4vw, 3.5rem);
    bottom: clamp(2rem, 5vw, 3.4rem);
    width: 190px;
  }
}

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: clamp(600px, 92vh, 900px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--edge);
}
.hero__plate {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
  filter: saturate(0.86) contrast(1.05) brightness(0.82);
}
.hero__grade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 30% 55%, transparent 0%, rgba(8, 9, 11, 0.55) 70%, rgba(8, 9, 11, 0.92) 100%),
    linear-gradient(180deg, rgba(8, 9, 11, 0.72) 0%, transparent 32%, rgba(8, 9, 11, 0.88) 100%);
}
.hero__body {
  position: relative;
  z-index: 2;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 4rem) clamp(5rem, 10vw, 6.5rem);
  max-width: 62rem;
}
.hero__eyebrow {
  margin: 0 0 1.1rem;
  font-family: var(--f-data);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
}
.hero__eyebrow::before { content: '▸ '; opacity: 0.7; }

/* The wordmark carries the game's own broken-signal treatment — the start
   screen does the same RGB split. One flourish, used once. */
.hero__title {
  position: relative;
  margin: 0 0 1.5rem;
  font-family: var(--f-mark);
  font-weight: 400;
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: 0.02em;
  color: #f2f6fa;
  text-shadow: 0 0 60px rgba(8, 9, 11, 0.9);
}
.hero__title::before,
.hero__title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__title::before { color: var(--blood); transform: translate(-3px, 1px); opacity: 0.42; mix-blend-mode: screen; }
.hero__title::after  { color: var(--fog);   transform: translate(3px, -1px); opacity: 0.30; mix-blend-mode: screen; }
@media (prefers-reduced-motion: no-preference) {
  .hero__title::before { animation: drift 7s steps(2, end) infinite; }
  .hero__title::after  { animation: drift 5.5s steps(2, end) infinite reverse; }
}
@keyframes drift {
  0%, 92%, 100% { transform: translate(-3px, 1px); }
  94%           { transform: translate(-7px, -2px); }
  96%           { transform: translate(1px, 2px); }
}

.hero__lede {
  margin: 0 0 2.4rem;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.62;
  color: #c3ccd6;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.4rem, 4vw, 3.2rem);
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
  max-width: 52rem;
}
.hero__stats dt {
  font-family: var(--f-head);
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--steel);
  margin-bottom: 0.25rem;
}
.hero__stats dd {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1;
  color: var(--fog);
}
.hero__stats dd span {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--f-data);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--blood);
}

/* ── shell: telemetry rail + reading column ───────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--measure));
  gap: clamp(2rem, 6vw, 5rem);
  justify-content: center;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem) 5rem;
}

.rail { position: relative; }
.rail__sticky { position: sticky; top: 5.5rem; }

.rail__label {
  margin: 0 0 0.7rem;
  font-family: var(--f-head);
  font-size: 0.64rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--steel);
}
.rail__label--gap { margin-top: 2.4rem; }

.toc { display: grid; gap: 0.1rem; }
.toc a {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.42rem 0.55rem 0.42rem 0.6rem;
  border-left: 2px solid transparent;
  font-family: var(--f-head);
  font-weight: 300;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: var(--steel);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.toc a span {
  font-family: var(--f-data);
  font-size: 0.66rem;
  color: rgba(139, 151, 164, 0.6);
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--text); background: rgba(191, 216, 232, 0.04); }
.toc a[aria-current='true'] {
  color: var(--amber);
  border-left-color: var(--amber);
  background: rgba(255, 207, 74, 0.05);
}
.toc a[aria-current='true'] span { color: var(--amber); opacity: 0.75; }
.toc--plain a { padding-left: 0.6rem; }

/* ── content blocks ───────────────────────────────────────────────────── */
main { min-width: 0; }

.block { margin-bottom: clamp(4.5rem, 9vw, 7rem); scroll-margin-top: 5rem; }
.block:last-child { margin-bottom: 0; }

.block p { margin: 0 0 1.35rem; }
.block p:last-child { margin-bottom: 0; }
.block b { font-weight: 500; color: var(--fog); }

.block__head { margin-bottom: 1.8rem; }
.block__head h2 {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: #eaf0f6;
}

.stamp {
  margin: 0 0 0.55rem;
  font-family: var(--f-data);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  color: var(--amber);
  text-transform: uppercase;
}
.stamp--file { color: var(--steel); }
.stamp--file::before { content: '▪ '; }

.lead {
  font-size: clamp(1.1rem, 1.04rem + 0.4vw, 1.28rem);
  line-height: 1.6;
  color: #c8d2dc;
}

.note {
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--edge);
  background: rgba(191, 216, 232, 0.03);
  font-size: 0.92rem;
  color: var(--steel);
}

.pull {
  margin: 2.2rem 0;
  padding: 1.4rem 0 1.4rem 1.6rem;
  border-left: 2px solid var(--blood);
  font-family: var(--f-head);
  font-weight: 300;
  font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.45;
  color: #e2e9f0;
}
.pull--amber { border-left-color: var(--amber); }

/* figures */
.block figure { margin: 2.2rem 0; }
.block figure img {
  width: 100%;
  border: 1px solid var(--edge);
  background: var(--panel);
}
.block figcaption {
  margin-top: 0.7rem;
  font-family: var(--f-data);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--steel);
}

/* full-bleed figures escape the reading measure */
.block > figure {
  width: min(100vw - 2.5rem, calc(var(--measure) + 12vw));
  margin-left: 50%;
  transform: translateX(-50%);
}

/* data table — reads like a terminal readout */
.table-wrap { overflow-x: auto; margin: 2rem 0; }
.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--f-data);
  font-size: 0.84rem;
}
.data caption {
  caption-side: bottom;
  padding-top: 0.8rem;
  text-align: left;
  font-size: 0.72rem;
  color: var(--steel);
}
.data code { color: var(--fog); }
.data th, .data td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  text-align: left;
  border-bottom: 1px solid var(--edge-soft);
}
.data thead th {
  font-family: var(--f-head);
  font-weight: 400;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--steel);
  border-bottom-color: var(--edge);
}
.data tbody th { font-weight: 500; color: var(--fog); }
.data tbody tr:first-child td { color: var(--amber); }

/* night multipliers */
.shifts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin: 2.2rem 0;
  padding: 0;
  list-style: none;
  background: var(--edge-soft);
  border: 1px solid var(--edge);
}
.shifts li {
  padding: 1.3rem 1.1rem;
  background: var(--panel);
}
.shifts b {
  display: block;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1;
  color: var(--blood);
}
.shifts span {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--f-data);
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--steel);
}

/* weapon rack + bestiary + gallery share a card grid */
.rack, .bestiary, .gallery {
  display: grid;
  gap: 1px;
  margin: 2.2rem 0;
  background: var(--edge-soft);
  border: 1px solid var(--edge);
}
.rack     { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.bestiary { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.gallery  { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.rack figure, .bestiary figure, .gallery figure {
  margin: 0;
  background: var(--panel);
}
.rack figure img, .bestiary figure img, .gallery figure img {
  border: 0;
  width: 100%;
}
.rack figcaption, .bestiary figcaption, .gallery figcaption {
  margin: 0;
  padding: 0.6rem 0.85rem 0.8rem;
  font-family: var(--f-head);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog);
}
.bestiary figcaption span {
  display: block;
  font-family: var(--f-data);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--steel);
}

/* the infection section takes on the game's sickly green */
.block--sick .stamp { color: var(--infect); }
.block--sick .lead  { color: #b9d3a8; }
.block--sick b      { color: var(--infect); }

/* stack list */
.stack {
  margin: 2rem 0 0;
  display: grid;
  gap: 1px;
  background: var(--edge-soft);
  border: 1px solid var(--edge);
}
.stack > div {
  display: grid;
  grid-template-columns: minmax(110px, 30%) 1fr;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--panel);
}
.stack dt {
  font-family: var(--f-head);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--steel);
  align-self: center;
}
.stack dd {
  margin: 0;
  font-family: var(--f-data);
  font-size: 0.82rem;
  color: var(--fog);
}

/* ── footer ───────────────────────────────────────────────────────────── */
.foot {
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 5vw, 4rem);
  border-top: 1px solid var(--edge);
  text-align: center;
  color: var(--steel);
  font-size: 0.9rem;
}
.foot p { margin: 0 0 0.6rem; }
.foot__mark {
  font-family: var(--f-mark);
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: rgba(215, 222, 230, 0.32);
  margin-bottom: 1rem;
}
.foot__meta {
  font-family: var(--f-data);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(139, 151, 164, 0.55);
}

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); max-width: 44rem; margin-inline: auto; }
  .rail { display: none; }
  .block > figure { width: 100%; margin-left: 0; transform: none; }
}

@media (max-width: 560px) {
  .hero { min-height: 78vh; }
  .vitals--hero { width: 42vw; }
  .statusbar__meta { display: none; }
}
