/* Afterglow — hybrid modern + retro CRT styling */
:root {
  --bg:        #0a0c12;
  --bg-2:      #0e111a;
  --panel:     #141823;
  --panel-2:   #1b2030;
  --line:      #262c3d;
  --line-2:    #333b52;
  --text:      #e7ebf5;
  --muted:     #8b93a9;
  --muted-2:   #5e6679;
  --accent:    #6ee7ff;
  --accent-2:  #ff5da2;
  --good:      #66ffcc;
  --radius:    14px;
  --shadow:    0 10px 40px rgba(0,0,0,.45);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(110,231,255,.10), transparent 60%),
    radial-gradient(800px 500px at 0% 0%, rgba(255,93,162,.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.wrap { width: min(1180px, 92vw); margin: 0 auto; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(10,12,18,.72);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); letter-spacing: .04em; }
.brand b {
  font-size: 22px; font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 22px rgba(110,231,255,.25);
}
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: blink 2.4s infinite; }
@keyframes blink { 0%,92%,100%{opacity:1} 96%{opacity:.25} }
.brand small { color: var(--muted); font-size: 12px; }
.topbar nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); font-size: 13px; padding: 7px 12px; border-radius: 999px; transition: .18s; }
.topbar nav a:hover { color: var(--text); background: var(--panel); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 30px; }
.hero h1 {
  font-family: var(--mono);
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.02; margin: 0 0 16px; letter-spacing: -.01em; font-weight: 700;
}
.hero h1 .glow {
  background: linear-gradient(90deg, var(--accent), #b388ff 55%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(140,160,255,.18);
}
.hero p { color: var(--muted); font-size: clamp(15px, 2.2vw, 19px); max-width: 60ch; margin: 0; }
.hero .meta { margin-top: 22px; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted-2); font-family: var(--mono); font-size: 13px; }
.hero .meta b { color: var(--accent); }

/* ---------- filter chips ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0 10px; position: sticky; top: 64px; z-index: 30;
  padding: 12px 0; background: linear-gradient(var(--bg), rgba(10,12,18,.0)); }
.chip {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: .16s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { color: #051018; background: linear-gradient(90deg, var(--accent), #8ad9ff); border-color: transparent; font-weight: 600; }

/* ---------- category sections ---------- */
.cat { margin: 36px 0; }
.cat-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; }
.cat-head h2 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.cat-head span { color: var(--muted); font-size: 14px; }
.cat-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); margin-left: 6px; }

/* ---------- grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card .thumb {
  position: relative; aspect-ratio: 16/10; background: #05060a; overflow: hidden;
  container-type: size; border-bottom: 1px solid var(--line);
}
.card .thumb .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; opacity: .5;
  background: radial-gradient(120% 120% at 50% 30%, rgba(255,255,255,.04), transparent);
}
.card .thumb::after { /* scanline overlay */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.16) 2px 3px);
  mix-blend-mode: multiply; opacity: .5;
}
.card .body { padding: 14px 16px 16px; }
.card .body h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.card .body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.card .tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: 999px;
  background: rgba(8,10,16,.7); border: 1px solid var(--line-2); color: var(--muted);
  backdrop-filter: blur(4px);
}
.card .go { position: absolute; bottom: 14px; right: 14px; color: var(--muted); font-family: var(--mono); font-size: 12px; opacity: 0; transition: .18s; }
.card:hover .go { opacity: 1; color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); transition: .16s;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn.primary { background: linear-gradient(90deg, var(--accent), #7fd0ff); color: #04121a; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- config page ---------- */
.cfg-top { padding: 26px 0 8px; }
.crumb { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.crumb a:hover { color: var(--text); }
.cfg-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cfg-head h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 6px; letter-spacing: -.01em; }
.cfg-head .lede { color: var(--muted); margin: 0; max-width: 60ch; }
.cfg-head .cat-pill { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); padding: 4px 10px; border-radius: 999px; margin-top: 4px; display: inline-block; }

.cfg-layout { display: grid; grid-template-columns: 1.25fr .9fr; gap: 28px; margin: 26px 0 60px; align-items: start; }
@media (max-width: 900px) { .cfg-layout { grid-template-columns: 1fr; } }

.preview-col { position: sticky; top: 84px; }
.preview-box {
  position: relative; aspect-ratio: 16/10; width: 100%;
  background: #04050a; border: 1px solid var(--line-2); border-radius: var(--radius);
  overflow: hidden; container-type: size; box-shadow: var(--shadow);
}
.preview-box::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.14) 2px 3px);
  opacity: .45;
}
.preview-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.preview-hint { margin-top: 10px; color: var(--muted-2); font-size: 12px; font-family: var(--mono); }

.controls { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 20px 20px; }
.controls h3 { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 4px; }
.field { padding: 13px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field .label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.field .label span { font-size: 14px; }
.field .label .val { font-family: var(--mono); font-size: 13px; color: var(--accent); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 999px; background: var(--line-2); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 0 4px rgba(110,231,255,.15); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--accent); cursor: pointer; }

input[type="text"], textarea, select, input[type="datetime-local"], input[type="number"] {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 10px 12px; font-family: var(--sans); font-size: 14px; resize: vertical;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 76px; line-height: 1.45; }
select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }

.color-row { display: flex; align-items: center; gap: 10px; }
input[type="color"] { -webkit-appearance: none; appearance: none; width: 42px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; padding: 0; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
.color-row code { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.multi { display: flex; flex-direction: column; gap: 8px; }
.multi-row { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.multi-row input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* toggle switch */
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: .18s; }
.switch .track::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #cdd3e2; transition: .18s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); background: #04121a; }

/* ---------- fullscreen runner ---------- */
.af-fs { position: fixed; inset: 0; z-index: 9999; background: #000; }
.af-fs.cursor-hidden { cursor: none; }
.af-fs-host { position: absolute; inset: 0; container-type: size; }
.af-hint {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-family: var(--mono); font-size: 13px; color: rgba(255,255,255,.82);
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.18);
  padding: 8px 16px; border-radius: 999px; backdrop-filter: blur(6px); transition: opacity .6s;
}
.af-hint kbd { background: rgba(255,255,255,.14); border-radius: 5px; padding: 1px 6px; font-family: var(--mono); }
.af-hint.fade { opacity: 0; }

/* ---------- saver host helpers ---------- */
.af-host { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }
.af-canvas { display: block; width: 100%; height: 100%; }
.af-missing { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: 13px; text-align: center; padding: 16px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 50px; color: var(--muted-2); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }
footer .mono { font-family: var(--mono); }

.empty { color: var(--muted); font-family: var(--mono); padding: 40px 0; text-align: center; }

/* =====================================================================
 *  CONTENT SITE  (static pages generated by tools/build.mjs)
 * =================================================================== */

/* skip link + a11y helpers */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #04121a; font-weight: 700;
  padding: 10px 16px; border-radius: 8px; transition: top .15s;
}
.skip-link:focus { top: 12px; }
.visually-hidden, .visually-hidden:not(:focus):not(:active) {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Respect a system-level request for less motion: page-chrome transitions and
   the blinking-cursor keyframe go instant/static. This covers the shared
   nav/card/toggle UI; it can't reach into what an individual saver's own
   canvas animation does once it's running full-screen, since that motion is
   the thing the visitor explicitly chose to open. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
a { text-underline-offset: 2px; }
.prose a, .direct-answer a, .qa dd a, .foot-col a { text-decoration: underline; text-decoration-color: rgba(110,231,255,.5); }
.prose a:hover, .direct-answer a:hover { color: #fff; text-decoration-color: var(--accent); }

/* mobile nav toggle */
.nav-toggle {
  display: none; margin-left: auto; background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 9px; font-size: 18px; line-height: 1;
  width: 42px; height: 38px; cursor: pointer;
}
.topbar nav a[aria-current="page"] { color: var(--text); background: var(--panel); }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar .wrap { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
  .topbar nav { margin-left: 0; width: 100%; flex-direction: column; gap: 2px; display: none; }
  .topbar nav.open { display: flex; }
  .topbar nav a { width: 100%; }
}

/* generic content page */
.page { padding: 14px 0 30px; }
.page > h1 { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.08; margin: 6px 0 14px; letter-spacing: -.01em; }
.crumbs { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: 18px 0 4px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; color: var(--muted-2); margin-right: 6px; }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current="page"] { color: var(--muted); }

.direct-answer { font-size: clamp(16px, 2.1vw, 19px); color: #c9d1e4; max-width: 68ch; margin: 0 0 22px; line-height: 1.55; }
.lede { color: var(--muted); }
.muted { color: var(--muted); }

.prose { max-width: 72ch; color: #c9d1e4; line-height: 1.65; font-size: 16px; }
.prose h2 { color: var(--text); font-size: 22px; margin: 30px 0 10px; letter-spacing: -.01em; }
.prose h3 { color: var(--text); font-size: 18px; margin: 22px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text); }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--panel); padding: 1px 6px; border-radius: 5px; }

/* home */
.hero .lede { color: var(--muted); font-size: clamp(15px,2.2vw,19px); max-width: 64ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.section-title { font-size: 24px; margin: 40px 0 6px; letter-spacing: -.01em; scroll-margin-top: 80px; }
.intro { margin: 22px 0 10px; }
.home-cat { margin: 34px 0; scroll-margin-top: 80px; }
.home-cat .cat-head { display: block; margin-bottom: 14px; }
.home-cat .cat-head h2 { font-size: 21px; }
.home-cat .cat-head h2 a:hover { color: var(--accent); }
.home-cat .cat-head p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.cat-note { color: var(--muted-2); font-family: var(--mono); font-size: 12.5px; margin: 4px 0 12px; }
.cat-more { margin: 14px 0 0; font-family: var(--mono); font-size: 13px; }
.cat-more a { color: var(--accent); }

.full-index { margin: 48px 0 34px; scroll-margin-top: 80px; }
.full-index-note { color: var(--muted); font-size: 14px; margin: 4px 0 20px; }
.index-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 28px; }
.index-group h3 { font-size: 15px; margin: 0 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.index-group h3 a { color: var(--fg); }
.index-group h3 a:hover { color: var(--accent); }
.index-count { color: var(--muted-2); font-family: var(--mono); font-size: 12px; font-weight: 400; }
.index-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.index-group li { font-size: 13px; line-height: 1.4; }
.index-group a { color: var(--muted); }
.index-group a:hover { color: var(--accent); }

/* new cards (link-based, glyph thumb + live preview) */
.card-thumb {
  position: relative; display: block; aspect-ratio: 16/9; background: #05060a;
  border-bottom: 1px solid var(--line); overflow: hidden; container-type: size;
}
/* Captured stills. The shots are 16:9 at 480x270, so the tile matches that
   ratio exactly and nothing is cropped. object-fit still guards the handful
   of savers whose capture came back a different shape. */
.card-shot {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; background: #05060a;
}
/* Marks the ~700 savers that read live data. Deliberately quiet: it should
   read as a property of the card, not as a call to action. */
.card-live {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .08em;
  padding: 2px 6px; border-radius: 3px;
  color: #8fd6a8; background: rgba(4, 8, 6, .72); border: 1px solid rgba(143, 214, 168, .3);
}
.card-glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; opacity: .5; }
.card-body { display: block; padding: 13px 15px 15px; }
.card-title { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-tag { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 3px; }
.card-go { position: absolute; bottom: 13px; right: 14px; color: var(--muted); font-family: var(--mono); font-size: 12px; opacity: 0; transition: .18s; }
.card:hover .card-go { opacity: 1; color: var(--accent); }

/* saver widget */
.saver-page .widget { margin: 6px 0 26px; }
.saver-page .preview-box { aspect-ratio: 16/9; max-width: 860px; }
.noscript-preview { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); }
.noscript-preview .ns-glyph { font-size: 52px; display: block; margin-bottom: 10px; opacity: .7; }
.controls { margin-top: 18px; max-width: 860px; }
.controls:empty { display: none; }
.controls .label span { font-size: 14px; }
.controls .field .val { font-family: var(--mono); color: var(--accent); font-size: 13px; }

.how, .example, .tips, .faq, .related, .affiliate { max-width: 72ch; margin: 30px 0; }
.how h2, .example h2, .tips h2, .faq h2, .related h2, .affiliate h2, .sitemap-group h2 { font-size: 22px; margin: 0 0 12px; letter-spacing: -.01em; }
.tips ul { padding-left: 22px; color: #c9d1e4; line-height: 1.6; }
.tips li { margin: 7px 0; }

/* FAQ */
.faq dl { margin: 0; }
.faq .qa { border-top: 1px solid var(--line); padding: 14px 0; }
.faq dt { font-weight: 600; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.faq dd { margin: 0; color: var(--muted); line-height: 1.6; }

/* related / category lists */
.rel-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.rel-list a { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; transition: .16s; }
.rel-list a:hover { border-color: var(--line-2); transform: translateY(-2px); }
.rel-glyph { font-size: 20px; }
.rel-name { font-weight: 600; }
.rel-tag { color: var(--muted); font-size: 13px; }
.back-hub { margin: 26px 0 0; font-family: var(--mono); font-size: 13px; }
.back-hub a { color: var(--accent); }

/* ad slot (clearly marked placeholder) */
.ad-slot { margin: 26px auto; max-width: 860px; text-align: center; }
.ad-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px; }
.ad-box { border: 1px dashed var(--line-2); border-radius: 12px; min-height: 90px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 10px, transparent 10px 20px); }
.ad-ph { color: var(--muted-2); font-family: var(--mono); font-size: 12px; }

/* affiliate */
.affiliate { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.aff-disclosure { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.aff-title { font-size: 18px !important; margin: 0 0 10px !important; }
.aff-list { margin: 0; padding-left: 20px; color: #c9d1e4; line-height: 1.6; }
.aff-list a { color: var(--accent); text-decoration: underline; }

/* forms */
.signup { max-width: 540px; margin: 18px 0; }
.signup .field { border-bottom: 0; padding: 8px 0; }
.signup label { display: block; font-size: 14px; margin-bottom: 6px; }
.signup .req { color: var(--accent-2); }
.signup .opt { color: var(--muted-2); font-weight: 400; }
.field-error { color: #ff8c9c; font-size: 13px; margin: 6px 0 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.form-note { color: var(--muted-2); font-size: 12.5px; margin-top: 12px; max-width: 60ch; }
.form-status { font-family: var(--mono); font-size: 13px; margin-top: 10px; min-height: 1.2em; }
.form-status.ok { color: var(--good); }
.form-status.err { color: #ff8c9c; }

/* search */
.search-ui { max-width: 640px; }
.search-ui input[type="search"] { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; padding: 13px 14px; font-size: 16px; }
.search-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.search-list li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; position: relative; }
.search-list li[hidden] { display: none; }
.search-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 90px 12px 15px; }
.search-list a:hover { color: var(--accent); }
.search-list .sr-title { font-weight: 600; }
.search-list .sr-sub { font-size: 13px; color: var(--muted); }
.search-list .sr-tag { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; text-transform: capitalize; }

/* header quick-search (visible on every page) */
.nav-search { display: flex; align-items: center; margin: 0 4px; }
.nav-search input[type="search"] { width: 168px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 13px; font-size: 13px; }
.nav-search input[type="search"]:focus { width: 210px; outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 860px) {
  .nav-search { width: 100%; margin: 4px 0 8px; }
  .nav-search input[type="search"] { width: 100%; }
  .nav-search input[type="search"]:focus { width: 100%; }
}

/* blog */
.post-list { display: grid; gap: 18px; max-width: 760px; }
.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.post-card h2 { margin: 0 0 6px; font-size: 20px; }
.post-card h2 a:hover { color: var(--accent); }
.post-meta { color: var(--muted-2); font-family: var(--mono); font-size: 12.5px; margin: 0 0 10px; }
.article .prose { font-size: 17px; }
.links-404 { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 18px 0; }
.links-404 a { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; }
.links-404 a:hover { border-color: var(--accent); color: var(--accent); }
.sitemap-group { margin: 22px 0; }
.sitemap-group ul { list-style: none; padding: 0; columns: 2; column-gap: 28px; }
.sitemap-group li { margin: 5px 0; break-inside: avoid; }
.sitemap-group a:hover { color: var(--accent); }
.consent-controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

/* footer (content site) */
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 40px 0 30px; color: var(--muted); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 26px; }
.foot-brand p { color: var(--muted); font-size: 13px; max-width: 32ch; margin: 10px 0 0; }
.foot-col h2 { font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 10px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin: 7px 0; }
.foot-col a { color: var(--muted); font-size: 13.5px; }
.foot-col a:hover { color: var(--text); }
.foot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 12.5px; }
.foot-legal .mono { font-family: var(--mono); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .sitemap-group ul { columns: 1; } }

/* consent banner */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80;
  max-width: 720px; margin: 0 auto;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: 13.5px; color: #c9d1e4; flex: 1 1 280px; }
.consent p a { color: var(--accent); text-decoration: underline; }
.consent-actions { display: flex; gap: 8px; }
.consent .btn { padding: 9px 16px; font-size: 13px; }

/* ---- random featured card (homepage hero) ---- */
.featured-card {
  margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px; align-items: stretch; max-width: 760px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.featured-host {
  position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden;
  background: #06080f; border: 1px solid var(--line); container-type: size;
}
.featured-meta { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.featured-eyebrow { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .04em; }
.featured-name { font-size: clamp(18px, 2.4vw, 24px); line-height: 1.15; }
.featured-tag { color: var(--muted); font-size: 14px; }
.featured-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.featured-actions .btn { padding: 8px 12px; font-size: 13px; }
.btn.icon { padding: 8px 10px; }
@media (max-width: 620px) { .featured-card { grid-template-columns: 1fr; } }

/* ---- shuffle: fade-through-black swap + now-playing label ---- */
.af-fs-host.af-fade { transition: opacity .36s ease; }
.af-fs-host.af-fade.dim { opacity: 0; }
.af-now {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%) translateY(8px);
  background: rgba(8,10,18,.72); color: #fff; border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 8px 18px; font-family: var(--sans); font-size: 16px; font-weight: 600;
  opacity: 0; transition: opacity .4s ease, transform .4s ease; pointer-events: none; z-index: 10000;
}
.af-now.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- wall (multi-view fullscreen grid) ---- */
/* grid-template-columns/rows are set inline per-instance by JS (any custom rows×cols
   grid, 1-16 by 2-16), so no fixed-count classes are needed here. */
.af-wall { display: grid; gap: 4px; background: #000; }
.af-cell { position: relative; overflow: hidden; background: #06080f; container-type: size; }

/* ---- mirror (smart-mirror fullscreen zone layout) ---- */
/* Named zones rather than a uniform grid: small corners, a large centre, and a
   full-width bottom strip — the smart-mirror convention. Empty zones simply
   have no child, and the grid collapses around them. */
.af-mirror {
  display: grid; background: #000;
  gap: clamp(8px, 2vw, 28px);
  padding: clamp(10px, 2.5vw, 34px);
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.9fr) minmax(0, 1fr) minmax(0, 0.7fr);
  grid-template-areas:
    "topLeft    topRight"
    "center     center"
    "bottomLeft bottomRight"
    "ticker     ticker";
}
.af-mzone { position: relative; overflow: hidden; container-type: size; min-width: 0; min-height: 0; }
/* The mono theme is carried by config (bg/accent) inside each saver's canvas;
   this only removes the panel chrome so the zones read as one black sheet. */
.af-mirror-mono .af-mzone { background: #000; }
@media (max-width: 700px) {
  .af-mirror {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topLeft"
      "topRight"
      "center"
      "bottomLeft"
      "bottomRight"
      "ticker";
    grid-template-rows: repeat(5, minmax(0, 1fr)) minmax(0, 0.7fr);
  }
}

/* ---- Play (screensaver mode) page ---- */
.play { max-width: 760px; }
.btn.big { font-size: 16px; padding: 14px 22px; }
.play-start { margin: 6px 0 22px; }
.play-start .muted { margin: 10px 0 0; font-size: 14px; }
.play-start kbd, .multi kbd { background: rgba(255,255,255,.08); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; font-family: var(--mono); font-size: 12px; }
.play-grid { display: grid; gap: 16px; }
.play-set { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; background: var(--panel); margin: 0; }
.play-set legend { padding: 0 8px; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.play-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.play-row input[type=range] { flex: 1; }
.play-row b { color: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pool-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; margin-top: 6px; }
.pool-cat { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.play-link { margin-top: 18px; }

/* ---- Multi-view builder page ---- */
.multi { max-width: 980px; }
.multi-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.multi-dims { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.multi-dims label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.multi-dims input[type=number] { width: 4.5em; padding: 6px 8px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--mono); font-size: 14px; }
/* grid-template-columns/rows are set inline per-instance by JS (any custom rows×cols
   grid, 1-16 by 2-16), so no fixed-count classes are needed here. */
.multi-preview { display: grid; gap: 10px; }
.multi-cell { display: flex; flex-direction: column; gap: 8px; }
.multi-host { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #06080f; border: 1px solid var(--line); container-type: size; }
.multi-select { flex: 1; min-width: 0; padding: 7px 9px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--sans); font-size: 13px; }
.multi-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.multi-presets .muted { font-size: 13px; }
.preset-btn { padding: 6px 12px; font-size: 13px; }
.multi-cellbar { display: flex; gap: 8px; align-items: center; }
.multi-gear { padding: 6px 9px; flex: 0 0 auto; }
.multi-settings { margin-top: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; background: var(--panel); }
.multi-settings .field { padding: 9px 0; }
.multi-settings .small { margin: 8px 0; font-size: 13px; }

/* ---- Mirror-mode builder page ---- */
.mirror { max-width: 980px; }
.mirror-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.mirror-opts { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.mirror-opts label { display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.mirror-preview {
  display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #06080f;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "topLeft    topRight"
    "center     center"
    "bottomLeft bottomRight"
    "ticker     ticker";
}
.mirror-zone { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mirror-zone-label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mirror-host { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line); container-type: size; }
.mirror-zone-center .mirror-host { aspect-ratio: 16 / 7; }
.mirror-zone-ticker .mirror-host { aspect-ratio: 16 / 3; }
.mirror-select { width: 100%; min-width: 0; padding: 7px 9px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; font-family: var(--sans); font-size: 13px; }
@media (max-width: 700px) {
  .mirror-preview { grid-template-columns: 1fr; grid-template-areas: "topLeft" "topRight" "center" "bottomLeft" "bottomRight" "ticker"; }
}


/* ================= catalogue: the dense index of every screensaver =========
   Replaces the card grid on the homepage. One line per saver so the whole
   catalogue is browsable: rows flow into as many columns as fit, which turns
   ~80,000px of cards into ~11,000px, and the filter bar usually turns that
   into one screen. The captured stills are still used — on hover, and on the
   category pages where big cards make sense. */
.catalog { margin: 34px 0 10px; }

.catalog-bar { margin-bottom: 14px; }
/* Only the search row follows you down. The chips are 22 categories and wrap
   to five rows on a narrow window — sticky, that permanently ate ~150px of
   every screen. They live at the top of the list instead and scroll away.
   top:64px clears the site header, which is itself sticky at z-index 40. */
.catalog-tools {
  position: sticky; top: 64px; z-index: 20;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 9px 0; margin-bottom: 2px;
}
.catalog-search {
  flex: 1 1 320px; min-width: 220px;
  background: #0d1119; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 14px; padding: 9px 12px;
}
.catalog-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.live-only { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.catalog-count { color: var(--muted-2); font-family: var(--mono); font-size: 12px; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip {
  background: #0d1119; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer;
}
.chip b { color: var(--muted-2); font-weight: 600; margin-left: 3px; }
.chip:hover { color: var(--text); border-color: var(--muted-2); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #06202a; }
.chip.is-on b { color: #06202a; opacity: .7; }

/* On a phone the 23 chips wrap to nine rows — 368px, half the screen, before
   a single saver is visible. One swipeable row instead. */
@media (max-width: 640px) {
  .catalog-bar .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding-bottom: 2px; -webkit-overflow-scrolling: touch;
  }
  .catalog-bar .chips::-webkit-scrollbar { display: none; }
  .catalog-bar .chip { flex: 0 0 auto; }
}

.cat-group { margin: 0 0 22px; }
.cat-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 15px; margin: 0 0 7px; padding-top: 4px; border-top: 1px solid var(--line); }
.cat-head a { font-weight: 650; }
.cat-n { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.cat-desc { color: var(--muted-2); font-size: 12px; font-weight: 400; }

/* The density trick: rows flow into however many columns fit. */
.cat-items { list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 0 18px; }
.row a {
  display: grid; grid-template-columns: 20px minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center; gap: 9px;
  padding: 4px 6px; border-radius: 5px; color: var(--text); text-decoration: none;
  font-size: 13px; line-height: 1.35;
}
.row a:hover, .row a:focus-visible { background: #121722; outline: none; }
.row a:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.row-ic { font-size: 14px; text-align: center; }
.row-nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-tg { color: var(--muted-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* justify-self matters: on a phone .row-tg is display:none, so the badge slides
   into the 1fr column and a grid item's default stretch made it a 200px-wide
   box with the word LIVE floating at one end. */
.row-live { justify-self: start;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  color: #8fd6a8; border: 1px solid rgba(143,214,168,.3); border-radius: 3px; padding: 0 4px; }
.catalog-empty { color: var(--muted); text-align: center; padding: 40px 0; font-family: var(--mono); }

/* .wrap is 1180px because that is a comfortable measure for reading
   paragraphs. The catalogue is not prose, it is an index, and on a wide screen
   the extra width buys a whole extra column — three go to four, and the page
   loses about a quarter of its height. Break out of the wrap with negative
   margins rather than a transform: a transform here would become the
   containing block for #shotPeek's position:fixed. */
@media (min-width: 1280px) {
  .catalog { margin-inline: calc((min(1560px, 94vw) - 100%) / -2); }
}

/* Hover preview — the captured still, fetched only when actually wanted, so
   the 11 MB of thumbnails costs nothing on load. */
#shotPeek {
  position: fixed; z-index: 60; pointer-events: none; width: 360px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #05070d; box-shadow: 0 18px 50px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .12s; display: none;
}
#shotPeek.is-on { opacity: 1; display: block; }
#shotPeek img { display: block; width: 100%; height: auto; background: #05070d; }
#shotPeek .peek-cap { padding: 7px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
@media (hover: none) { #shotPeek { display: none !important; } }

@media (max-width: 640px) {
  .cat-items { grid-template-columns: 1fr; }
  .row-tg { display: none; }
  .catalog-bar { padding-top: 8px; }
}
