@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@600&text=TFoyrt%20&display=swap");
:root {
  color-scheme: dark;
  --navy: #060a1a;
  --panel: #111a34;
  --paper: #eef1e0;
  --phos: #baf86b;
  --cobalt: #2a4fd6;
  --ink: #10172a;
  --muted: #bdc8e0;
  --mono: "Martian Mono", ui-monospace, Consolas, monospace;
  --display: "Anybody", "Arial Narrow", Impact, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  font-family: var(--body);
  background: var(--navy);
  color: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible, summary:focus-visible, video:focus-visible { outline: 3px solid #7298ff; outline-offset: 4px; }
.wrap { width: min(72rem, calc(100% - 2rem)); margin-inline: auto; }
.mast { border-bottom: 1px solid #374263; }
.mast .wrap, footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; }
.mast nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.mast nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .7rem; color: var(--muted); font: 600 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.mast nav a:hover, .mast nav a[aria-current] { color: var(--phos); }
.brand { min-height: 2.75rem; display: inline-flex; align-items: center; gap: .65rem; color: var(--phos); font: bold .8rem var(--mono); text-transform: uppercase; }
.brand img { width: 2.25rem; height: 2.25rem; }
.intro { padding-block: clamp(2.5rem, 8vw, 6rem) 2rem; border-bottom: 4px solid var(--phos); }
.eyebrow, .back { font: 700 .75rem/1.4 var(--mono); letter-spacing: .065em; text-transform: uppercase; }
.intro .eyebrow { color: var(--phos); }
h1, h2, h3, p { margin-block: 0; }
h1, h2, h3 { font-family: var(--display); font-stretch: 72%; font-weight: 850; }
h1 { margin-block: .5rem 1rem; font-size: clamp(2.5rem, 9vw, 7rem); line-height: .95; letter-spacing: -.01em; overflow-wrap: anywhere; }
mark { color: inherit; background: linear-gradient(transparent 74%, #70a632 74% 94%, transparent 94%); }
.lede { max-width: 60ch; color: var(--muted); font-size: 1.15rem; line-height: 1.55; }
.back { display: inline-flex; align-items: center; min-height: 2.75rem; margin-bottom: 1rem; }
.live-link, footer a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.games, .gates ol, .highlights ol { list-style: none; padding: 0; margin: 0; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin-block: 2rem; }
.game-card { display: block; height: 100%; border: 1px solid #48587e; background: var(--panel); text-decoration: none; }
.game-card:hover { border-color: var(--phos); }
.game-card div { display: grid; gap: .45rem; padding: 1rem; }
.game-card .eyebrow, .game-card span { color: var(--phos); }
.game-card h2 { font-size: 1.5rem; line-height: 1.1; }
.game-card .cover { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--navy); }
.game-card .card-line { color: var(--paper); line-height: 1.4; }
.game-card .card-facts { color: var(--muted); font: .68rem/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
/* The build at a glance: when it started, how far it has come, what is next. */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 1.6rem 0 0; background: #374263; border: 1px solid #374263; max-width: 60rem; }
.facts div { padding: .8rem 1rem; background: var(--navy); }
.facts .wide { grid-column: 1 / -1; }
.facts dt { color: var(--phos); font: 700 .68rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.facts dd { margin: .25rem 0 0; font-size: 1.02rem; line-height: 1.4; }
/* The gates: the same five as the tracker on the shelf, then updates. */
.gates { padding-block: 1.5rem .5rem; }
.gates ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.gates a, .gates li > div { display: grid; gap: .15rem; align-content: start; height: 100%; min-height: 2.75rem; padding: .7rem .75rem; border: 1px solid #48587e; border-top: .25rem solid var(--phos); background: var(--panel); text-decoration: none; }
.gates a:hover { border-color: var(--phos); }
.gates span { color: var(--phos); font: 700 .7rem var(--mono); }
.gates b { font: 850 1.15rem/1.05 var(--display); font-stretch: 72%; text-transform: uppercase; }
.gates small { color: var(--muted); font: .68rem var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.gates .none > div { border-top-color: #48587e; opacity: .55; }
/* Turning points: the handful of days that changed the game. */
.highlights { padding-block: 1.5rem 2rem; border-bottom: 1px solid #374263; }
.highlights h2, .story-title { font-size: clamp(1.5rem, 4vw, 2.3rem); line-height: 1.05; text-transform: uppercase; }
.highlights h2 { color: var(--phos); margin-bottom: .9rem; }
.highlights ol { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(13.5rem, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .6rem; scroll-snap-type: x proximity; }
.highlights li { scroll-snap-align: start; }
.highlights a { display: grid; gap: .4rem; align-content: start; height: 100%; padding: 0 0 .8rem; background: var(--paper); color: var(--ink); text-decoration: none; border-top: .3rem solid var(--phos); }
.highlights a:hover b { text-decoration: underline; }
.highlights img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--navy); }
.highlights .eyebrow { padding: .5rem .8rem 0; color: var(--cobalt); font-size: .66rem; }
.highlights a > .eyebrow:first-child { padding-top: .9rem; }
.highlights b { padding-inline: .8rem; font: 850 1.2rem/1.1 var(--display); font-stretch: 72%; }
.story { padding-top: 2rem; }
.story-title { margin-bottom: .4rem; }
/* The timeline: a rail down the left, a new heading at each gate. */
.chapters { position: relative; display: grid; gap: 1rem; margin-bottom: 1.5rem; padding-left: 1.6rem; border-left: 2px solid #374263; }
.phase { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; margin-top: 1.6rem; color: var(--phos); font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.05; text-transform: uppercase; }
.phase::before { content: ""; position: absolute; left: calc(-1.6rem - 8px); top: .2em; width: 14px; height: 14px; background: var(--phos); border-radius: 50%; box-shadow: 0 0 0 4px var(--navy); }
.phase span { font: 700 .8rem var(--mono); }
.phase small { color: var(--muted); font: 500 .85rem/1.3 var(--body); font-stretch: 100%; text-transform: none; letter-spacing: 0; }
.entry { position: relative; padding: .9rem 1.1rem 1rem; border: 1px solid #2b3658; background: var(--panel); scroll-margin-top: 1rem; }
.entry::before { content: ""; position: absolute; left: calc(-1.6rem - 6px); top: 1.2rem; width: 8px; height: 8px; background: var(--navy); border: 2px solid #6f7fa8; border-radius: 50%; }
.entry .eyebrow { color: var(--muted); font-size: .68rem; }
.entry h3 { margin-block: .3rem .35rem; font-size: clamp(1.2rem, 2.6vw, 1.5rem); line-height: 1.1; }
.entry .sum { max-width: 70ch; color: #d5ddf7; line-height: 1.5; }
.entry:target { border-color: var(--phos); box-shadow: 0 0 0 2px var(--phos); }
.entry.shown, .entry.big { background: var(--paper); color: var(--ink); border: 0; border-top: .35rem solid var(--cobalt); padding: clamp(1rem, 3vw, 1.8rem); }
.entry.shown .eyebrow, .entry.big .eyebrow { color: #3d4868; }
.entry.shown .sum, .entry.big .sum { color: var(--ink); }
.entry.shown header, .entry.big header { margin-bottom: 1rem; }
.entry.big { border-top-color: var(--phos); box-shadow: 0 0 0 1px #48587e; }
.entry.big::before { width: 12px; height: 12px; left: calc(-1.6rem - 8px); background: var(--phos); border-color: var(--phos); }
.entry.big h3 { font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1.05; }
.entry.big .sum { font-size: 1.08rem; }
.entry.big:not(.shown) header { margin-bottom: 0; }
.flag { display: inline-block; margin-bottom: .6rem; padding: .25rem .5rem; background: var(--ink); color: var(--phos); font: 700 .64rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.media.solo { grid-template-columns: minmax(0, 46rem); }
@media (max-width: 52rem) {
  .gates ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .chapters { padding-left: 1.1rem; }
  .phase::before { left: calc(-1.1rem - 8px); }
  .entry::before { left: calc(-1.1rem - 6px); }
  .entry.big::before { left: calc(-1.1rem - 8px); }
}
.media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
figure { margin: 0; border: 1px solid #b0b9ab; }
figure a, figure img, figure video { display: block; width: 100%; }
figure img, figure video { aspect-ratio: 16 / 9; object-fit: contain; background: var(--navy); }
figcaption { padding: .65rem .8rem; font-size: .92rem; line-height: 1.4; }
footer { color: var(--muted); font: .78rem var(--mono); margin-top: 3rem; border-top: 1px solid #374263; }
@media (max-width: 42rem) { .media { grid-template-columns: minmax(0, 1fr); } }

/* The shared hardware bench lives below the journal index introduction. */
.test-bench { margin-block: 1.5rem 2rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid #48587e; border-left: .3rem solid var(--phos); background: var(--panel); }
.test-bench > .eyebrow { color: var(--phos); }
.test-bench h2 { margin-block: .35rem .7rem; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.05; }
.test-bench-intro, .test-bench-emulators { max-width: 80ch; color: var(--muted); line-height: 1.55; }
.test-bench-devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-block: 1.2rem; }
.test-bench-devices dt { color: var(--paper); font-weight: 750; }
.test-bench-devices dd { margin: .25rem 0 0; color: var(--muted); line-height: 1.45; }
.test-bench-emulators { padding-top: 1rem; border-top: 1px solid #374263; font-size: .95rem; }
.test-bench-emulators strong { display: block; margin-bottom: .25rem; color: var(--phos); }
@media (max-width: 36rem) { .test-bench-devices { grid-template-columns: 1fr; } }

/* Toy Fort series tag (painted toy block, this game's peg lit) */
.tf-tag { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin: .2rem 0 .9rem; padding: 6px 13px 7px; border: 3px solid #6a3d1c; border-radius: 10px;
  background: linear-gradient(#e7b57a, #c98f58); box-shadow: 0 4px 0 #46270f; color: #fff6dc; font: 600 1rem/1.1 "Fredoka", "Nunito", system-ui, sans-serif;
  text-shadow: 0 2px 0 #46270f; text-decoration: none; white-space: nowrap; transition: transform .12s }
.tf-tag:hover, .tf-tag:focus-visible { transform: translateY(-2px) rotate(-1deg) }
.tf-tag:focus-visible { outline: 3px solid #ffe39a; outline-offset: 3px }
.tf-pegs { display: flex; gap: 5px }
.tf-pegs b { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 -2px 0 #0004; opacity: .6; filter: saturate(.5) }
.tf-pegs b:nth-child(1) { background: #e2442c } .tf-pegs b:nth-child(2) { background: #2f76cf } .tf-pegs b:nth-child(3) { background: #3fa94a } .tf-pegs b:nth-child(4) { background: #f2b61f }
.tf-pegs b.on { opacity: 1; filter: none; transform: scale(1.25); box-shadow: inset 0 -2px 0 #0004, 0 0 0 2px #fff6dc }
.tf-grapple, .tf-tide, .tf-kite, .tf-night { border-color: #00000055; box-shadow: 0 4px 0 #46270f, inset 0 0 0 2px #ffffff30 }
.tf-grapple { background: linear-gradient(#5cc2c0, #2f8f97) } .tf-tide { background: linear-gradient(#3a4f96, #1f2c63) }
.tf-kite { background: linear-gradient(#f2b98a, #d98a5a) } .tf-night { background: linear-gradient(#ee6a4f, #c23d25) }
