/* ============ ROGUE AGENT STUDIO — devblog shared styles ============
   Same design tokens as the front page (index.html); font files live one
   directory up. Pages: index.html (log list) + one file per post. */
@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);
}
* { 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; }

/* ---- atmosphere: scanlines + vignette ---- */
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; }

.wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }

/* ---- header (same chrome as the front page) ---- */
header {
  position: sticky; top: 0; z-index: 50;
  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: 85px; }
.brand { display: flex; align-items: center; white-space: nowrap; }
.brand .word { width: 130px; height: auto; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.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); }
@media (max-width: 720px) { .nav-links a:not(.on) { display: none; } }

/* ---- devblog index: masthead + log cards ---- */
.blog-hero { padding: 84px 0 10px; }
.blog-hero .eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .3em; color: var(--dim);
  text-transform: uppercase; margin-bottom: 22px;
}
.blog-hero .eyebrow b { color: var(--green); font-weight: 700; }
.blog-hero h1 {
  font-family: var(--disp); font-weight: 400;
  font-size: clamp(34px, 6vw, 58px); 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);
}
.blog-hero .sub { max-width: 640px; margin-top: 20px; font-size: 17.5px; }
.blog-hero .sub b { color: #e8f4ff; font-weight: 600; }

.log-list { padding: 56px 0 40px; display: grid; gap: 18px; }
.log-card {
  display: block; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); overflow: hidden; position: relative;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.log-card > img {
  width: 100%; aspect-ratio: 16 / 5.5; object-fit: cover;
  border-bottom: 1px solid var(--line); background: #05050a;
}
.log-card .lbody { padding: 24px 28px 22px; }
.log-card:hover {
  border-color: rgba(53,224,255,.85); transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0,0,0,.45), var(--neon); text-decoration: none;
}
.log-meta {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px;
}
.log-meta .id { color: var(--green); font-family: var(--mono); letter-spacing: .14em; }
.log-meta .tag { color: var(--gold); }
.log-card h2 {
  font-family: var(--disp); font-weight: 400; font-size: clamp(18px, 2.6vw, 24px);
  letter-spacing: .06em; color: #eaf6ff; margin-bottom: 10px; line-height: 1.35;
}
.log-card h2 span { color: var(--cyan); margin-right: 10px; }
.log-card p { color: var(--dim); font-size: 15.5px; max-width: 74ch; }
.log-card .go {
  margin-top: 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--cyan-dim);
}
.log-card:hover .go { color: var(--cyan); text-shadow: 0 0 12px rgba(53,224,255,.6); }

/* ---- article ---- */
.post { padding: 72px 0 30px; }
.post-head { max-width: 880px; margin: 0 auto 30px; }
.post-head .log-meta { margin-bottom: 18px; }
.post-head h1 {
  font-family: var(--disp); font-weight: 400;
  font-size: clamp(26px, 4.6vw, 44px); letter-spacing: .04em; line-height: 1.22;
  color: var(--cyan); text-shadow: 0 0 16px rgba(53,224,255,.45), 0 0 60px rgba(53,224,255,.18);
}
/* the standfirst sits BELOW the hero image: title → image → deck → body.
   It shares the PROSE measure (title + hero own the wide 880px tier) so the
   left text edge is continuous from deck into body copy. */
.post-deck {
  max-width: 740px; margin: 0 auto 46px; font-size: 19px; line-height: 1.65;
  color: #dce8f6; border-left: 3px solid var(--cyan-dim); padding-left: 20px;
}
.post-deck b { color: var(--gold); font-weight: 600; }

.prose { max-width: 740px; margin: 0 auto; }
.prose > p { margin-bottom: 22px; }
.prose > p b, .prose li b { color: #e8f4ff; font-weight: 600; }
.prose em { color: var(--gold); font-style: normal; font-weight: 600; }
.prose h2 {
  font-family: var(--disp); font-weight: 400; font-size: clamp(17px, 2.6vw, 22px);
  letter-spacing: .09em; color: #e8f4ff; margin: 58px 0 22px;
  display: flex; align-items: baseline; gap: 13px;
  scroll-margin-top: 110px; /* anchor links land clear of the sticky header */
}
.prose h2::before { content: '»'; color: var(--cyan); font-size: .85em; }
.prose h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.prose ul, .prose ol { margin: 0 0 22px 1.35em; }
.prose li { margin-bottom: 9px; }
.prose li::marker { color: var(--cyan-dim); }
.prose code, figure.shot figcaption 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;
}
.prose hr { border: none; height: 1px; background: var(--line); margin: 46px 0; }

/* callouts — labelled panels in the FIELD DOSSIER idiom */
.note {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 22px 24px 18px; margin: 30px 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 { margin-bottom: 12px; }
.note p: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); }

/* pull quote — playtest verdicts, human voice */
.pull {
  border-left: 3px solid var(--gold); background: rgba(240,178,60,.05);
  border-radius: 0 8px 8px 0; padding: 20px 24px; margin: 30px 0;
  font-size: 17px; color: #e6dcc0;
}
.pull b { color: var(--gold); }
.pull .who { display: block; margin-top: 10px; font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }

/* data tables — the spec-dossier register */
.tblwrap { overflow-x: auto; margin: 30px 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; }

/* figures */
figure.shot { margin: 34px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
figure.shot.hero { max-width: 880px; margin: 0 auto 34px; }
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; }

/* scene rail — the 9-scene vocabulary as chips */
.scene-rail { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.scene-rail .sc {
  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);
}
.scene-rail .sc.hot { color: var(--cyan); border-color: rgba(53,224,255,.5); box-shadow: 0 0 14px rgba(53,224,255,.12); }
.scene-rail .sc.boss { color: var(--danger); border-color: rgba(255,77,106,.45); }

/* interactive state-sim demo (LOG 002) — the DAW's sim panel, embedded */
.demo { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin: 30px 0; overflow: hidden; font-family: var(--mono); }
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(53,224,255,.04); }
.demo-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dim); flex: none; transition: background .3s, box-shadow .3s; }
.demo.live .demo-bar .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.demo-bar .t { flex: 1; font-size: 10.5px; letter-spacing: .22em; color: var(--dim); }
.demo-play {
  font-family: var(--mono); font-size: 12px; letter-spacing: .15em; color: var(--green);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 5px;
  padding: 7px 18px; cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.demo-play:hover:not(:disabled) { border-color: var(--green); box-shadow: 0 0 14px rgba(82,255,158,.25); }
.demo-play:disabled { opacity: .45; cursor: default; }
.demo-play.stop { color: var(--danger); }
.demo-play.stop:hover:not(:disabled) { border-color: var(--danger); box-shadow: 0 0 14px rgba(255,77,106,.25); }
.demo-body { padding: 14px 16px 16px; display: grid; gap: 9px; }
.demo-cap { font-size: 10px; letter-spacing: .24em; color: var(--dim); text-transform: uppercase; margin-top: 4px; }
.demo-scenes, .demo-wager, .demo-lanes { display: flex; flex-wrap: wrap; gap: 7px; }
.demo-sc, .demo-wg {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--dim);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 13px; cursor: pointer; transition: color .2s, border-color .2s, box-shadow .2s;
}
.demo-sc:hover, .demo-wg:hover { color: var(--ink); border-color: var(--dim); }
.demo-sc[aria-pressed="true"] { color: var(--cyan); border-color: rgba(53,224,255,.6); box-shadow: 0 0 14px rgba(53,224,255,.15); }
.demo-sc.boss[aria-pressed="true"] { color: var(--danger); border-color: rgba(255,77,106,.55); box-shadow: 0 0 14px rgba(255,77,106,.15); }
.demo-wg[aria-pressed="true"] { color: var(--gold); border-color: rgba(240,178,60,.55); box-shadow: 0 0 12px rgba(240,178,60,.14); }
.demo-lane {
  font-size: 10px; letter-spacing: .12em; color: var(--faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px;
  transition: color .3s, border-color .3s;
}
.demo-lane.on { color: var(--green); border-color: rgba(82,255,158,.45); }
.demo-note { font-size: 11.5px; color: var(--dim); letter-spacing: .04em; }

/* chassis strip — one live body per row of the part-grammar table. Every tile
   shares a stage and a zoom, so the radius spread (12 -> 24, scout -> tank) is
   readable as size: the column IS the "size tells the truth about hull" claim
   the section makes in prose. */
table.spec-t th.ch-h { width: 92px; padding: 0; }
table.spec-t td.ch-cell { width: 92px; padding: 4px 0 4px 10px; vertical-align: middle; }
.chassis-stage {
  display: block; width: 78px; height: auto; aspect-ratio: 80 / 72;
  background: radial-gradient(ellipse 70% 60% at 50% 52%, rgba(53,224,255,.05), transparent 72%);
  border-radius: 6px;
}
@media (max-width: 540px) {
  table.spec-t th.ch-h, table.spec-t td.ch-cell { width: 54px; padding-left: 6px; }
  .chassis-stage { width: 58px; }
}

/* live bestiary (media/bestiary.js) — the game's own robot render code drawing
   real enemy instances into a grid of tiles. Same bundle the field guide uses;
   this page gets GRID mode (it has no per-enemy cards of its own).
   COLUMN MATH: 15 tiles. Explicit counts keyed to width so the roster always
   lands in full rows — 5×3 wide (broken out to the 880px header/hero measure),
   3×5 mid, 2-up narrow. auto-fill left a one-tile hole at common widths. */
figure.beastiary { margin: 40px 0 38px; }
.beast-grid {
  position: relative;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg2);
  padding: 16px;
}
/* labelled panel in the same idiom as .note — data-label lives on the div */
.beast-grid::before {
  content: attr(data-label); position: absolute; top: -9px; left: 16px;
  font-size: 10px; font-weight: 700; letter-spacing: .3em; color: var(--green);
  background: var(--bg); padding: 0 10px; text-transform: uppercase;
}
/* DIRECT CHILD ONLY. `figure.beastiary figcaption` also matches every TILE's
   caption (each figure.beast sits inside this figure) and out-specifies
   `.beast figcaption` (0,1,2 vs 0,1,1) — which put the wide-breakout's 70px
   side padding on 160px tiles and wrapped every caption to one word per line. */
figure.beastiary > figcaption {
  padding: 14px 2px 0; font-size: 13.5px; color: var(--dim); border: none;
}
figure.beastiary > figcaption b { color: var(--ink); font-weight: 600; }
.beast {
  margin: 0; min-width: 0; /* grid items default to min-width:auto and overflow */
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  overflow: hidden; transition: border-color .25s, box-shadow .25s, transform .25s;
}
.beast:hover { border-color: rgba(53,224,255,.55); box-shadow: 0 8px 22px rgba(0,0,0,.45); transform: translateY(-2px); }
.beast .beast-stage {
  display: block; width: 100%; height: auto; aspect-ratio: 208 / 150;
  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);
}
.beast figcaption { padding: 9px 11px 11px; border: none; }
.beast figcaption b {
  display: block; font-family: var(--disp); font-weight: 400; font-size: 11.5px;
  letter-spacing: .05em; color: #eaf6ff; margin-bottom: 4px; line-height: 1.35;
}
.beast figcaption span { display: block; font-size: 12px; line-height: 1.45; color: var(--dim); }
@media (prefers-reduced-motion: reduce) { .beast:hover { transform: none; } }
/* wide: break the roster out of the prose measure to the 880px title/hero tier;
   captions pad back in so caption text stays on the prose grid */
@media (min-width: 960px) {
  figure.beastiary { margin-left: -70px; margin-right: -70px; }
  figure.beastiary > figcaption { padding-left: 70px; padding-right: 70px; }
}
@media (max-width: 959px) { .beast-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 540px) {
  .beast-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 12px 10px 10px; }
  .beast figcaption { padding: 8px 9px 9px; }
  .beast figcaption b { font-size: 10.5px; }
  .beast figcaption span { font-size: 11.5px; }
}

/* article footer: sign-off + prev/next */
.post-foot { max-width: 740px; margin: 64px auto 0; }
.post-foot .ends {
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em;
  color: var(--green-dim); text-transform: uppercase;
}
.post-foot .ends .cursor { display: inline-block; width: 8px; height: 14px; background: var(--green); vertical-align: -2px; margin-left: 6px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.post-nav { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.post-nav a {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: rgba(13,15,24,.7);
  transition: border-color .25s, box-shadow .25s;
}
.post-nav a:hover { border-color: rgba(53,224,255,.85); box-shadow: var(--neon); text-decoration: none; color: #dffaff; }
/* the play-the-game CTA gets the green live accent so it outranks prev/next */
.post-nav a.play { color: var(--green); border-color: rgba(82,255,158,.35); }
.post-nav a.play:hover {
  border-color: var(--green); color: #eafff3;
  box-shadow: 0 0 0 1px rgba(82,255,158,.35), 0 0 16px rgba(82,255,158,.3), 0 0 48px rgba(82,255,158,.14);
}
@media (min-width: 720px) { .post-nav a.play { margin-left: auto; } }

/* ---- footer ---- */
footer { margin-top: 96px; 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 ---- */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
.rv.d1 { transition-delay: .08s; } .rv.d2 { transition-delay: .16s; }

/* ---- narrow screens (~380px must hold with zero horizontal overflow) ---- */
@media (max-width: 540px) {
  .post { padding-top: 54px; }
  .post-deck { font-size: 17.5px; padding-left: 16px; }
  .prose h2 { margin-top: 48px; }
  table.spec-t { min-width: 440px; font-size: 13.5px; }
  table.spec-t th { padding: 11px 12px 9px; }
  table.spec-t td { padding: 9px 12px; }
  .note { padding: 20px 16px 16px; }
  .pull { padding: 18px 16px; }
  .log-card .lbody { padding: 20px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .post-foot .ends .cursor { animation: none; }
}
