/* ============ AGENTIC — FIELD GUIDE ============
   Inherits the ROGUE AGENT STUDIO design tokens (studio-site/devblog/blog.css)
   but ships self-contained: this page lives INSIDE the game's published site
   (dist/wiki/), not the studio site, so fonts and art are local copies and
   every URL here is mount-relative. The page must work identically at
   sturdy-cliff-q2rt.here.now/wiki/ and rogueagent.studio/agentic/wiki/. */
@font-face { font-family: 'Michroma'; src: url('fonts/michroma.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('fonts/orbitron-var.woff2') format('woff2-variations'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('fonts/chakra-petch-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('fonts/chakra-petch-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('fonts/chakra-petch-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #1c1c2e;
  --bg2: #0b0b14;
  --panel: #0d0f18;
  --line: #1c2333;
  --cyan: #35e0ff;
  --cyan-dim: #1b8ba3;
  --green: #52ff9e;
  --green-dim: #1f7a4c;
  --gold: #f0b23c;
  --danger: #ff4d6a;
  --ink: #bdc9da;
  --dim: #6b7d94;
  --faint: #3d4a5e;
  --disp: 'Michroma', 'Orbitron', 'Chakra Petch', sans-serif;
  --body: 'Chakra Petch', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --neon: 0 0 0 1px rgba(53,224,255,.4), 0 0 16px rgba(53,224,255,.38), 0 0 48px rgba(53,224,255,.18), inset 0 1px 0 rgba(210,248,255,.18);
  /* zone hues — the five zones each own a colour, used by the ladder,
     the section rules and the depth chips so a zone reads the same everywhere */
  --z1: #35e0ff; --z2: #ff8a3c; --z3: #52ff9e; --z4: #7aa8ff; --z5: #ff4d6a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  font-synthesis: none; /* Michroma ships one weight — never fake-bold it */
}
::selection { background: rgba(53,224,255,.28); color: #eaffff; }

body::before {
  content: ''; position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 998; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 8%, transparent 55%, rgba(0,0,0,.5) 100%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
svg { display: block; max-width: 100%; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

/* ---- header ---- */
header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(28,28,46,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 74px; }
.brand { display: flex; align-items: center; white-space: nowrap; }
.brand .word { width: 122px; height: auto; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; transition: color .2s, text-shadow .2s; }
.nav-links a:hover { color: var(--cyan); text-decoration: none; text-shadow: 0 0 14px rgba(53,224,255,.65); }
.nav-links a.on { color: var(--cyan); }
.nav-links a.play {
  color: var(--green); border: 1px solid rgba(82,255,158,.4); border-radius: 6px;
  padding: 8px 16px; transition: box-shadow .25s, border-color .25s;
}
.nav-links a.play:hover { color: var(--green); border-color: var(--green); box-shadow: 0 0 18px rgba(82,255,158,.28); text-shadow: none; }
@media (max-width: 860px) { .nav-links a:not(.play) { display: none; } }

/* ---- hero ---- */
.hero { padding: 70px 0 0; }
.hero .eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .3em; color: var(--dim);
  text-transform: uppercase; margin-bottom: 20px;
}
.hero .eyebrow b { color: var(--green); font-weight: 700; }
.hero h1 {
  font-family: var(--disp); font-weight: 400;
  font-size: clamp(32px, 6vw, 60px); letter-spacing: .05em; line-height: 1.05;
  color: var(--cyan); text-shadow: 0 0 16px rgba(53,224,255,.5), 0 0 64px rgba(53,224,255,.2);
}
.hero .sub { max-width: 660px; margin-top: 20px; font-size: 18px; }
.hero .sub b { color: #e8f4ff; font-weight: 600; }
figure.shot { margin: 34px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
figure.shot img { width: 100%; display: block; background: #05050a; }
figure.shot figcaption { padding: 13px 18px; font-size: 13.5px; color: var(--dim); border-top: 1px solid var(--line); }
figure.shot figcaption b { color: var(--ink); font-weight: 600; }

/* ---- layout: sticky contents rail + body ---- */
.guide { display: grid; grid-template-columns: 208px minmax(0,1fr); gap: 54px; padding: 20px 0 40px; align-items: start; }
/* minmax(0,1fr), NOT 1fr: a bare 1fr keeps min-width:auto, so the widest
   min-content in the column (the spec tables carry min-width:520px) blew the
   column out to 543px inside a 332px wrap and pushed the page into horizontal
   overflow — clipped by body{overflow-x:hidden}, which hid the last grid column
   of the chassis strip entirely. The tables scroll inside .tblwrap instead. */
@media (max-width: 940px) { .guide { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.guide > main { min-width: 0; }

.toc { position: sticky; top: 96px; }
@media (max-width: 940px) { .toc { display: none; } }
.toc .tt {
  font-size: 10px; font-weight: 700; letter-spacing: .3em; color: var(--faint);
  text-transform: uppercase; margin-bottom: 14px;
}
.toc a {
  display: block; font-size: 13px; letter-spacing: .06em; color: var(--dim);
  padding: 5px 0 5px 13px; border-left: 1px solid var(--line);
  transition: color .2s, border-color .2s;
}
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.on { color: var(--cyan); border-left-color: var(--cyan); }

/* ---- sections ---- */
section { scroll-margin-top: 92px; padding-bottom: 18px; }
section > h2 {
  font-family: var(--disp); font-weight: 400; font-size: clamp(18px, 2.8vw, 25px);
  letter-spacing: .08em; color: #e8f4ff; margin: 62px 0 10px;
  display: flex; align-items: baseline; gap: 13px;
}
section > h2::before { content: '»'; color: var(--cyan); font-size: .85em; }
section > h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
section > .lede { color: var(--dim); font-size: 16px; max-width: 74ch; margin-bottom: 26px; }
section > .lede b { color: #e8f4ff; font-weight: 600; }
h3 {
  font-family: var(--disp); font-weight: 400; font-size: 15px; letter-spacing: .1em;
  color: var(--cyan); margin: 38px 0 14px; text-transform: uppercase;
}
p { margin-bottom: 18px; max-width: 78ch; }
p b, li b { color: #e8f4ff; font-weight: 600; }
em { color: var(--gold); font-style: normal; font-weight: 600; }
ul, ol { margin: 0 0 20px 1.35em; max-width: 78ch; }
li { margin-bottom: 8px; }
li::marker { color: var(--cyan-dim); }
code {
  font-family: var(--mono); font-size: .86em; color: #9fe8f7;
  background: rgba(53,224,255,.07); border: 1px solid rgba(53,224,255,.14);
  border-radius: 4px; padding: 1px 6px 2px; white-space: nowrap;
}
kbd {
  font-family: var(--mono); font-size: .82em; color: #dff6ff;
  background: linear-gradient(180deg, #172033, #0d1320);
  border: 1px solid #2b3a52; border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 8px 3px; white-space: nowrap; letter-spacing: .04em;
}
hr { border: none; height: 1px; background: var(--line); margin: 44px 0; }

/* callouts */
.note {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 22px 24px 18px; margin: 28px 0; font-size: 15.5px;
}
.note::before {
  content: attr(data-label); position: absolute; top: -9px; left: 16px;
  font-size: 10px; font-weight: 700; letter-spacing: .3em; color: var(--dim);
  background: var(--bg); padding: 0 10px; text-transform: uppercase;
}
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note.rule { border-color: rgba(240,178,60,.35); }
.note.rule::before { color: var(--gold); }
.note.data { border-color: rgba(82,255,158,.3); }
.note.data::before { color: var(--green); }
.note.warn { border-color: rgba(255,77,106,.35); }
.note.warn::before { color: var(--danger); }

.pull {
  border-left: 3px solid var(--gold); background: rgba(240,178,60,.05);
  border-radius: 0 8px 8px 0; padding: 20px 24px; margin: 28px 0;
  font-size: 17px; color: #e6dcc0;
}
.pull .who { display: block; margin-top: 10px; font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }

/* tables */
.tblwrap { overflow-x: auto; margin: 26px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table.spec-t { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 520px; }
table.spec-t th {
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim); text-align: left; padding: 13px 18px 11px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.spec-t td { padding: 10px 18px; border-bottom: 1px solid rgba(28,35,51,.6); vertical-align: top; }
table.spec-t tr:last-child td { border-bottom: none; }
table.spec-t td:first-child { color: #e8f4ff; font-weight: 600; white-space: nowrap; }
table.spec-t b { color: var(--gold); font-weight: 600; }
table.spec-t .num { font-family: var(--mono); color: var(--green); white-space: nowrap; }

/* ---- the zone ladder ---- */
.ladder { display: grid; gap: 10px; margin: 30px 0; }
.zrow {
  display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: stretch;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  overflow: hidden; position: relative;
  transition: border-color .25s, transform .25s;
}
.zrow:hover { border-color: rgba(53,224,255,.5); transform: translateX(3px); }
.zrow::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--zc); }
.zrow .zn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
  border-right: 1px solid var(--line); padding: 16px 8px;
}
.zrow .zn .d { font-family: var(--mono); font-size: 19px; color: var(--zc); letter-spacing: .02em; }
.zrow .zn .l { font-size: 9.5px; letter-spacing: .22em; color: var(--faint); text-transform: uppercase; margin-top: 3px; }
.zrow .zb { padding: 15px 20px 16px; }
.zrow .zb h4 { font-family: var(--disp); font-weight: 400; font-size: 14.5px; letter-spacing: .1em; color: var(--zc); margin-bottom: 6px; }
.zrow .zb p { font-size: 14.5px; color: var(--dim); margin: 0; max-width: none; }
.zrow .zb .boss {
  display: inline-block; margin-top: 9px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--danger);
  border: 1px solid rgba(255,77,106,.35); border-radius: 5px; padding: 3px 10px;
}
.zrow .zb .boss.gate { color: var(--gold); border-color: rgba(240,178,60,.4); }

/* ---- chassis strip (part-grammar section) ----
   One live body per chassis, every tile on the SAME stage at the SAME zoom, so
   the radius spread (12 -> 24, scout -> tank) reads as size. That IS the
   section's "size tells the truth about hull" claim, shown instead of stated. */
.chassis-strip { margin: 26px 0 8px; }
.chassis-grid {
  position: relative;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg2);
  padding: 18px 16px 14px;
}
.chassis-grid::before {
  content: attr(data-label); position: absolute; top: -9px; left: 18px;
  font-size: 10px; font-weight: 700; letter-spacing: .26em; color: var(--green);
  background: var(--bg); padding: 0 10px; text-transform: uppercase;
}
.chassis-strip > figcaption { padding: 14px 2px 0; font-size: 13.5px; color: var(--dim); }
.chassis-strip > figcaption b { color: var(--ink); font-weight: 600; }
/* the tiles themselves are figure.beast, same as the bestiary.
   min-width:0 is load-bearing: grid items default to min-width:auto, so the
   labels forced columns wider than their 1fr and pushed the last column off
   the page (clipped by body overflow-x:hidden — CRAWLER and BRUTE simply
   vanished at 380px). */
.chassis-grid .beast { border-color: transparent; background: transparent; min-width: 0; }
.chassis-grid .beast:hover { border-color: var(--line); background: var(--panel); }
.chassis-stage {
  display: block; width: 100%; height: auto; aspect-ratio: 80 / 72;
  background: radial-gradient(ellipse 70% 60% at 50% 52%, rgba(53,224,255,.05), transparent 72%);
  border-bottom: none;
}
.chassis-grid .beast figcaption { padding: 4px 4px 6px; text-align: center; }
.chassis-grid .beast figcaption b { font-size: 10px; letter-spacing: .1em; margin-bottom: 0; }
.chassis-grid .beast figcaption span { display: none; }  /* the label is the point; prose is below */
@media (max-width: 860px) { .chassis-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .chassis-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 16px 10px 10px; } }

/* ---- animated bestiary (public/wiki/bestiary.js) ----
   Each special's description card carries a data-beast tag; the bundle injects
   a live <canvas.beast-stage> at the TOP of the card — a real Robot ticked and
   drawn by the game's own render code, so media and text are one unit.
   Progressive enhancement: no JS → no canvas, the card is just its text. */
.beast-lead { font-size: 15px; color: var(--dim); }
.beast-lead b { color: var(--green); font-weight: 600; }
.card.beast { overflow: hidden; }              /* clip the full-bleed canvas to the card's rounded top */
.beast-stage {
  display: block;
  width: calc(100% + 40px);                    /* bleed past the card's 20px side padding */
  height: auto; aspect-ratio: 208 / 150;
  margin: -18px -20px 15px;                     /* cancel the card's top+side padding */
  background:
    radial-gradient(ellipse 66% 58% at 50% 44%, rgba(53,224,255,.06), transparent 70%),
    linear-gradient(180deg, #0a0d15, #05060b);
  border-bottom: 1px solid var(--line);
}

/* ---- chip rails ---- */
.rail { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.rail .c {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .1em;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px;
  color: var(--dim); background: var(--panel);
}
.rail .c.hot { color: var(--cyan); border-color: rgba(53,224,255,.5); box-shadow: 0 0 14px rgba(53,224,255,.12); }
.rail .c.boss { color: var(--danger); border-color: rgba(255,77,106,.45); }
.rail .c.gold { color: var(--gold); border-color: rgba(240,178,60,.45); }
.rail .c.grn { color: var(--green); border-color: rgba(82,255,158,.4); }

/* ---- card grids (rooms, enemies, hazards, mods) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; margin: 26px 0; }
.card {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 18px 20px 17px; transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover { border-color: rgba(53,224,255,.55); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.4); }
.card .k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 9px; display: flex; align-items: center; gap: 8px;
}
.card h4 { font-family: var(--disp); font-weight: 400; font-size: 14px; letter-spacing: .08em; color: #eaf6ff; margin-bottom: 8px; line-height: 1.4; }
.card p { font-size: 14.5px; color: var(--dim); margin: 0; max-width: none; }
.card p + p { margin-top: 9px; }
.card .tip { margin-top: 11px; font-size: 13.5px; color: var(--green-dim); }
.card .tip b { color: var(--green); font-weight: 600; }
.card.dngr { border-color: rgba(255,77,106,.28); }
.card.dngr .k { color: rgba(255,77,106,.7); }
.card.gold { border-color: rgba(240,178,60,.28); }
.card.gold .k { color: rgba(240,178,60,.75); }

/* ---- controls ---- */
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 24px 0; }
.keyrow {
  display: flex; align-items: baseline; gap: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 11px 15px;
}
.keyrow .kk { flex: none; display: flex; gap: 5px; flex-wrap: wrap; }
.keyrow .kd { font-size: 14px; color: var(--dim); }

/* ---- footer ---- */
footer { margin-top: 84px; border-top: 1px solid var(--line); padding: 34px 0 46px; }
.foot { display: flex; flex-wrap: wrap; gap: 18px 34px; align-items: center; font-size: 13px; color: var(--dim); }
.foot .boot { display: inline-flex; align-items: center; gap: 14px; letter-spacing: .14em; text-transform: uppercase; font-size: 11.5px; color: var(--faint); }
.foot .boot img { width: 125px; height: auto; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--cyan); }
.foot .right { margin-left: auto; display: flex; gap: 22px; }
@media (max-width: 720px) { .foot .right { margin-left: 0; } }

/* ---- reveal on scroll ----
   Fails OPEN: the hidden state only applies once the head script has confirmed
   IntersectionObserver exists and armed `.rv-on`. Without that class every
   section renders plainly. A guide that animates in is nice; a guide that is
   invisible because an observer never fired is not. */
.rv-on .rv { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rv-on .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .zrow:hover, .card:hover { transform: none; }
}
