/* =====================================================================
   ghostbuster.dev — shared pixel theme
   Layout + type live here. Colour lives in the .theme-* palettes below,
   so the three landing pages differ ONLY in their scheme.
   Built to match cirrusloft.com: Press Start 2P + VT323, SVG pixel art,
   hard drop-shadows, crisp edges, prefers-reduced-motion honoured.
   ===================================================================== */

/* ---------- palette: PHOSPHOR (near-black + green/cyan phosphor, magenta reveal) ---------- */
:root {
  --bg-1: #05060a;
  --bg-2: #0a0d14;
  --panel: #0e1420;
  --panel-2: #121a29;
  --ink: #d6ffe4;
  --ink-soft: #6fbf90;
  --phosphor: #39ff8b;      /* primary text/UI */
  --phosphor-dim: #1f7f4d;
  --secondary: #35e0e8;     /* cyan */
  --accent: #ff2fb9;        /* hot magenta, the reveal */
  --accent-2: #ff67cf;
  --warn: #ffb000;          /* amber warnings / defunct */
  --grid: rgba(57, 255, 139, 0.06);
  --scan: rgba(0, 0, 0, 0.28);
  --glow: rgba(57, 255, 139, 0.35);
  --accent-glow: rgba(255, 47, 185, 0.55);
  --cloak: #14324a;
  --cloak-hi: #1d4a6b;
  --mask: #e9f7ff;
  --mask-sh: #9fb8c9;
  --true-skin: #6bd66b;
  --true-skin-sh: #3f9c3f;
}

/* ---------- reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-1); }

body {
  font-family: 'VT323', monospace;
  color: var(--ink);
  background: var(--bg-1);
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg-1) 60%) fixed;
  overflow-x: hidden;
  min-height: 100svh;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

/* faint pixel grid floor + starfield behind everything */
.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  mask-image: linear-gradient(to bottom, transparent 40%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 40%, #000 100%);
}
.stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 2px; height: 2px; background: transparent;
  box-shadow:
    8vw 12vh 0 var(--ink-soft), 22vw 8vh 0 var(--secondary), 35vw 20vh 0 var(--ink-soft),
    48vw 6vh 0 var(--secondary), 61vw 15vh 0 var(--ink-soft), 74vw 10vh 0 var(--secondary),
    88vw 18vh 0 var(--ink-soft), 15vw 26vh 0 var(--secondary), 55vw 28vh 0 var(--ink-soft),
    81vw 24vh 0 var(--secondary), 30vw 30vh 0 var(--ink-soft), 68vw 4vh 0 var(--secondary),
    93vw 32vh 0 var(--ink-soft), 5vw 22vh 0 var(--secondary);
  opacity: .5;
  animation: twinkle 4s steps(1, end) infinite;
}
@keyframes twinkle { 0%,100% { opacity: .5; } 50% { opacity: .2; } }

/* ---------- CRT overlay: scanlines + vignette + flicker ---------- */
.crt {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
}
.crt::before {   /* scanlines */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent 2px, var(--scan) 3px, var(--scan) 3px);
  opacity: .55;
}
.crt::after {    /* vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%);
}
.crt { animation: crtFlicker 6s steps(1,end) infinite; }
@keyframes crtFlicker { 0%,96%,100% { opacity: 1; } 97% { opacity: .93; } 98% { opacity: .98; } }

/* ---------- layout ---------- */
.page {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: 1.6rem 1.25rem 5.5rem;
}

.topbar {
  width: 100%; max-width: 60rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: clamp(1.5rem, 6vh, 4rem);
}
.wordmark {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(.72rem, 2.4vw, 1rem);
  color: var(--phosphor);
  text-shadow: 0 0 12px var(--glow), 2px 2px 0 rgba(0,0,0,.6);
  letter-spacing: .02em; line-height: 1.5;
  text-decoration: none; display: inline-block;
}
a.wordmark { cursor: pointer; transition: transform .08s steps(2, end); }
a.wordmark:hover { color: var(--ink); text-shadow: 0 0 16px var(--glow), 2px 2px 0 rgba(0,0,0,.6); }
a.wordmark:active { transform: translate(1px, 1px); }
.wordmark .dev { color: var(--accent); text-shadow: 0 0 12px var(--accent-glow), 2px 2px 0 rgba(0,0,0,.6); }
.nav { display: flex; gap: 1.1rem; font-size: 1.25rem; }
.nav a { color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); border-color: var(--accent); }

/* hero */
.hero {
  width: 100%; max-width: 40rem;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 1.5rem; margin-top: 1vh;
}

/* the stage that holds the pixel figure + reveal */
.stage {
  width: min(320px, 78vw);
  aspect-ratio: 1 / 1;
  position: relative;
}
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.figure-scene { animation: bob 7s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.tagline {
  font-size: clamp(1.35rem, 4.2vw, 1.9rem);
  color: var(--ink);
  line-height: 1.3; max-width: 30rem;
}
.tagline b { color: var(--phosphor); text-shadow: 0 0 10px var(--glow); }

/* ---------- search ---------- */
.searchwrap { width: 100%; max-width: 30rem; }
.searchbar {
  display: flex; align-items: center; gap: .5rem;
  background: var(--panel);
  border: 2px solid var(--phosphor-dim);
  box-shadow: 4px 4px 0 rgba(0,0,0,.5), inset 0 0 24px rgba(0,0,0,.4);
  padding: .5rem .7rem;
}
.searchbar:focus-within { border-color: var(--phosphor); box-shadow: 4px 4px 0 rgba(0,0,0,.5), 0 0 18px var(--glow); }
.prompt-glyph { color: var(--phosphor); font-size: 1.5rem; line-height: 1; user-select: none; }
.searchbar input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--ink); font-family: 'VT323', monospace; font-size: 1.6rem;
  caret-color: var(--accent);
}
.searchbar input::placeholder { color: var(--ink-soft); opacity: .7; }
.go-btn {
  font-family: 'Press Start 2P', monospace; font-size: .7rem;
  background: var(--phosphor); color: var(--bg-1);
  border: 0; padding: .55rem .7rem; cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,.5);
}
.go-btn:hover { background: var(--accent); color: #fff; }
.go-btn:active { transform: translate(2px,2px); box-shadow: none; }

.examples { margin-top: .7rem; font-size: 1.2rem; color: var(--ink-soft); }
.examples button {
  background: transparent; border: 0; cursor: pointer;
  color: var(--secondary); font-family: 'VT323', monospace; font-size: 1.2rem;
  border-bottom: 1px dotted var(--secondary); padding: 0 .1rem; margin: 0 .15rem;
}
.examples button:hover { color: var(--ink); }

/* ---------- result card ---------- */
.result { width: 100%; max-width: 34rem; margin-top: .5rem; }
.card {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: 6px 6px 0 rgba(0,0,0,.55), 0 0 26px var(--accent-glow);
  padding: 1.3rem 1.25rem 1.4rem;
  text-align: left;
}
.card.miss { border-color: var(--phosphor-dim); box-shadow: 6px 6px 0 rgba(0,0,0,.55); }

.verdict {
  font-family: 'Press Start 2P', monospace; font-size: .72rem; line-height: 1.6;
  color: var(--accent); text-shadow: 0 0 10px var(--accent-glow);
  margin-bottom: .9rem;
}
.card.miss .verdict { color: var(--phosphor); text-shadow: 0 0 8px var(--glow); }

.unmask-line { font-size: 1.55rem; line-height: 1.35; margin-bottom: .3rem; }
.brand-name { color: var(--ink); }
.arrow { color: var(--ink-soft); margin: 0 .4rem; }
.parent-name {
  font-family: 'Press Start 2P', monospace; font-size: .95rem;
  color: var(--accent); text-shadow: 0 0 12px var(--accent-glow);
  display: inline-block; line-height: 1.5;
}
.type-caret {
  display: inline-block; width: .5em; height: 1em; background: var(--accent);
  margin-left: .1em; vertical-align: -0.12em; animation: blink 1s steps(1,end) infinite;
}
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } }

.parent-note { font-size: 1.3rem; color: var(--ink-soft); margin-top: .5rem; }
.meta { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: 1.2rem; color: var(--ink-soft); }
.meta .tag {
  border: 1px solid var(--phosphor-dim); padding: .05rem .5rem; color: var(--secondary);
}
.defunct {
  margin-top: .9rem; padding: .5rem .7rem; font-size: 1.25rem;
  color: var(--warn); border: 1px dashed var(--warn); background: rgba(0,0,0,.25);
}
.source { margin-top: .9rem; font-size: 1.2rem; color: var(--ink-soft); }
.source a { color: var(--secondary); }
.punchline {
  margin-top: 1rem; font-size: 1.4rem; color: var(--accent-2); font-style: italic;
  border-top: 1px solid var(--phosphor-dim); padding-top: .7rem;
}

/* not-found / report */
.miss p { font-size: 1.4rem; line-height: 1.4; color: var(--ink); }
.miss .sub { color: var(--ink-soft); font-size: 1.25rem; margin-top: .4rem; }
.report-toggle {
  margin-top: 1rem; font-family: 'Press Start 2P', monospace; font-size: .68rem;
  background: transparent; color: var(--phosphor); border: 2px solid var(--phosphor);
  padding: .55rem .7rem; cursor: pointer; box-shadow: 3px 3px 0 rgba(0,0,0,.5);
}
.report-toggle:hover { background: var(--phosphor); color: var(--bg-1); }

.report-form { margin-top: 1rem; display: grid; gap: .6rem; }
.report-form label { font-size: 1.15rem; color: var(--ink-soft); display: grid; gap: .2rem; }
.report-form input, .report-form textarea {
  background: var(--panel-2); border: 2px solid var(--phosphor-dim);
  color: var(--ink); font-family: 'VT323', monospace; font-size: 1.35rem;
  padding: .4rem .55rem; outline: 0;
}
.report-form input:focus, .report-form textarea:focus { border-color: var(--phosphor); }
.report-form .row { display: flex; gap: .6rem; }
.report-form .row > label { flex: 1; }
.report-note { font-size: 1.1rem; color: var(--ink-soft); }

/* buttons row */
.btnrow { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .3rem; }
.btn {
  font-family: 'Press Start 2P', monospace; font-size: .68rem;
  padding: .55rem .7rem; cursor: pointer; box-shadow: 3px 3px 0 rgba(0,0,0,.5);
  border: 2px solid var(--phosphor); background: var(--phosphor); color: var(--bg-1);
}
.btn.ghost { background: transparent; color: var(--phosphor); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:active { transform: translate(2px,2px); box-shadow: none; }

/* ---------- footer ---------- */
footer {
  position: relative; z-index: 1; margin-top: auto;
  width: 100%; max-width: 60rem; padding-top: 2.5rem;
  display: flex; flex-direction: column; align-items: center;
  gap: .9rem; font-size: 1.2rem; color: var(--ink-soft); text-align: center;
}
.foot-copy { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem 1rem; }
.foot-email { font-size: .95em; cursor: pointer; }
.foot-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .5rem 1.3rem;
}
footer a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--accent); }
footer a:hover { background: var(--accent); color: var(--bg-1); border-color: var(--accent); }

/* ---------- the mask-reveal figure ---------- */
/* mask layer lifts up + away; hand rises with it; true face fades in underneath */
.mask-group { transform-box: fill-box; transform-origin: 50% 100%; }
.true-face, .hand, .stink { opacity: 0; }

.stage.revealing .mask-group { animation: liftMask 1.1s steps(5, end) forwards; }
.stage.revealing .hand { animation: handRise 1.1s steps(5, end) forwards; }
.stage.revealing .true-face { animation: fadeInFace .3s steps(2,end) .75s forwards; }
.stage.revealing .stink { animation: stink 1.2s steps(4,end) .8s forwards; }
.stage.revealing .figure-scene { animation: shake .3s steps(2,end) 2, bob 7s ease-in-out infinite .6s; }

@keyframes liftMask {
  0%   { transform: translateY(0)    rotate(0deg);   opacity: 1; }
  60%  { transform: translateY(-46%) rotate(-8deg);  opacity: 1; }
  100% { transform: translateY(-135%) rotate(-20deg); opacity: 0; }
}
@keyframes handRise {
  0%   { transform: translateY(30%); opacity: 0; }
  20%  { transform: translateY(0);   opacity: 1; }
  60%  { transform: translateY(-46%); opacity: 1; }
  100% { transform: translateY(-135%); opacity: 0; }
}
@keyframes fadeInFace { to { opacity: 1; } }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@keyframes stink {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-30%); }
}

/* revealed static end-state (also the reduced-motion target) */
.stage.revealed .mask-group { opacity: 0; transform: translateY(-135%) rotate(-20deg); }
.stage.revealed .true-face { opacity: 1; }
.stage.revealed .hand { opacity: 0; }

/* entrance for cards */
.pop { animation: pop .28s steps(3, end); }
@keyframes pop { 0% { transform: translateY(10px) scale(.98); opacity: 0; } 100% { transform: none; opacity: 1; } }

.hidden { display: none !important; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .figure-scene, .stars, .crt, .type-caret, .card { animation: none !important; }
  .stage.revealing .mask-group,
  .stage.revealing .hand,
  .stage.revealing .true-face,
  .stage.revealing .stink,
  .stage.revealing .figure-scene { animation: none !important; }
  .stage.revealing .mask-group { opacity: 0; transform: translateY(-135%) rotate(-20deg); }
  .stage.revealing .true-face { opacity: 1; }
}

/* ---------- prerendered brand pages (generated by build_site.py) ---------- */
.brandpage {
  width: 100%; max-width: 42rem; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1.3rem; padding-bottom: 2rem;
}
.brandpage .poster {
  width: 100%; height: auto; display: block;
  border: 2px solid var(--phosphor-dim); box-shadow: 6px 6px 0 rgba(0,0,0,.55);
}
.brandpage .card { text-align: left; }
.brandpage h1.unmask-line { font-weight: normal; margin: 0 0 .3rem; }
.brandpage .answer {
  margin-top: 1rem; font-size: 1.4rem; line-height: 1.45; color: var(--ink);
  border-top: 1px solid var(--phosphor-dim); padding-top: .8rem;
}
.brandpage .btn { text-decoration: none; display: inline-block; }
.related { border-top: 2px solid var(--phosphor-dim); padding-top: 1rem; }
.related h2 {
  font-family: 'Press Start 2P', monospace; font-size: .72rem; line-height: 1.6;
  color: var(--secondary); margin-bottom: .8rem;
}
.related ul { list-style: none; display: grid; gap: .5rem; }
.related a { color: var(--ink); text-decoration: none; font-size: 1.35rem;
  border-bottom: 1px dotted var(--phosphor-dim); padding-bottom: .3rem; display: block; }
.related a:hover { color: var(--phosphor); }
.related .rel-op { color: var(--ink-soft); }

/* ---------- Rogues' Gallery hub ---------- */
.gallery { width: 100%; max-width: 60rem; margin: 0 auto; padding-bottom: 2rem; }
.gallery h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 4vw, 1.5rem); line-height: 1.6; color: var(--phosphor);
  text-shadow: 0 0 12px var(--glow), 2px 2px 0 rgba(0,0,0,.6); margin-bottom: 1rem;
}
.gallery-intro { font-size: 1.4rem; line-height: 1.45; color: var(--ink-soft);
  max-width: 40rem; margin-bottom: 1.6rem; }
.gallery-grid {
  list-style: none; display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.gallery-grid a {
  display: flex; flex-direction: column; gap: .25rem; height: 100%;
  background: var(--panel); border: 2px solid var(--phosphor-dim);
  box-shadow: 4px 4px 0 rgba(0,0,0,.5); padding: .8rem .9rem; text-decoration: none;
}
.gallery-grid a:hover { border-color: var(--accent); box-shadow: 4px 4px 0 rgba(0,0,0,.5), 0 0 16px var(--accent-glow); }
.gallery-grid .g-brand { color: var(--ink); font-size: 1.45rem; line-height: 1.2; }
.gallery-grid .g-op { color: var(--accent); font-size: 1.2rem; }
.gallery-grid .g-retired { color: var(--warn); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  .topbar { flex-direction: column; gap: .6rem; text-align: center; }
  .parent-name { font-size: .8rem; }
  .verdict { font-size: .62rem; }
}
