/* ==========================================================================
   LEHLANYAVERSE // HUD DESIGN SYSTEM
   Tactical mission-debrief x maximalism. Mobile-first.
   Sections: 1 fonts · 2 tokens · 3 base · 4 fx layers · 5 boot · 6 chrome
             7 primitives · 8 sections · 9 motion · 10 reduced motion
   ========================================================================== */

/* 1. FONTS: self-hosted Google Fonts (OFL, licences in /fonts) ---------- */
@font-face {
  font-family: "Big Shoulders Display";
  src: url("/fonts/big-shoulders-display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Big Shoulders Stencil";
  src: url("/fonts/big-shoulders-stencil.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* 2. TOKENS ------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* base */
  --void: #050604;
  --void-2: #090b08;
  --gunmetal: #101316;
  --gunmetal-2: #171b1f;
  --olive: #232a18;
  --olive-2: #35402a;
  --olive-3: #7d8c55;

  /* ink */
  --bone: #e4dfcc;
  --dim: #a19e8b;
  --line: rgba(228, 223, 204, 0.14);
  --line-strong: rgba(228, 223, 204, 0.32);

  /* accents: clashing on purpose */
  --orange: #ff6a13;
  --acid: #b8ff2c;
  --red: #e0312b;
  --tape: #e8c547;

  /* type */
  --f-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --f-stencil: "Big Shoulders Stencil", var(--f-display);
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-h3: clamp(1.6rem, 4vw, 2.25rem);
  --fs-h2: clamp(2.75rem, 8vw, 5.75rem);
  --fs-num: clamp(4.5rem, 15vw, 11rem);
  --fs-hero: clamp(3.75rem, 16vw, 11.5rem);

  /* space & layout */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --maxw: 88rem;
  --header-h: 3.75rem;

  /* motion */
  --t-fast: 0.15s;
  --t-med: 0.35s;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 3. BASE --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Safety net: decorative overhangs (stickers, tilts) must never cause sideways scroll */
  overflow-x: clip;
  background: var(--void);
  color: var(--bone);
  font-family: var(--f-mono);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: var(--fs-base);
  line-height: 1.65;
  overflow-x: clip;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(86, 99, 58, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 40%, rgba(255, 106, 19, 0.05), transparent 70%),
    var(--void);
}

#_kobweb-root {
  position: relative;
  isolation: isolate;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

ul[role="list"], ol[role="list"] {
  list-style: none;
  padding: 0;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--acid);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--bone);
}

::selection {
  background: var(--acid);
  color: var(--void);
}

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

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Visually hidden until focused, so it can never leak into view */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 300;
  padding: 0.75rem 1rem;
  background: var(--acid);
  color: var(--void);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 4. FX LAYERS: decorative, fixed, never interactive ------------------- */
.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.fx--grid {
  z-index: -2;
  background-image:
    linear-gradient(rgba(125, 140, 85, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 140, 85, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 10%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 10%, transparent 80%);
}

.fx--topo {
  z-index: -1;
  background: url("/img/topo.svg") center / cover no-repeat;
  opacity: 0.1;
}

.fx--vignette {
  z-index: 80;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.72) 100%);
}

.fx--scan {
  z-index: 81;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.28) 2px 3px, transparent 3px 4px);
  opacity: 0.45;
}

.fx--grain {
  z-index: 82;
  inset: -100px;
  background: url("/img/grain.svg");
  opacity: 0.06;
}

/* 5. BOOT SEQUENCE: pure CSS, gated by js/boot.js ------------------------ */
html[data-boot] {
  overflow: hidden;
}

html[data-boot] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 400;
  background:
    url("/img/reticle.svg") center / min(70vmin, 26rem) no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.4) 2px 3px),
    var(--void);
  animation: boot-out 0.3s ease-in 1.4s forwards;
}

html[data-boot] body::after {
  content: "\25B6  INCOMING TRANSMISSION\A\25B6  DECRYPTING DOSSIER // LEHLANYAVERSE\A\25B6  OPERATOR CONFIRMED\A\A[ PRESS ANY KEY OR TAP TO SKIP ]";
  white-space: pre;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 401;
  translate: -50% -50%;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 1rem 1.25rem;
  background: rgba(5, 6, 4, 0.88);
  border: 1px solid var(--acid);
  color: var(--acid);
  font: 700 clamp(0.7rem, 2.6vw, 0.95rem) / 1.9 var(--f-mono);
  letter-spacing: 0.08em;
  animation:
    boot-type 1s steps(5, end) both,
    boot-out 0.3s ease-in 1.4s forwards;
}

@keyframes boot-type {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes boot-out {
  to { opacity: 0; visibility: hidden; }
}

/* 6. CHROME: header, ticker, footer ------------------------------------- */
.hud-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5, 6, 4, 0.92);
  border-bottom: 1px solid var(--line-strong);
}

@supports (backdrop-filter: blur(6px)) {
  .hud-header {
    background: rgba(5, 6, 4, 0.8);
    backdrop-filter: blur(6px);
  }
}

.hud-header__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  min-height: var(--header-h);
}

.brand {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--bone);
  text-decoration: none;
  white-space: nowrap;
}

.brand__slash {
  color: var(--orange);
}

.brand:hover {
  color: var(--acid);
}

.clock {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  color: var(--dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.clock__label {
  display: none;
}

@media (min-width: 96rem) {
  .clock__label { display: inline; }
}

.clock__time {
  color: var(--acid);
  font-weight: 700;
}

.rec-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(224, 49, 43, 0.25);
}

@media (min-width: 30rem) {
  .clock { display: inline-flex; }
}

.nav {
  margin-left: auto;
}

.nav__list {
  display: none;
  gap: 0.25rem;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.6rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--bone);
  border: 1px solid transparent;
}

.nav__link span {
  color: var(--orange);
}

.nav__link:hover {
  color: var(--acid);
  border-color: var(--line-strong);
}

/* Mobile: native <details> disclosure works before JS loads */
.nav-menu {
  position: relative;
}

.nav-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.85rem;
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--void);
  background: var(--acid);
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-menu > summary::after {
  content: "+";
  font-size: 1rem;
}

.nav-menu[open] > summary::after {
  content: "\2212";
}

.nav-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.5rem;
  background: var(--void-2);
  border: 1px solid var(--acid);
  box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.6);
}

.nav-menu__panel .nav__link {
  display: flex;
  font-size: var(--fs-sm);
}

@media (min-width: 80rem) {
  .nav__list { display: flex; }
  .nav-menu { display: none; }
}

/* Ticker */
.ticker {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--orange);
  color: var(--void);
  border-bottom: 2px solid var(--void);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ticker__label {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: var(--void);
  color: var(--orange);
}

.ticker__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker__track {
  display: flex;
  width: max-content;
}

.ticker__group {
  display: flex;
  flex: none;
}

.ticker__item {
  padding: 0.55rem 0;
  white-space: nowrap;
}

.ticker__item::after {
  content: "///";
  margin-inline: 1.25rem;
  opacity: 0.55;
}

.ticker__btn {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 0;
  border-left: 2px solid var(--void);
  background: var(--orange);
  color: var(--void);
  font: inherit;
  cursor: pointer;
}

.ticker__btn:hover {
  background: var(--void);
  color: var(--orange);
}

.ticker__btn:focus-visible {
  outline-color: var(--void);
  outline-offset: -5px;
}

/* Footer */
.site-footer {
  margin-top: clamp(4rem, 10vw, 8rem);
  border-top: 2px solid var(--bone);
  background: var(--void-2);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 2rem 2.5rem;
}

.site-footer__end {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 9vw, 6rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
  color: var(--bone);
  width: 100%;
}

.site-footer__end span {
  color: var(--orange);
}

/* 7. PRIMITIVES --------------------------------------------------------- */

/* Readout: small uppercase mono meta text */
.readout {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.readout b, .readout strong {
  color: var(--bone);
}

.hl-orange { color: var(--orange); }
.hl-acid { color: var(--acid); }

/* Panel: framed by corner brackets */
.panel {
  --c: var(--orange);
  position: relative;
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  background:
    linear-gradient(160deg, rgba(23, 27, 31, 0.96), rgba(12, 14, 16, 0.97) 65%),
    var(--gunmetal);
  border: 1px solid var(--line);
  box-shadow: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, 0.8);
}

.panel::before {
  content: "";
  position: absolute;
  inset: -7px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / 26px 3px,
    linear-gradient(var(--c), var(--c)) top left / 3px 26px,
    linear-gradient(var(--c), var(--c)) top right / 26px 3px,
    linear-gradient(var(--c), var(--c)) top right / 3px 26px,
    linear-gradient(var(--c), var(--c)) bottom left / 26px 3px,
    linear-gradient(var(--c), var(--c)) bottom left / 3px 26px,
    linear-gradient(var(--c), var(--c)) bottom right / 26px 3px,
    linear-gradient(var(--c), var(--c)) bottom right / 3px 26px;
  background-repeat: no-repeat;
}

.panel--acid { --c: var(--acid); }
.panel--bone { --c: var(--bone); }
.panel--tape { --c: var(--tape); }

.panel--olive {
  background:
    linear-gradient(160deg, rgba(53, 64, 42, 0.75), rgba(25, 30, 17, 0.92)),
    var(--olive);
}

.panel--paper {
  --c: var(--void);
  background: linear-gradient(170deg, #b9b196, #9f9880);
  color: var(--void);
  border-color: transparent;
}

.panel--paper .readout { color: #2b2a20; }
.panel--paper .readout b { color: var(--void); }

.panel__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--line-strong);
}

.panel--paper .panel__bar {
  border-bottom-color: rgba(10, 12, 9, 0.35);
}

.panel__bar b {
  color: var(--c);
}

.panel--paper .panel__bar b {
  color: var(--red);
}

/* Collage tilts only where there is room for them */
@media (min-width: 64rem) {
  .tilt-l { rotate: -1.25deg; }
  .tilt-r { rotate: 1deg; }
  .tilt-rr { rotate: 2.25deg; }
}

/* Section heading: giant outlined number + condensed title */
.sec-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 0 clamp(0.75rem, 2vw, 1.5rem);
  margin-top: clamp(4.5rem, 12vw, 9rem);
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--bone);
}

.sec-head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 30%;
  height: 3px;
  background: var(--orange);
}

.sec-head__num {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: var(--fs-num);
  line-height: 0.78;
  color: transparent;
  -webkit-text-stroke: 2px var(--orange);
  letter-spacing: -0.02em;
}

.sec-head__kicker {
  display: block;
  margin-bottom: 0.35rem;
}

.sec-head__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: var(--fs-h2);
  line-height: 0.88;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

/* Stamp: worn ink */
.stamp {
  display: inline-block;
  padding: 0.12em 0.45em 0.08em;
  border: 0.14em solid currentColor;
  font-family: var(--f-stencil);
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  rotate: -8deg;
  -webkit-mask-image: url("/img/grunge.svg");
  mask-image: url("/img/grunge.svg");
  -webkit-mask-size: 220px;
  mask-size: 220px;
  user-select: none;
}

.stamp--acid { color: var(--acid); rotate: 5deg; }
.stamp--orange { color: var(--orange); }
.stamp--sm { font-size: clamp(1rem, 2.4vw, 1.35rem); }

.stamp--void {
  text-decoration: line-through;
  text-decoration-thickness: 0.12em;
}

/* Tape */
.tape {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  z-index: 2;
  width: 7.5rem;
  height: 1.7rem;
  translate: -50% 0;
  rotate: -3deg;
  background: rgba(232, 197, 71, 0.82);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 50%);
  pointer-events: none;
}

.tape--left { left: 1.5rem; translate: 0 0; rotate: -6deg; }
.tape--right { left: auto; right: 1rem; translate: 0 0; rotate: 5deg; }

.hazard {
  height: 0.85rem;
  background: repeating-linear-gradient(-45deg, var(--tape) 0 12px, var(--void) 12px 24px);
}

/* Sticker */
.sticker {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(5.5rem, 14vw, 7.5rem);
  aspect-ratio: 1;
  padding: 0.5rem;
  border-radius: 50%;
  background: var(--acid);
  color: var(--void);
  box-shadow: 0 0 0 3px var(--void), 0 0 0 5px var(--acid), 0 0.75rem 1.5rem rgba(0, 0, 0, 0.5);
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
  rotate: 12deg;
}

.sticker__big {
  display: block;
  font-size: 1.75em;
}

.sticker--orange {
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--void), 0 0 0 5px var(--orange), 0 0.75rem 1.5rem rgba(0, 0, 0, 0.5);
}

/* Redacted: declassifies on hover / keyboard focus; screen readers always get the text */
.redact {
  position: relative;
  padding: 0 0.15em;
  color: transparent;
  background: repeating-linear-gradient(-45deg, #000 0 7px, #161616 7px 9px);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  cursor: help;
  transition: color var(--t-med), background-color var(--t-med);
}

.redact:hover,
.redact:focus-visible {
  color: var(--void);
  background: var(--acid);
}

.redact-hint {
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* Typewriter: single-line readouts only */
.type {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: -0.15em;
  background: var(--acid);
}

/* Proficiency meter */
.meter {
  --c: var(--acid);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 0.75rem;
  align-items: baseline;
}

.meter__label {
  font-size: var(--fs-sm);
  font-weight: 700;
}

.meter__val {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c);
  font-variant-numeric: tabular-nums;
}

.meter__track {
  position: relative;
  grid-column: 1 / -1;
  height: 0.7rem;
  background: rgba(228, 223, 204, 0.12);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 calc(5% - 3px), transparent calc(5% - 3px) 5%);
  mask-image: repeating-linear-gradient(90deg, #000 0 calc(5% - 3px), transparent calc(5% - 3px) 5%);
}

.meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v) * 1%);
  background: var(--c);
  transform-origin: left center;
}

.meter--orange { --c: var(--orange); }
.meter--tape { --c: var(--tape); }
.meter--bone { --c: var(--bone); }

/* Status tags: colour + glyph + text, never colour alone */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.3em 0.65em;
  border: 2px solid currentColor;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
}

.tag--deployed { color: var(--acid); }
.tag--inprogress { color: var(--orange); }
.tag--recon { color: var(--tape); }

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.2em 0.55em;
  border: 1px solid var(--line-strong);
  background: rgba(10, 12, 9, 0.45);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
}

/* Buttons & links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--orange);
  background: transparent;
  color: var(--orange);
  font-family: var(--f-mono);
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--t-fast), color var(--t-fast);
}

.btn:hover {
  background: var(--orange);
  color: var(--void);
}

.btn--acid {
  border-color: var(--acid);
  color: var(--acid);
}

.btn--acid:hover {
  background: var(--acid);
  color: var(--void);
}

.btn--solid {
  background: var(--orange);
  color: var(--void);
}

.btn--solid:hover {
  background: var(--bone);
  border-color: var(--bone);
}

.btn__arrow {
  transition: translate var(--t-fast);
}

.btn:hover .btn__arrow {
  translate: 0.25em 0;
}

.todo {
  display: inline-block;
  padding: 0.3em 0.6em;
  border: 1px dashed var(--tape);
  color: var(--tape);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* 8. SECTIONS ----------------------------------------------------------- */

/* 01 OPERATOR PROFILE */
.hero {
  position: relative;
  display: grid;
  gap: 2rem;
  padding-top: clamp(2rem, 6vw, 4.5rem);
}

.hero__kicker {
  color: var(--acid);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero__name {
  margin-top: 0.75rem;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: var(--fs-hero);
  line-height: 0.8;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.hero__name span {
  display: block;
}

.hero__name .outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--bone);
}

.hero__aka {
  margin-top: 1.25rem;
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero__role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.hero__role-chip {
  padding: 0.35em 0.75em;
  background: var(--orange);
  color: var(--void);
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.hero__role-chip--ghost {
  background: transparent;
  color: var(--bone);
  border: 2px solid var(--bone);
}

.hero__stamps {
  position: absolute;
  right: -0.5rem;
  bottom: -1.75rem;
  z-index: 3;
  display: grid;
  justify-items: end;
  gap: 0.25rem;
  pointer-events: none;
}

/* Narrow screens: stamps sit at the foot of the ID card instead of hanging over the next panel */
@media (max-width: 63.99rem) {
  .hero__stamps {
    position: static;
    margin-top: 0.75rem;
  }
}

.hero__stamps .stamp--acid {
  margin-top: -1.2em;
  margin-right: 0.6em;
}

.idcard {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

.idcard__photo {
  position: relative;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  background:
    url("/img/reticle.svg") center / 92% no-repeat,
    repeating-linear-gradient(0deg, rgba(184, 255, 44, 0.06) 0 1px, transparent 1px 4px),
    var(--void);
  border: 1px solid var(--line-strong);
  font-family: var(--f-stencil);
  font-weight: 800;
  font-size: 2rem;
  color: var(--bone);
}

.idcard__rows {
  display: grid;
  gap: 0.55rem;
}

.idcard__row {
  display: grid;
  gap: 0.05rem;
}

.idcard__val {
  font-weight: 700;
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--acid);
}

.status-live::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  background: var(--acid);
  box-shadow: 0 0 0.6rem var(--acid);
}

.hero__bio {
  display: grid;
  gap: 0.9rem;
  font-size: var(--fs-base);
  max-width: 62ch;
}

.hero__bio p:first-child {
  font-size: var(--fs-lg);
  color: var(--bone);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero__grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 64rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }

  .hero__side {
    display: grid;
    gap: 2.25rem;
    padding-top: 2.5rem;
  }
}

.stats {
  position: relative;
}

/* Stickers stay inside the viewport on phones, hang off the edge where there is room */
.stats__sticker {
  right: 0.25rem;
  bottom: -3rem;
}

@media (min-width: 64rem) {
  .stats__sticker {
    right: -1.5rem;
    bottom: -2.5rem;
  }
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}

.stats__cell {
  display: grid;
  gap: 0.2rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--tape);
}

.stats__value {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  line-height: 0.9;
  color: var(--bone);
}

.stats__label {
  color: #d4cfb9;
}

/* Generic dossier grid */
.grid-auto {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

/* Hero stamps sit on the ID card */
.hero__stamps .stamp--acid {
  margin-top: -1.1em;
  margin-right: 0.5em;
}

/* 02 LOADOUT */
.loadout {
  display: grid;
  gap: 2.25rem;
}

.loadout__slot {
  position: relative;
}

.loadout__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.loadout__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid var(--c);
  color: var(--c);
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 2.25rem;
  line-height: 1;
}

.loadout__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: var(--fs-h3);
  line-height: 0.95;
  text-transform: uppercase;
}

.loadout__meters {
  display: grid;
  gap: 1rem 2rem;
}

.loadout__primary .loadout__meters {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.loadout__sidearms .loadout__meters {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
}

.loadout__sticker {
  top: -2.25rem;
  right: 0.25rem;
  rotate: -10deg;
}

@media (min-width: 64rem) {
  .loadout__sticker { right: -0.75rem; }
}

@media (min-width: 64rem) {
  .loadout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.75rem;
  }

  .loadout__primary,
  .loadout__sidearms {
    grid-column: 1 / -1;
  }
}

/* 03 SERVICE RECORD */
.timeline {
  position: relative;
  display: grid;
  gap: 2.75rem;
  padding-left: 1.75rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--orange) 0 10px, transparent 10px 16px);
}

.timeline__item {
  position: relative;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 1.6rem;
  width: 0.85rem;
  height: 0.85rem;
  background: var(--void);
  border: 2px solid var(--orange);
  rotate: 45deg;
}

.timeline__item:first-child::before {
  background: var(--acid);
  border-color: var(--acid);
}

.mission__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.mission__codename {
  font-family: var(--f-stencil);
  font-weight: 800;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  letter-spacing: 0.08em;
  color: var(--c);
}

.mission__role {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: var(--fs-h3);
  line-height: 1;
  text-transform: uppercase;
}

.mission__unit {
  color: var(--dim);
}

.mission__dates {
  margin-top: 0.4rem;
}

.mission__brief {
  margin-top: 1rem;
  max-width: 70ch;
  color: var(--bone);
}

.mission__obj-head {
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
}

.objectives {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.objectives__item {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
}

.objectives__check {
  display: grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--acid);
  color: var(--void);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

@media (min-width: 64rem) {
  .timeline {
    padding-left: 3rem;
  }

  .timeline::before {
    left: 0.85rem;
  }

  .timeline__item::before {
    left: -2.6rem;
  }

  .mission .objectives {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }
}

/* 04 COMMENDATIONS */
.medals {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}

.medal {
  --m: var(--acid);
  position: relative;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  height: 100%;
  padding: 1.25rem;
  background: linear-gradient(160deg, rgba(23, 27, 31, 0.96), rgba(9, 11, 8, 0.98));
  border: 1px solid var(--line);
  border-top: 3px solid var(--m);
}

.medal--edu { --m: var(--tape); }

.medal__hang {
  display: grid;
  justify-items: center;
}

.medal__ribbon {
  width: 2.6rem;
  height: 2rem;
  background: repeating-linear-gradient(90deg, var(--m) 0 6px, var(--olive-2) 6px 10px, var(--orange) 10px 13px, var(--olive-2) 13px 17px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

.medal__badge {
  display: grid;
  place-items: center;
  width: 5rem;
  aspect-ratio: 1;
  margin-top: -0.5rem;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), transparent 45%),
    var(--m);
  color: var(--void);
}

.medal--cert .medal__badge {
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.medal--edu .medal__badge {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.medal__year {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.medal--edu .medal__year {
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.medal__title {
  margin-top: 0.2rem;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
  text-transform: uppercase;
}

.medal__title a {
  color: inherit;
}

.medal__issuer {
  margin: 0.35rem 0 0.6rem;
  color: var(--bone);
  font-size: var(--fs-sm);
}

.medal__corner {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--m);
}

/* 05 ACTIVE OPERATIONS */
.ops {
  display: grid;
  gap: 2.75rem;
}

@media (min-width: 64rem) {
  .ops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 3rem;
  }
}

.op {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.op__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.op__codename {
  color: var(--c);
}

.op__title {
  margin-top: 0.75rem;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.op__link {
  color: var(--bone);
  text-decoration: none;
}

.op__link:hover {
  color: var(--c);
}

.op__summary {
  margin: 1rem 0 1.25rem;
}

.op__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.classified {
  padding: 0.55rem 0.75rem;
  background: repeating-linear-gradient(-45deg, #000 0 7px, #121212 7px 9px);
  color: var(--dim);
}

/* 06 FIELD INTEL */
.intel {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  padding-top: 1rem;
}

.intel__card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.intel__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}

.intel__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.75rem;
  line-height: 1;
  text-transform: uppercase;
}

.intel__note {
  margin: 0.75rem 0 1.25rem;
}

.intel__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: auto;
}

.intel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--tape);
}

.panel--paper .intel__tags {
  color: #4a1f04;
}

.intel__src {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel--paper .intel__src {
  color: var(--void);
}

/* 07 COMMS */
.comms {
  position: relative;
  margin-bottom: 2.5rem;
}

.comms__lede {
  max-width: 50ch;
  font-size: var(--fs-lg);
}

.comms__list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.comms__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "idx label arrow" "idx handle arrow";
  align-items: center;
  gap: 0 1rem;
  min-height: 4.5rem;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--line-strong);
  background: rgba(5, 6, 4, 0.6);
  color: var(--bone);
  text-decoration: none;
  transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}

.comms__link:hover {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--void);
}

.comms__idx {
  grid-area: idx;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--orange);
}

.comms__link:hover .comms__idx {
  color: var(--void);
}

.comms__label {
  grid-area: label;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  line-height: 1;
}

.comms__handle {
  grid-area: handle;
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.comms__arrow {
  grid-area: arrow;
  font-size: 1.75rem;
  transition: translate var(--t-fast);
}

.comms__link:hover .comms__arrow {
  translate: 0.3em 0;
}

.comms__stamp {
  position: absolute;
  right: 1.5rem;
  bottom: -1.4rem;
  pointer-events: none;
}

@media (max-width: 40rem) {
  .comms__stamp { display: none; }
}

@media (min-width: 64rem) {
  .comms__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* OPERATION DEBRIEF PAGE */
.debrief {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.debrief__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--acid);
  text-decoration: none;
}

.debrief__hero {
  position: relative;
  margin-top: 1rem;
  padding-bottom: 2.5rem;
  border-bottom: 3px solid var(--bone);
}

.debrief__title {
  margin-top: 0.75rem;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.85;
  text-transform: uppercase;
  max-width: 14ch;
}

.debrief__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.debrief__summary {
  margin-top: 1.25rem;
  max-width: 60ch;
  font-size: var(--fs-lg);
}

.debrief__stamp {
  position: absolute;
  right: 0;
  top: 2.5rem;
  pointer-events: none;
}

@media (max-width: 48rem) {
  .debrief__stamp { display: none; }
}

.debrief__grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
  margin-top: 3rem;
}

@media (min-width: 64rem) {
  .debrief__grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    column-gap: 2.75rem;
  }
}

.debrief__brief {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.debrief__h {
  margin-bottom: 1rem;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: var(--fs-h3);
  line-height: 1;
  text-transform: uppercase;
}

.debrief__brief .debrief__h {
  margin-bottom: 0;
}

.debrief__figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
}

.debrief__placeholder {
  display: grid;
  place-items: end center;
  aspect-ratio: 16 / 9;
  padding-bottom: 0.75rem;
  background:
    url("/img/reticle.svg") center / 40% no-repeat,
    repeating-linear-gradient(-45deg, rgba(255, 106, 19, 0.06) 0 10px, transparent 10px 20px),
    var(--void);
  border: 1px dashed var(--line-strong);
}

.debrief__placeholder .readout {
  padding: 0.25rem 0.5rem;
  background: var(--void);
}

.debrief__pager {
  display: grid;
  gap: 1rem;
  margin-top: 3.5rem;
}

@media (min-width: 48rem) {
  .debrief__pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pager__link {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--line-strong);
  color: var(--bone);
  text-decoration: none;
}

.pager__link--next {
  text-align: right;
}

.pager__link:hover {
  border-color: var(--orange);
}

.pager__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
  text-transform: uppercase;
}

/* SIGNAL LOST (404) */
.lost {
  padding-top: clamp(3rem, 10vw, 7rem);
  max-width: 48rem;
}

.lost__title {
  margin-top: 0.75rem;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(3.5rem, 14vw, 8rem);
  line-height: 0.85;
  text-transform: uppercase;
}

.lost__msg {
  margin-top: 1.25rem;
  max-width: 50ch;
}

.lost__stamp {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  pointer-events: none;
}

/* 9. MOTION: only when the visitor hasn't asked for less ----------------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .fx--grain {
    animation: grain 0.9s steps(5) infinite;
  }

  .ticker__track {
    animation: marquee 48s linear infinite;
  }

  .ticker:hover .ticker__track,
  .ticker:focus-within .ticker__track,
  .ticker[data-paused] .ticker__track {
    animation-play-state: paused;
  }

  .caret {
    animation: blink 1s steps(1) infinite;
  }

  /* Typewriter plays when the Kotlin app comes online (static text until then) */
  .js-ready .type {
    animation: type 1.1s steps(var(--n), end) 0.2s both;
  }

  .status-live::before,
  .rec-dot {
    animation: pulse 1.6s ease-in-out infinite;
  }

  /* Meters charge once when first seen, and always land on their true value */
  .js-ready .meter__fill {
    transform: scaleX(0);
    transition: transform 0.9s var(--ease-out) 0.1s;
  }

  .js-ready .meter.is-seen .meter__fill {
    transform: none;
  }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-30px, 20px); }
  40% { transform: translate(25px, -35px); }
  60% { transform: translate(-15px, 40px); }
  80% { transform: translate(35px, 10px); }
  100% { transform: translate(0, 0); }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes type {
  from { width: 0; }
  to { width: calc(var(--n) * 1ch); }
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

/* 10. REDUCED MOTION: belt and braces ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
