/* ==========================================================================
   Ad Poison — main stylesheet
   Retro 8-bit / Día de Muertos arcade theme. Shared by every page.
   ========================================================================== */

/* ---------- Fonts (self-hosted: no third-party requests) ---------- */
@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("../fonts/vt323.woff2") format("woff2");
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --night: #16091f;
  --night-2: #221033;
  --night-3: #2f1747;
  --ink: #1a0f1f;
  --bone: #f4ecd8;
  --bone-dim: #cfc4ad;
  --marigold: #ff9f1c;
  --pink: #ff5c9d;
  --teal: #2ec4b6;
  --yellow: #ffd23f;
  --green: #7bd389;
  --violet: #b18cff;
  --danger: #ff6b6b;

  --font-pixel: "Press Start 2P", ui-monospace, monospace;
  --font-body: "VT323", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-code: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --px: 4px; /* one "pixel" of chrome */
  --radius: 0;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body,
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
img, svg { display: block; max-width: 100%; }
img { image-rendering: pixelated; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Base ---------- */
body {
  background: var(--night);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.375rem;
  line-height: 1.35;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(var(--night-3) 1px, transparent 1px);
  background-size: 24px 24px;
}
main { flex: 1; }

h1, h2, h3 {
  font-family: var(--font-pixel);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
h1 { font-size: clamp(1.4rem, 4.2vw, 2.6rem); color: var(--yellow); text-shadow: 4px 4px 0 var(--ink); }
h2 { font-size: clamp(1rem, 2.6vw, 1.5rem); color: var(--marigold); margin-bottom: 1rem; }
h3 { font-size: clamp(0.8rem, 1.8vw, 0.95rem); color: var(--teal); margin-bottom: 0.6rem; }
p + p { margin-top: 0.8rem; }

a { color: var(--yellow); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--pink); }
a[target="_blank"]::after {
  content: "\2197";
  display: inline-block;
  margin-left: 0.15em;
  font-size: 0.85em;
}
a.btn[target="_blank"]::after, .no-ext::after, .linklist a::after { content: none !important; }

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

code, kbd, pre, samp { font-family: var(--font-code); font-size: 0.95rem; }
:not(pre) > code {
  background: var(--ink);
  color: var(--green);
  padding: 0.1em 0.35em;
  word-break: break-word;
}
kbd {
  background: var(--bone);
  color: var(--ink);
  padding: 0.05em 0.4em;
  box-shadow: 0 3px 0 var(--bone-dim);
}

::selection { background: var(--pink); color: var(--ink); }

.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;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 100;
  background: var(--yellow);
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Pixel frame utility ---------- */
.pixel-box {
  position: relative;
  background: var(--night-2);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--bone),
    0 var(--px) 0 0 var(--bone),
    calc(var(--px) * -1) 0 0 0 var(--bone),
    var(--px) 0 0 0 var(--bone),
    0 0 0 calc(var(--px) * 2) var(--ink),
    calc(var(--px) * 3) calc(var(--px) * 3) 0 calc(var(--px) * 1) var(--ink);
  padding: clamp(1rem, 3vw, 1.75rem);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 9, 31, 0.94);
  border-bottom: var(--px) solid var(--ink);
  box-shadow: 0 var(--px) 0 var(--night-3);
  backdrop-filter: blur(6px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--bone);
  font-family: var(--font-pixel);
  font-size: 0.85rem;
}
.brand img { width: 36px; height: 36px; }
.brand:hover { color: var(--yellow); }

.nav-toggle {
  display: none;
  background: var(--night-3);
  border: 0;
  box-shadow: 0 0 0 var(--px) var(--bone);
  padding: 0.5rem 0.7rem;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  cursor: pointer;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  list-style: none;
  padding: 0;
}
.site-nav a {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--bone);
  text-decoration: none;
  padding: 0.5rem 0.1rem;
  display: inline-block;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--yellow); box-shadow: inset 0 -4px 0 var(--pink); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--night);
    border-bottom: var(--px) solid var(--ink);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    padding: 0.5rem var(--gutter) 1rem;
  }
  .site-nav a { padding: 0.8rem 0; font-size: 0.75rem; }
}

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--yellow);
  --fg: var(--ink);
  --shade: #b88a00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.2rem;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  line-height: 1.5;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--shade),
    0 0 0 var(--px) var(--ink);
  transition: transform 0.05s steps(1);
}
.btn:hover { color: var(--fg); filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: inset var(--px) var(--px) 0 var(--shade), 0 0 0 var(--px) var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn--pink { --bg: var(--pink); --shade: #b8235c; }
.btn--teal { --bg: var(--teal); --shade: #18867c; }
.btn--ghost { --bg: var(--night-3); --fg: var(--bone); --shade: var(--ink); }
.btn--danger { --bg: var(--danger); --shade: #a83232; }
.btn--sm { min-height: 40px; padding: 0.5rem 0.8rem; font-size: 0.6rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section--alt { background: var(--night-2); border-block: var(--px) solid var(--ink); }
.section__head { max-width: 760px; margin-bottom: 2rem; }
.section__head p { color: var(--bone-dim); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--ink);
  background: var(--teal);
  padding: 0.35rem 0.55rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

.card { display: flex; flex-direction: column; gap: 0.7rem; }
.card__icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  background: var(--ink);
  color: var(--yellow);
  box-shadow: 0 0 0 var(--px) var(--marigold);
  margin-bottom: 0.4rem;
}
.card p { color: var(--bone-dim); }
.card .btn { align-self: flex-start; margin-top: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: var(--px) solid var(--ink);
  background:
    linear-gradient(180deg, #1b0a2a 0%, #2a1240 55%, #3b1d52 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(5rem, 11vw, 8rem);
}
.hero__copy p.lede { font-size: 1.6rem; margin-top: 1.25rem; max-width: 34ch; }
.hero__copy .btn-row { margin-top: 2rem; }
.hero__note { margin-top: 1.25rem; color: var(--bone-dim); font-size: 1.15rem; }

.hero__stage {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}
.mascot {
  position: relative;
  width: min(100%, 340px);
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  animation: bob 1.4s steps(6) infinite;
}
.mascot img { width: 100%; height: auto; filter: drop-shadow(8px 8px 0 rgba(0, 0, 0, 0.45)); }
.mascot.is-flapping { animation: flap 0.45s steps(5) 1; }
.mascot-tip {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--bone-dim);
  margin-top: 1rem;
  text-align: center;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-18px) rotate(2deg); }
}
@keyframes flap {
  0% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-60px) rotate(-12deg); }
  100% { transform: translateY(0) rotate(4deg); }
}

/* parallax layers */
.hero__sky,
.hero__ground,
.hero__pipes,
.hero__ads { position: absolute; inset: 0; pointer-events: none; }
.hero__sky {
  background-image:
    radial-gradient(2px 2px at 20px 30px, var(--yellow) 50%, transparent 51%),
    radial-gradient(2px 2px at 140px 80px, var(--bone) 50%, transparent 51%),
    radial-gradient(2px 2px at 260px 20px, var(--violet) 50%, transparent 51%),
    radial-gradient(2px 2px at 330px 140px, var(--bone) 50%, transparent 51%),
    radial-gradient(2px 2px at 80px 190px, var(--violet) 50%, transparent 51%);
  background-size: 400px 240px;
  opacity: 0.8;
  animation: scroll-x 60s linear infinite;
}
.hero__ground {
  top: auto;
  height: 56px;
  background:
    repeating-linear-gradient(90deg, var(--marigold) 0 20px, transparent 20px 40px) top / 100% 8px no-repeat,
    #3b1d52;
  border-top: var(--px) solid var(--ink);
  animation: scroll-x 6s steps(30) infinite;
  background-size: 40px 8px, auto;
  background-repeat: repeat-x, no-repeat;
}
.pipe {
  position: absolute;
  width: 64px;
  background: var(--teal);
  box-shadow: inset 10px 0 0 rgba(255, 255, 255, 0.25), inset -12px 0 0 rgba(0, 0, 0, 0.25), 0 0 0 var(--px) var(--ink);
  animation: pipe-move 14s linear infinite;
  right: -100px;
}
.pipe::before {
  content: "";
  position: absolute;
  left: -10px; right: -10px;
  height: 26px;
  background: inherit;
  box-shadow: inherit;
}
.pipe--bottom { bottom: 56px; height: 140px; }
.pipe--bottom::before { top: 0; }
.pipe--top { top: 0; height: 110px; background: var(--pink); }
.pipe--top::before { bottom: 0; }
.pipe--b2 { animation-delay: -7s; height: 90px; background: var(--marigold); }

.ad-chip {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--ink);
  background: var(--bone);
  padding: 0.3rem 0.4rem;
  box-shadow: 0 0 0 3px var(--ink);
  right: -80px;
  animation: pipe-move 11s linear infinite;
  opacity: 0.4;
}
.ad-chip:nth-child(1) { top: 18%; animation-delay: -2s; }
.ad-chip:nth-child(2) { top: 42%; animation-delay: -6s; background: var(--yellow); }
.ad-chip:nth-child(3) { top: 64%; animation-delay: -9s; background: var(--green); }

@keyframes scroll-x { to { background-position: -400px 0, -400px 0, -400px 0, -400px 0, -400px 0; } }
@keyframes pipe-move { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 200px)); } }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__stage { min-height: 220px; order: -1; }
  .mascot { width: min(70%, 260px); }
  .pipe, .ad-chip { display: none; }
}

/* ---------- Page header (sub pages) ---------- */
.page-hero {
  background: linear-gradient(180deg, #1b0a2a, #2a1240);
  border-bottom: var(--px) solid var(--ink);
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
}
.page-hero .wrap { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.page-hero p.lede { font-size: 1.5rem; margin-top: 1rem; max-width: 60ch; color: var(--bone); }
.page-hero img { width: 140px; height: auto; animation: bob 1.4s steps(6) infinite; }
@media (max-width: 640px) {
  .page-hero .wrap { grid-template-columns: 1fr; }
  .page-hero img { display: none; }
}

.breadcrumbs ol {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  list-style: none; padding: 0; margin-bottom: 1rem;
  font-size: 1.1rem; color: var(--bone-dim);
}
.breadcrumbs li + li::before { content: "\25B8"; margin-right: 0.4rem; color: var(--pink); }
.breadcrumbs a { color: var(--bone-dim); }

/* ---------- Prose ---------- */
.prose { max-width: 820px; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li::marker { color: var(--pink); }

/* ---------- Callouts ---------- */
.callout {
  border-left: calc(var(--px) * 2) solid var(--teal);
  background: rgba(46, 196, 182, 0.08);
  padding: 0.9rem 1.1rem;
}
.callout--warn { border-color: var(--marigold); background: rgba(255, 159, 28, 0.1); }
.callout--danger { border-color: var(--danger); background: rgba(255, 107, 107, 0.1); }
.callout strong { color: var(--yellow); }

/* ---------- Code blocks w/ copy ---------- */
.code {
  position: relative;
  background: var(--ink);
  box-shadow: 0 0 0 var(--px) var(--night-3);
  margin-block: 1rem;
}
.code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  padding-right: 6rem;
  overflow-x: auto;
  color: var(--green);
  line-height: 1.55;
  tab-size: 2;
}
.code__label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--bone-dim);
  padding: 0.6rem 1.1rem 0;
}
.code .copy-btn { position: absolute; top: 0.5rem; right: 0.5rem; }

/* ---------- Details / accordions ---------- */
details.acc {
  background: var(--night-2);
  box-shadow: 0 0 0 var(--px) var(--night-3);
}
details.acc + details.acc { margin-top: 1rem; }
details.acc summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.2rem;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--bone);
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::before { content: "+"; color: var(--pink); }
details.acc[open] summary::before { content: "\2212"; }
details.acc[open] summary { color: var(--yellow); }
details.acc .acc__body { padding: 0 1.2rem 1.2rem; }
details.acc .acc__body > * + * { margin-top: 0.8rem; }
details.acc .acc__body ol, details.acc .acc__body ul { padding-left: 1.4rem; }

/* ---------- Forms ---------- */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--teal);
  margin-bottom: 0.8rem;
  padding: 0;
}
.field { display: grid; gap: 0.35rem; }
.field label, .label { font-family: var(--font-pixel); font-size: 0.6rem; color: var(--bone-dim); }
.field__hint { font-size: 1.05rem; color: var(--bone-dim); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.25rem 0;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px; height: 22px;
  margin: 0.15rem 0 0;
  background: var(--ink);
  box-shadow: 0 0 0 3px var(--bone);
  display: grid; place-items: center;
  cursor: pointer;
}
.check input[type="radio"] { border-radius: 0; }
.check input:checked { background: var(--pink); }
.check input:checked::after {
  content: "";
  width: 8px; height: 8px;
  background: var(--ink);
}
.check input:focus-visible { outline: var(--px) solid var(--yellow); outline-offset: 4px; }
.check small { display: block; color: var(--bone-dim); font-size: 1.05rem; }
.check .tag {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  background: var(--marigold);
  color: var(--ink);
  padding: 0.15rem 0.3rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--pink);
  height: 32px;
}
select, input[type="text"], input[type="url"], textarea {
  background: var(--ink);
  border: 0;
  box-shadow: 0 0 0 3px var(--bone);
  padding: 0.55rem 0.7rem;
  width: 100%;
}
textarea {
  font-family: var(--font-code);
  font-size: 0.9rem;
  color: var(--green);
  line-height: 1.5;
  resize: vertical;
}
textarea[wrap="off"] { white-space: pre; overflow-x: auto; }

/* ---------- Generator console ---------- */
.console {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}
@media (max-width: 960px) { .console { grid-template-columns: 1fr; } }
.console__controls { display: grid; gap: 1.6rem; align-content: start; }
.console__checks { display: grid; gap: 0.2rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

.screen {
  background: #0d0613;
  box-shadow: 0 0 0 var(--px) var(--ink), 0 0 0 calc(var(--px) * 3) var(--night-3), inset 0 0 60px rgba(46, 196, 182, 0.12);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}
.screen::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 4px);
}
.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.hud__stat {
  background: var(--ink);
  padding: 0.6rem;
  text-align: center;
}
.hud__stat dt { font-family: var(--font-pixel); font-size: 0.5rem; color: var(--bone-dim); }
.hud__stat dd { font-family: var(--font-pixel); font-size: clamp(0.8rem, 2vw, 1.1rem); color: var(--yellow); margin-top: 0.4rem; overflow-wrap: anywhere; }
.status-line {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  line-height: 1.7;
  color: var(--teal);
}
.status-line[data-state="running"] { color: var(--green); }
.status-line[data-state="error"] { color: var(--danger); }
.persona-card {
  border: 2px dashed var(--violet);
  padding: 0.6rem 0.8rem;
  color: var(--bone);
}
.persona-card strong { color: var(--violet); font-weight: 400; }
.log {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  max-height: 300px;
  overflow-y: auto;
  font-size: 1.15rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.15rem;
}
.log li { display: flex; gap: 0.6rem; color: var(--bone-dim); overflow-wrap: anywhere; }
.log li:first-child { color: var(--bone); }
.log time { color: var(--violet); flex: none; }
.log .src { color: var(--marigold); flex: none; min-width: 5.5ch; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin-block: 1rem; box-shadow: 0 0 0 var(--px) var(--night-3); }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
caption { text-align: left; padding: 0.8rem 1rem; font-family: var(--font-pixel); font-size: 0.6rem; color: var(--bone-dim); caption-side: top; }
th, td { padding: 0.7rem 1rem; text-align: left; vertical-align: top; border-bottom: 2px solid var(--night-3); }
th { font-family: var(--font-pixel); font-size: 0.6rem; color: var(--teal); background: var(--ink); font-weight: 400; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
td code { white-space: nowrap; }

.pill {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  padding: 0.25rem 0.4rem;
  background: var(--green);
  color: var(--ink);
  white-space: nowrap;
}
.pill--paid { background: var(--marigold); }
.pill--self { background: var(--violet); }
.pill--no { background: var(--bone-dim); }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; display: grid; gap: 0.8rem; }
.checklist li { background: var(--night-2); box-shadow: 0 0 0 var(--px) var(--night-3); padding: 0.9rem 1rem; }
.checklist .check { align-items: flex-start; }
.checklist input:checked + span { text-decoration: line-through; text-decoration-color: var(--pink); color: var(--bone-dim); }
.progress {
  height: 20px;
  background: var(--ink);
  box-shadow: 0 0 0 3px var(--bone);
  margin-block: 1rem 1.5rem;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, #5fb86e 12px 16px);
  transition: width 0.3s steps(8);
}

/* ---------- Hard-link list ---------- */
.linklist { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.linklist a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--night-2);
  box-shadow: 0 0 0 var(--px) var(--night-3);
  text-decoration: none;
  color: var(--bone);
}
.linklist a:hover { box-shadow: 0 0 0 var(--px) var(--pink); color: var(--yellow); }
.linklist a span:last-child { color: var(--bone-dim); font-size: 1.1rem; text-align: right; }

/* ---------- Share ---------- */
.share-panel { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.share-panel p { max-width: 52ch; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 200%);
  z-index: 200;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  padding: 0.8rem 1.1rem;
  box-shadow: 0 0 0 var(--px) var(--ink), 6px 6px 0 var(--px) rgba(0, 0, 0, 0.5);
  transition: transform 0.25s steps(4);
  max-width: calc(100vw - 32px);
}
.toast.is-visible { transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  border-top: var(--px) solid var(--night-3);
  padding-block: 2.5rem;
  font-size: 1.15rem;
  color: var(--bone-dim);
}
.site-footer .wrap { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.site-footer h2 { font-size: 0.65rem; color: var(--bone); margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 0.3rem; }
.site-footer a { color: var(--bone-dim); }
.site-footer a:hover { color: var(--yellow); }
.footer-brand { display: flex; gap: 0.8rem; align-items: center; }
.footer-brand img { width: 44px; height: 44px; }
.footer-legal { grid-column: 1 / -1; border-top: 2px solid var(--night-3); padding-top: 1.2rem; font-size: 1.05rem; }

/* ---------- 404 ---------- */
.lost { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
.lost img { width: min(60vw, 260px); margin: 0 auto 2rem; animation: bob 1.4s steps(6) infinite; }
.lost .btn-row { justify-content: center; margin-top: 2rem; }

/* ---------- Utilities ---------- */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.muted { color: var(--bone-dim); }
.center { text-align: center; }

/* ---------- Motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .pipe, .ad-chip { display: none; }
}

@media print {
  body { background: #fff; color: #000; font-family: Georgia, serif; font-size: 12pt; }
  .site-header, .site-footer, .hero__stage, .hero__sky, .hero__ground, .hero__pipes, .hero__ads, .btn, .copy-btn, .nav-toggle, .skip-link { display: none !important; }
  h1, h2, h3 { color: #000; text-shadow: none; }
  a { color: #000; }
  .code pre, textarea { color: #000; }
  .pixel-box, .code, details.acc { box-shadow: none; border: 1px solid #999; background: #fff; }
}
