/* GhostFix — site styles
   Tokens first (light is the base; dark redefines tokens only). */
:root {
  --ground: #F2F5F1;
  --ground-2: #E8EDE7;
  --ground-3: #DCE3DB;
  --ink: #0F140F;
  --ink-2: #4E584F;
  --ink-3: #626F63;
  --line: rgba(15, 20, 15, 0.14);
  --green: #00D200;
  --green-ink: #087208;
  --green-contrast: #FFFFFF;
  --band-green: #00D200;
  --green-soft: rgba(0, 210, 0, 0.16);
  --sun: #FFE3A3;
  --panel: #FFFFFF;
  --bezel: #111511;
  --shadow: 0 30px 60px -28px rgba(15, 20, 15, 0.45);
  --radius: 22px;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0B0E0B;
    --ground-2: #131813;
    --ground-3: #1B211B;
    --ink: #F1F4F0;
    --ink-2: #AAB4AB;
    --ink-3: #77827A;
    --line: rgba(241, 244, 240, 0.14);
    --green-ink: #3FE23F;
    --green-contrast: #0B0E0B;
    --band-green: #126D12;
    --green-soft: rgba(0, 210, 0, 0.18);
    --sun: #3B2E0F;
    --panel: #161B16;
    --bezel: #2A302A;
    --shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0B0E0B;
  --ground-2: #131813;
  --ground-3: #1B211B;
  --ink: #F1F4F0;
  --ink-2: #AAB4AB;
  --ink-3: #77827A;
  --line: rgba(241, 244, 240, 0.14);
  --green-ink: #3FE23F;
  --green-contrast: #0B0E0B;
  --band-green: #126D12;
  --green-soft: rgba(0, 210, 0, 0.18);
  --sun: #3B2E0F;
  --panel: #161B16;
  --bezel: #2A302A;
  --shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.85);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  padding-inline: clamp(16px, 4vw, 40px);
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
picture { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- atmosphere ---- */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 85% -10%, var(--sun) 0%, transparent 70%),
    radial-gradient(40% 30% at 10% 110%, var(--green-soft) 0%, transparent 70%);
}

/* ---- shell ---- */
.wrap { max-width: var(--max); margin-inline: auto; }
.nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding-block: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; }
.brand-mark { flex-shrink: 0; }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.theme-toggle {
  display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px;
  padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--ink); background: var(--ground-2); border-color: var(--ink-3); }
.theme-toggle:focus-visible { border-radius: 50%; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .theme-sun { display: none; }
.theme-toggle[data-current-theme="dark"] .theme-sun { display: block; }
.theme-toggle[data-current-theme="dark"] .theme-moon { display: none; }
.nav nav { display: flex; gap: 26px; }
.nav nav a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.nav nav a:hover { color: var(--ink); }
@media (max-width: 860px) { .nav nav { display: none; } }

.eyebrow { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green-ink); }
.eyebrow::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 10px; vertical-align: 1px; box-shadow: 0 0 10px var(--green); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 16px; line-height: 1; border: 1.5px solid transparent;
  transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--ground); }
.btn-primary:hover { background: var(--green-ink); color: var(--green-contrast); }
.btn-primary svg { width: 18px; height: 18px; }
.btn-primary small { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; margin-left: 2px; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { padding: 10px 16px; font-size: 14px; }

/* ---- hero ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px);
  align-items: center; padding-block: clamp(24px, 5vw, 64px) clamp(40px, 7vw, 96px);
}
.hero h1 { font-size: clamp(42px, 6.2vw, 78px); letter-spacing: -0.02em; margin-top: 18px; }
.ghost-dot {
  display: inline-block; width: .3em; height: .3em; border-radius: 50%; margin-left: .12em;
  background: var(--green); box-shadow: 0 0 .35em var(--green), 0 0 .9em rgba(0,210,0,.6);
  vertical-align: .02em; animation: zap 1s cubic-bezier(.6, 0, .2, 1) 2.2s forwards;
}
@keyframes zap { 0% { transform: scale(1); opacity: 1; } 60% { transform: scale(1.5); opacity: .8; } 100% { transform: scale(0); opacity: 0; } }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); margin-top: 22px; max-width: 46ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-copy > * { animation: rise .7s ease both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

/* ---- comparison slider ---- */
.compare { margin: 0; }
.compare-frame {
  --pos: 50%;
  position: relative; aspect-ratio: var(--ratio, 3 / 2); border-radius: var(--radius); overflow: hidden;
  background: var(--ground-3); box-shadow: var(--shadow); user-select: none; -webkit-user-select: none;
  max-width: 100%;
}
.compare-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-after { clip-path: inset(0 0 0 var(--pos)); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0; pointer-events: none; }
.compare-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,.55); }
.compare-handle span {
  position: absolute; top: 50%; left: 0; translate: -50% -50%;
  width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #0F140F;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.compare-handle svg { width: 20px; height: 20px; }
.compare-label {
  position: absolute; top: 14px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: rgba(0,0,0,.55); padding: 6px 10px; border-radius: 999px; pointer-events: none; backdrop-filter: blur(6px);
}
.compare-label-before { left: 14px; }
.compare-label-after { right: 14px; }
.compare-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
  -webkit-appearance: none; appearance: none; touch-action: pan-y;
}
.compare-frame:has(.compare-range:focus-visible) { outline: 3px solid var(--green); outline-offset: 4px; }
.compare figcaption { margin-top: 12px; font-size: 14px; color: var(--ink-3); }

/* ---- mascot: the hand-drawn ghost (art from tools/character) ---- */
.mascot { height: auto; pointer-events: none; user-select: none; -webkit-user-select: none; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.compare-stage { position: relative; }
.mascot-hero {
  position: absolute; left: -30px; bottom: 4%; width: clamp(92px, 19%, 168px);
  filter: drop-shadow(0 10px 14px rgba(15, 20, 15, .28)); animation: bob 3.4s ease-in-out infinite;
}
@media (max-width: 860px) { .mascot-hero { left: -10px; } }

/* ---- sections ---- */
.section { padding-block: clamp(48px, 8vw, 110px); border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(30px, 3.8vw, 48px); letter-spacing: -0.02em; }
.section-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 48px; align-items: end; margin-bottom: clamp(28px, 4vw, 56px); }
.section-head p { color: var(--ink-2); font-size: 18px; max-width: 48ch; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

/* explainer */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.facts article { border-top: 2px solid var(--ink); padding-top: 18px; }
.facts h3 { font-size: 24px; margin-bottom: 10px; }
.facts p { color: var(--ink-2); }
.facts .glyph { width: 44px; height: 44px; margin-bottom: 18px; }
@media (max-width: 720px) { .facts { grid-template-columns: 1fr; gap: 24px; } }

/* steps with phones */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); align-items: start; }
.step:nth-child(2) { margin-top: clamp(0px, 4vw, 56px); }
.phone {
  margin: 0; border-radius: 40px; background: var(--bezel); padding: 9px; box-shadow: var(--shadow);
  aspect-ratio: 1320 / 2868; max-width: 100%;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 32px; background: #000; }
/* The ghost peeks over the "Zap it" phone: body behind the frame, hands and wand in front.
   64.37% is where the phone's top edge falls in the peek art (printed by tools/character/export.js). */
.phone-peek { position: relative; }
.phone .peek { position: absolute; top: 0; left: 46%; width: 50%; height: auto; translate: 0 -64.37%; border-radius: 0; background: none; pointer-events: none; }
.phone .peek-back { z-index: -1; }
.phone .peek-front { z-index: 1; }
.step:has(.phone-peek) { padding-top: 60px; }
.step-text { margin-top: 22px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; }
.step-num { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; color: var(--green-ink); }
.step h3 { font-size: 22px; }
.step p { grid-column: 2; color: var(--ink-2); }
.aside-note { margin-top: 40px; padding: 18px 22px; border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 0 14px 14px 0; max-width: 62ch; display: flex; align-items: center; gap: 16px; }
.aside-note .mascot { width: 72px; flex-shrink: 0; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } .step:nth-child(2) { margin-top: 0; } .phone { max-width: 300px; margin-inline: auto; } .step:has(.phone-peek) { padding-top: 110px; } }

/* free band */
.band { position: relative; background: var(--ink); color: var(--ground); border-radius: var(--radius); padding: clamp(36px, 6vw, 72px) clamp(24px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: center; }
.band h2 { font-size: clamp(48px, 8vw, 112px); line-height: .92; letter-spacing: -0.03em; }
.band h2 em { font-style: italic; color: var(--band-green); }
.band dl { margin: 0; display: grid; gap: 22px; }
.band dt { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--band-green); margin-bottom: 4px; }
.band dd { margin: 0; font-size: 18px; opacity: .9; }
/* Peeks over the band's top edge from behind it (negative z-index sits under the band's background). */
.band-mascot { position: absolute; z-index: -1; right: clamp(24px, 6vw, 72px); top: 0; translate: 0 -74%; width: clamp(96px, 12vw, 140px); animation: bob 3s ease-in-out .4s infinite; }
@media (max-width: 860px) { .band { grid-template-columns: 1fr; } }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pair { position: relative; border: 0; padding: 0; border-radius: 16px; overflow: hidden; background: var(--ground-3); cursor: pointer; aspect-ratio: 4 / 3; box-shadow: var(--shadow); max-width: 100%; }
.pair img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease; }
.pair .after { opacity: 0; }
.pair:hover .after, .pair[aria-pressed="true"] .after { opacity: 1; }
.pair .tag { position: absolute; left: 12px; bottom: 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); padding: 6px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.pair .tag::after { content: "Original"; }
.pair:hover .tag::after, .pair[aria-pressed="true"] .tag::after { content: "Zapped"; }
.gallery-hint { margin-top: 14px; font-size: 14px; color: var(--ink-3); display: flex; align-items: center; gap: 14px; }
.gallery-hint .mascot { width: clamp(96px, 11vw, 130px); flex-shrink: 0; animation: bob 3.6s ease-in-out .2s infinite; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr; } }

/* faq */
.faq-mascot { justify-self: end; width: clamp(84px, 9vw, 116px); margin-bottom: -8px; animation: bob 3.2s ease-in-out 1s infinite; }
@media (max-width: 860px) { .faq-mascot { width: 76px; margin-top: -92px; margin-bottom: 0; } }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; margin: 0; }
.faq div { border-top: 1px solid var(--line); padding-top: 18px; }
.faq dt { font-weight: 600; font-size: 19px; margin-bottom: 8px; }
.faq dd { margin: 0; color: var(--ink-2); }
@media (max-width: 720px) { .faq { grid-template-columns: 1fr; gap: 22px; } }

/* download */
.download { text-align: center; display: grid; justify-items: center; gap: 18px; }
.download .meta { font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
/* Logo and wordmark from the launch film's end card. */
.endmark { position: relative; display: grid; justify-items: center; gap: 8px; padding: 8px 56px 10px; }
.endmark-logo { width: clamp(112px, 14vw, 160px); height: auto; aspect-ratio: 1; overflow: visible; filter: drop-shadow(0 0 26px rgba(0, 210, 0, .35)); animation: bob 3.4s ease-in-out infinite; }
/* Every 6 s the right eye closes into an arc for a beat, with a sparkle. */
.endmark-logo .wink-open { transform-box: fill-box; transform-origin: center; animation: wink-open 6s ease-in-out 2s infinite; }
.endmark-logo .wink-shut { opacity: 0; animation: wink-shut 6s ease-in-out 2s infinite; }
.endmark-logo .wink-star { opacity: 0; transform-box: fill-box; transform-origin: center; animation: wink-star 6s ease-out 2s infinite; }
@keyframes wink-open { 0%, 86%, 96%, 100% { transform: scaleY(1); } 88.5%, 93.5% { transform: scaleY(.04); } }
@keyframes wink-shut { 0%, 87.5%, 94.5%, 100% { opacity: 0; } 88.5%, 93.5% { opacity: 1; } }
@keyframes wink-star { 0%, 87.5%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); } 90% { opacity: 1; transform: scale(1.15) rotate(20deg); } 96% { opacity: 0; transform: scale(.6) rotate(45deg); } }
.endmark-word { font-family: var(--font-body); font-weight: 600; font-size: clamp(44px, 6vw, 72px); letter-spacing: -0.035em; line-height: 1; }
.endmark-stars i {
  position: absolute; width: 14px; aspect-ratio: 1; background: var(--green);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 2.6s ease-in-out infinite;
}
.endmark-stars i:nth-child(3n) { background: var(--ink-3); width: 10px; }
.endmark-stars i:nth-child(1) { left: 14%; top: 4%; }
.endmark-stars i:nth-child(2) { left: 2%; top: 30%; animation-delay: .6s; }
.endmark-stars i:nth-child(3) { left: 18%; top: 52%; animation-delay: 1.2s; }
.endmark-stars i:nth-child(4) { right: 12%; top: 8%; animation-delay: 1.8s; }
.endmark-stars i:nth-child(5) { right: 1%; top: 38%; animation-delay: .3s; }
.endmark-stars i:nth-child(6) { right: 17%; top: 56%; animation-delay: 1.5s; }
@keyframes twinkle { 0%, 100% { transform: scale(.55); opacity: .5; } 50% { transform: scale(1.1); opacity: 1; } }

/* footer */
.footer { border-top: 1px solid var(--line); padding-block: 28px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; color: var(--ink-3); font-size: 14px; }
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; color: var(--ink-2); }
.footer a:hover { color: var(--ink); }

/* ---- prose pages (privacy, support) ---- */
.prose { max-width: 68ch; padding-block: clamp(24px, 4vw, 56px) clamp(56px, 8vw, 110px); }
.prose h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.02em; margin-bottom: 10px; }
.prose .updated { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); letter-spacing: .04em; margin-bottom: 36px; }
.prose h2 { font-size: 26px; margin-top: 40px; margin-bottom: 10px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; margin: 10px 0 0; display: grid; gap: 6px; }
.prose .summary { background: var(--green-soft); border-left: 3px solid var(--green); border-radius: 0 14px 14px 0; padding: 18px 22px; color: var(--ink); font-size: 18px; }
.prose a { color: var(--green-ink); }
.prose .steps-list { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.prose .steps-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline; }
.prose .steps-list li::before { counter-increment: s; content: counter(s); font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--green-ink); line-height: 1; }
