/* ==========================================================================
   Instagroan — instagroan.app
   One stylesheet for every page. Palette, radii, spacing and type mirror the
   app's design tokens (App/lib/core/design/tokens.dart + theme.dart).
   Light = "newsprint", dark = "ink-violet" (never blue). Lime is the "groan
   spark" accent — never used as text on light surfaces.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Brand */
  --grape: #5B3BA5;
  --grape-deep: #3E2775;
  --lilac: #C9B8F2;
  --lime: #B7E241;
  --lime-ink: #2A3407;

  /* Light scheme (GroanTheme.light) */
  --bg: #FAF8F4;
  --bg-high: #F1EDE5;
  --bg-highest: #E8E2D6;
  --ink: #1E1A26;
  --ink-muted: #5C5568;
  --primary: #5B3BA5;
  --on-primary: #FFFFFF;
  --primary-container: #E9E0FA;
  --on-primary-container: #3E2775;
  --secondary-container: #E4F2B8;
  --on-secondary-container: #2A3407;
  --tertiary-container: #FFD9E1;
  --error-container: #FFDAD6;
  --outline: #8B8496;
  --line: rgba(139, 132, 150, 0.28);
  --accent: #B7E241;
  --on-accent: #2A3407;
  --shadow: 0 12px 32px rgba(30, 26, 38, 0.10);
  --shadow-sm: 0 4px 14px rgba(30, 26, 38, 0.08);
  --bezel: #17131F;
  --blob-a: rgba(201, 184, 242, 0.55);
  --blob-b: rgba(183, 226, 65, 0.40);

  /* Radii (GroanRadius) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* 4px grid (GroanSpacing) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;

  /* Type: Kalam Bold stands in for ITC Bradley Hand (the iOS display face);
     Inter for body/UI. Every family has a real local fallback. */
  --font-display: 'Kalam', 'Bradley Hand', 'Segoe Print', 'Noteworthy', 'Comic Sans MS', cursive;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-meme: Impact, 'Anton', 'Arial Black', 'Helvetica Neue', Arial, sans-serif;

  /* Motion (GroanDurations / GroanCurves) — the "eye-roll ease" overshoots */
  --dur-tap: 120ms;
  --dur-reveal: 240ms;
  --dur-page: 320ms;
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);

  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark scheme (GroanTheme.dark) */
    --bg: #171320;
    --bg-high: #211B2E;
    --bg-highest: #2B2440;
    --ink: #EDE9F5;
    --ink-muted: #A79FBB;
    --primary: #C9B8F2;
    --on-primary: #3E2775;
    --primary-container: #473567;
    --on-primary-container: #E9E0FA;
    --secondary-container: #45521B;
    --on-secondary-container: #E4F2B8;
    --tertiary-container: #643B46;
    --error-container: #93000A;
    --outline: #7A7290;
    --line: rgba(122, 114, 144, 0.32);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
    --bezel: #0B0910;
    --blob-a: rgba(91, 59, 165, 0.45);
    --blob-b: rgba(183, 226, 65, 0.16);
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 8vw, 5.25rem); line-height: 1.02; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.25rem); }
h3 { font-size: clamp(1.5rem, 2.6vw, 1.85rem); }
h4 { font-size: 1.35rem; }

p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.3rem; }
li { margin: var(--s-1) 0; }
strong { font-weight: 600; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

@media (min-width: 640px) { .wrap { padding: 0 var(--s-6); } }
@media (min-width: 1024px) { .wrap { padding: 0 var(--s-8); } }

.section { padding: var(--s-16) 0; }
@media (min-width: 900px) { .section { padding: var(--s-24) 0; } }

.section-head { max-width: 680px; margin-bottom: var(--s-8); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { font-size: 1.125rem; color: var(--ink-muted); }
.section-head h2 { margin-bottom: var(--s-3); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-3);
}

.muted { color: var(--ink-muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s-4); top: -100px;
  background: var(--primary); color: var(--on-primary);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-md);
  z-index: 100; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: var(--s-4); }

/* --------------------------------------------------------------------------
   Buttons, badges, chips
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-6);
  border-radius: var(--r-lg);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--dur-tap) var(--ease-out), background var(--dur-tap) linear;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--grape-deep); }
@media (prefers-color-scheme: dark) { .btn-primary:hover { background: #DCCFF7; } }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-container); }

.tag {
  display: inline-block; padding: 2px var(--s-2);
  border-radius: var(--r-pill);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--secondary-container); color: var(--on-secondary-container);
  vertical-align: middle;
}
.tag-plus { background: var(--primary-container); color: var(--on-primary-container); }
.tag-pro { background: var(--accent); color: var(--on-accent); }

.store-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.store-badge { display: inline-block; border-radius: 7px; line-height: 0; }
.store-badge img { display: block; width: auto; }
.store-badge-apple img { height: 46px; }
.store-badge-google img { height: 56px; }  /* Google's artwork has built-in padding; sized to match Apple's */
.store-badge:focus-visible { outline-offset: 4px; }

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */
.site-header {
  position: relative; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) { .site-header { position: sticky; top: 0; } }

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 68px;
}

.brand {
  display: inline-flex; align-items: center; gap: var(--s-2);
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1;
}
.brand img { width: 36px; height: 36px; }

.site-nav { display: none; align-items: center; gap: var(--s-6); }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: var(--primary); text-decoration: underline; }
@media (min-width: 900px) { .site-nav { display: flex; } }

.header-cta { min-height: 40px; padding: 0 var(--s-4); font-size: 0.9rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s-12) 0 var(--s-8);
  color: var(--ink-muted); font-size: 0.9rem;
}
.footer-grid { display: grid; gap: var(--s-6); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr auto; align-items: start; } }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: 0 0 var(--s-3); padding: 0; list-style: none; }
.footer-links a { color: var(--ink); }
.footer-note { margin: 0; }
.footer-brand { display: flex; align-items: center; gap: var(--s-2); color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.footer-brand img { width: 28px; height: 28px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: var(--s-12) 0 var(--s-16); }
@media (min-width: 900px) { .hero { padding: var(--s-16) 0 var(--s-24); } }

.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(64px); pointer-events: none; z-index: 0;
}
.hero::before { width: 520px; height: 520px; left: -160px; top: -120px; background: var(--blob-a); }
.hero::after { width: 420px; height: 420px; right: -120px; bottom: -160px; background: var(--blob-b); }

.hero .wrap { position: relative; z-index: 1; display: grid; gap: var(--s-12); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr 0.9fr; gap: var(--s-16); } }

.hero-copy .eyebrow { display: inline-flex; align-items: center; gap: var(--s-2); }
.hero h1 { margin-bottom: var(--s-4); }
.hero h1 .groan {
  position: relative; display: inline-block; white-space: nowrap;
  color: var(--primary);
}
.hero h1 .groan svg {
  position: absolute; left: -2%; right: -2%; bottom: -0.08em; width: 104%; height: 0.32em;
  color: var(--accent);
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-muted); max-width: 34rem; margin-bottom: var(--s-6); }
.hero .fineprint { margin-top: var(--s-4); font-size: 0.875rem; color: var(--ink-muted); }
.hero .fineprint span + span::before { content: "·"; margin: 0 var(--s-2); }

.hero-visual { display: flex; justify-content: center; }

/* --------------------------------------------------------------------------
   Phone mockups — the app screens drawn in HTML/CSS, all sized in em so the
   whole device scales with one font-size.
   -------------------------------------------------------------------------- */
.phone {
  font-size: clamp(8.4px, 2.85vw, 11px);
  width: 25em; height: 53em;
  padding: 0.9em;
  background: var(--bezel);
  border-radius: 4em;
  box-shadow: var(--shadow), inset 0 0 0 0.25em rgba(255, 255, 255, 0.06);
  position: relative;
  flex: none;
}
.phone::before { /* the notch/island */
  content: ""; position: absolute; left: 50%; top: 1.5em; transform: translateX(-50%);
  width: 7em; height: 1.8em; border-radius: 1em; background: var(--bezel); z-index: 3;
}
.screen {
  height: 100%; border-radius: 3.2em; overflow: hidden;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column;
  font-size: 1em; line-height: 1.35;
}
.status { display: flex; justify-content: space-between; padding: 1.4em 2.2em 0; font-size: 1.05em; font-weight: 600; }
.appbar { display: flex; align-items: center; justify-content: space-between; padding: 1.6em 1.6em 0.8em; }
.appbar .wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.9em; line-height: 1; }
.pill { display: inline-block; padding: 0.35em 0.9em; border-radius: var(--r-pill); font-size: 0.95em; font-weight: 600; border: 1px solid var(--outline); }
.pill-fill { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.screen-body { padding: 0 1.6em 1.6em; display: flex; flex-direction: column; gap: 1em; }

.field {
  background: var(--bg-high); border-radius: var(--r-md); padding: 0.7em 1.1em;
  display: flex; flex-direction: column; gap: 0.15em;
}
.field .label { font-size: 0.85em; color: var(--ink-muted); }
.field .value { font-size: 1.25em; font-weight: 500; }

.chips { display: flex; gap: 0.5em; flex-wrap: nowrap; overflow: hidden; }
.chip {
  flex: none; padding: 0.4em 0.9em; border-radius: var(--r-pill);
  border: 1px solid var(--line); font-size: 0.95em; font-weight: 500; white-space: nowrap;
  color: var(--ink);
}
.chip.on { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
.chip .lock { opacity: 0.6; margin-left: 0.3em; font-size: 0.85em; }

.pcard { background: var(--bg-high); border-radius: var(--r-lg); padding: 1.1em; display: flex; flex-direction: column; gap: 0.8em; }
.pcard-title { font-weight: 600; font-size: 1.1em; }

/* the in-app pad (mini) */
.pad {
  position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--secondary-container), var(--primary-container));
}
.pad::before { /* bottom row of the bilinear blend, faded in from the top */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--tertiary-container), var(--error-container));
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000);
  mask-image: linear-gradient(to bottom, transparent, #000);
}
.pad::after { /* detent grid every 25% */
  content: ""; position: absolute; inset: 0; opacity: 0.35;
  background-image:
    linear-gradient(to right, var(--outline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--outline) 1px, transparent 1px);
  background-size: 25% 25%;
  background-position: -1px -1px;
}
.pad .axis { position: absolute; z-index: 2; font-size: 0.72em; font-weight: 600; letter-spacing: 0.1em; color: var(--ink); opacity: 0.65; }
.pad .axis-top { top: 0.6em; left: 0; right: 0; text-align: center; }
.pad .axis-bottom { bottom: 0.6em; left: 0; right: 0; text-align: center; }
.pad .axis-left { left: 0.6em; top: 0; bottom: 0; display: flex; justify-content: center; align-items: center; writing-mode: vertical-rl; transform: rotate(180deg); }
.pad .axis-right { right: 0.6em; top: 0; bottom: 0; display: flex; justify-content: center; align-items: center; writing-mode: vertical-rl; }
.handle {
  position: absolute; z-index: 3;
  width: var(--handle, 3.8em); height: var(--handle, 3.8em);
  transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--bg);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02), 0 0 12px rgba(91, 59, 165, 0.35);
  display: grid; place-items: center;
}
.handle img { width: 66%; height: 66%; }
.mini-pad { height: 17em; }
.mini-pad .handle { left: 85%; top: 45%; }
.readout { font-size: 0.95em; color: var(--ink-muted); text-align: center; }

.slider-row { display: flex; align-items: center; gap: 0.8em; font-size: 0.95em; }
.slider-row .track { flex: 1; height: 0.5em; border-radius: var(--r-pill); background: var(--bg-highest); position: relative; }
.slider-row .thumb { position: absolute; top: 50%; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--primary); transform: translate(-50%, -50%); }

.pbtn {
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-lg); padding: 1.1em; text-align: center; font-weight: 600; font-size: 1.15em;
}

.result { position: relative; }
.result p { margin: 0; font-size: 1.28em; font-weight: 600; line-height: 1.3; }
.result-meta { font-size: 0.85em; color: var(--ink-muted); }
.result-actions { display: flex; align-items: center; gap: 0.6em; margin-top: 0.2em; }
.result-actions .ico { width: 1.7em; height: 1.7em; color: var(--ink-muted); }
.result-actions .spacer { flex: 1; }
.result-actions .react { font-size: 1.25em; }

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: reveal var(--dur-reveal) var(--ease-back) both; animation-delay: 300ms; }
  .reveal-2 { animation-delay: 520ms; }
  .reveal-3 { animation-delay: 740ms; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Meme Studio phone */
.meme-photo {
  position: relative; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 3;
  background: #2b2440;
}
.meme-photo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.meme-text {
  position: absolute; left: 0; right: 0; padding: 0.5em 0.8em; text-align: center;
  font-family: var(--font-meme); font-size: 1.35em; line-height: 1.1; text-transform: uppercase;
  color: #fff; letter-spacing: 0.02em;
  text-shadow: 0.08em 0.08em 0 #000, -0.06em -0.06em 0 #000, 0.06em -0.06em 0 #000, -0.06em 0.06em 0 #000, 0 0 0.35em rgba(0,0,0,0.6);
}
.meme-text.top { top: 0.2em; }
.meme-text.bottom { bottom: 0.2em; }
.meme-watermark { position: absolute; right: 0.6em; bottom: 0.5em; font-size: 0.7em; font-weight: 600; color: rgba(255,255,255,0.85); letter-spacing: 0.08em; text-transform: uppercase; }
.toggle { display: inline-flex; align-items: center; gap: 0.5em; }
.toggle .sw { width: 2.6em; height: 1.5em; border-radius: var(--r-pill); background: var(--primary); position: relative; }
.toggle .sw::after { content: ""; position: absolute; top: 0.2em; right: 0.2em; width: 1.1em; height: 1.1em; border-radius: 50%; background: var(--on-primary); }
.toggle .sw.off { background: var(--bg-highest); }
.toggle .sw.off::after { right: auto; left: 0.2em; background: var(--outline); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; }
.font-select { display: flex; align-items: center; justify-content: space-between; background: var(--bg-high); border-radius: var(--r-md); padding: 0.55em 0.9em; font-size: 0.95em; }

/* --------------------------------------------------------------------------
   How it works
   -------------------------------------------------------------------------- */
.steps { display: grid; gap: var(--s-6); counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--bg-high); border-radius: var(--r-xl); padding: var(--s-6);
  position: relative; display: flex; flex-direction: column; gap: var(--s-3);
}
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: var(--s-4); right: var(--s-6);
  font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--primary); opacity: 0.35;
}
.step-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; }
.step-icon svg { width: 28px; height: 28px; }
.step h3 { margin: var(--s-2) 0 0; }
.step p { margin: 0; color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   Groan Matrix explainer + CSS-only demo (radio presets move the handle)
   -------------------------------------------------------------------------- */
.matrix-section { background: var(--bg-high); }
@media (prefers-color-scheme: dark) { .matrix-section { background: var(--bg-high); } }

.matrix-grid { display: grid; gap: var(--s-8); align-items: start; }
@media (min-width: 900px) { .matrix-grid { grid-template-columns: 1fr 1fr; gap: var(--s-12); } }

.dials { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.dial { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-4); align-items: start; }
.dial-icon { width: 56px; height: 56px; border-radius: var(--r-lg); background: var(--bg); display: grid; place-items: center; color: var(--primary); box-shadow: var(--shadow-sm); }
.dial-icon svg { width: 30px; height: 30px; }
.dial h3 { font-size: 1.5rem; margin: 0 0 2px; }
.dial .range { font-weight: 600; font-size: 0.9rem; color: var(--primary); letter-spacing: 0.02em; }
.dial p { margin: var(--s-1) 0 0; color: var(--ink-muted); }

.matrix-demo {
  background: var(--bg); border-radius: var(--r-xl); padding: var(--s-6); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: var(--s-4);
}
.matrix-demo .preset-input { /* visually hidden but focusable */
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
}
.preset-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.preset-chips label {
  cursor: pointer; padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); font-size: 0.9rem; font-weight: 500; user-select: none;
  transition: background var(--dur-tap) linear, color var(--dur-tap) linear;
}
.preset-chips label:hover { background: var(--bg-high); }
#p-dad:checked ~ .preset-chips label[for="p-dad"],
#p-groaner:checked ~ .preset-chips label[for="p-groaner"],
#p-wordsmith:checked ~ .preset-chips label[for="p-wordsmith"],
#p-headline:checked ~ .preset-chips label[for="p-headline"] {
  background: var(--primary); color: var(--on-primary); border-color: transparent;
}
#p-dad:focus-visible ~ .preset-chips label[for="p-dad"],
#p-groaner:focus-visible ~ .preset-chips label[for="p-groaner"],
#p-wordsmith:focus-visible ~ .preset-chips label[for="p-wordsmith"],
#p-headline:focus-visible ~ .preset-chips label[for="p-headline"] {
  outline: 3px solid var(--primary); outline-offset: 3px;
}

.demo-pad-wrap { display: grid; grid-template-columns: 1.6rem 1fr; grid-template-rows: 1fr 1.6rem; gap: var(--s-2); }
.demo-pad { aspect-ratio: 1 / 1; font-size: 12px; }
.demo-pad .handle { --handle: 52px; left: 20%; top: 85%; }
@media (prefers-reduced-motion: no-preference) {
  .demo-pad .handle { transition: left var(--dur-page) var(--ease-back), top var(--dur-page) var(--ease-back); }
  .demo-spice .thumb { transition: left var(--dur-page) var(--ease-back); }
}
#p-dad:checked ~ .demo-pad-wrap .handle { left: 20%; top: 85%; }
#p-groaner:checked ~ .demo-pad-wrap .handle { left: 45%; top: 95%; }
#p-wordsmith:checked ~ .demo-pad-wrap .handle { left: 85%; top: 45%; }
#p-headline:checked ~ .demo-pad-wrap .handle { left: 90%; top: 25%; }
#p-dad:checked ~ .demo-spice .thumb { left: 0%; }
#p-groaner:checked ~ .demo-spice .thumb { left: 10%; }
#p-wordsmith:checked ~ .demo-spice .thumb { left: 10%; }
#p-headline:checked ~ .demo-spice .thumb { left: 0%; }

.demo-pad .dot {
  position: absolute; z-index: 2; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink); opacity: 0.35; transform: translate(-50%, -50%);
}
.demo-pad .dot span {
  position: absolute; left: 12px; top: -4px; white-space: nowrap; font-size: 0.7rem; font-weight: 600; color: var(--ink); opacity: 0.9; letter-spacing: 0.02em;
}
.demo-pad .dot.flip span { left: auto; right: 12px; }
#p-dad:checked ~ .demo-pad-wrap .dot[data-p="dad"] span,
#p-groaner:checked ~ .demo-pad-wrap .dot[data-p="groaner"] span,
#p-wordsmith:checked ~ .demo-pad-wrap .dot[data-p="wordsmith"] span,
#p-headline:checked ~ .demo-pad-wrap .dot[data-p="headline"] span { opacity: 0; }

.axis-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.axis-y { grid-row: 1; grid-column: 1; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; justify-content: space-between; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.axis-x .name, .axis-y .name { color: var(--primary); }

.demo-spice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-3); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.demo-spice .track { position: relative; height: 8px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--secondary-container), var(--tertiary-container)); }
.demo-spice .thumb { position: absolute; top: 50%; left: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); border: 3px solid var(--bg); box-shadow: var(--shadow-sm); transform: translate(-50%, -50%); }

.readouts { position: relative; min-height: 5.5rem; }
.readouts .readout-card { display: none; background: var(--bg-high); border-radius: var(--r-lg); padding: var(--s-4); }
#p-dad:checked ~ .readouts .readout-card[data-preset="dad"],
#p-groaner:checked ~ .readouts .readout-card[data-preset="groaner"],
#p-wordsmith:checked ~ .readouts .readout-card[data-preset="wordsmith"],
#p-headline:checked ~ .readouts .readout-card[data-preset="headline"] { display: block; }
.readout-card .pos { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); margin: 0 0 var(--s-1); }
.readout-card blockquote { margin: 0; font-size: 1.05rem; font-weight: 500; line-height: 1.4; }
.readout-card .vals { margin: var(--s-2) 0 0; font-size: 0.8rem; color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   Features
   -------------------------------------------------------------------------- */
.features { display: grid; gap: var(--s-6); }
@media (min-width: 720px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(6, 1fr); } .feature { grid-column: span 2; } .feature.wide { grid-column: span 3; } }

.feature {
  background: var(--bg-high); border-radius: var(--r-xl); padding: var(--s-6);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.feature-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.feature-icon { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; flex: none; }
.feature-icon svg { width: 26px; height: 26px; }
.feature h3 { margin: 0; font-size: 1.6rem; }
.feature p { margin: 0; color: var(--ink-muted); }
.feature .tag { margin-left: auto; }

.feature-visual { margin-top: var(--s-2); }
.feature.wide { flex-direction: column; }
@media (min-width: 720px) {
  .feature.wide { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; column-gap: var(--s-6); }
  .feature.wide .feature-head { grid-column: 1; }
  .feature.wide p { grid-column: 1; }
  .feature.wide .feature-visual { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
}
.feature .phone { font-size: 8px; }
.feature .phone .meme-text { font-size: 1.6em; }

.copy-demo { display: grid; gap: var(--s-3); }
.copy-box { background: var(--bg); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: 0.9rem; border: 1px solid var(--line); }
.copy-box .lab { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--s-1); }
.copy-box.out { border-color: var(--primary); background: var(--primary-container); color: var(--on-primary-container); }
.copy-box.out .lab { color: var(--on-primary-container); }
.copy-box mark { background: var(--accent); color: var(--on-accent); padding: 0 3px; border-radius: 3px; }
.copy-arrow { text-align: center; color: var(--primary); font-weight: 700; line-height: 1; }

.reactions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }
.reaction { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--bg); border: 1px solid var(--line); font-size: 0.9rem; font-weight: 500; }
.reaction .emoji { font-size: 1.2rem; }
.reaction.best { border-color: var(--primary); background: var(--primary-container); color: var(--on-primary-container); }

.library-demo { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.lib-row { display: flex; align-items: center; gap: var(--s-3); background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); font-size: 0.9rem; }
.lib-row .bm { color: var(--primary); flex: none; width: 18px; height: 18px; }
.lib-row .sync { margin-left: auto; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }

/* --------------------------------------------------------------------------
   Sample groans strip (marquee; static grid under reduced motion)
   -------------------------------------------------------------------------- */
.strip-section { padding-bottom: var(--s-8); }
.groan-strip {
  overflow: hidden; padding: var(--s-2) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.groan-track { display: flex; gap: var(--s-4); width: max-content; padding: 0 var(--s-2); }
.groan-track ul { display: flex; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.groan-card {
  width: 300px; flex: none;
  background: var(--bg-high); border-radius: var(--r-lg); padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.groan-card p { margin: 0; font-weight: 500; line-height: 1.4; flex: 1; }
.groan-card .meters { display: flex; gap: var(--s-3); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.meter { display: inline-flex; align-items: center; gap: 6px; }
.meter i { display: inline-block; width: 44px; height: 6px; border-radius: var(--r-pill); background: var(--bg-highest); position: relative; overflow: hidden; }
.meter i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--v, 50%); border-radius: var(--r-pill); background: var(--primary); }
.meter.groan i::after { background: var(--accent); }
.groan-card .fmt { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }

@media (prefers-reduced-motion: no-preference) {
  .groan-track { animation: marquee 75s linear infinite; }
  .groan-strip:hover .groan-track, .groan-strip:focus-within .groan-track { animation-play-state: paused; }
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .groan-strip { -webkit-mask-image: none; mask-image: none; }
  .groan-track { width: auto; }
  .groan-track ul { flex-wrap: wrap; }
  .groan-track ul[aria-hidden="true"] { display: none; }
  .groan-card { width: 100%; max-width: 340px; }
}

/* --------------------------------------------------------------------------
   Plans
   -------------------------------------------------------------------------- */
.plans { display: grid; gap: var(--s-4); align-items: stretch; }
@media (min-width: 840px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan {
  background: var(--bg-high); border-radius: var(--r-xl); padding: var(--s-6);
  border: 2px solid transparent; display: flex; flex-direction: column; gap: var(--s-3);
}
.plan.featured { border-color: var(--primary); }
.plan-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.plan h3 { margin: 0; font-size: 1.8rem; }
.plan .price { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; }
.plan .alt { color: var(--ink-muted); font-size: 0.9rem; margin: -6px 0 0; }
.plan ul { list-style: none; padding: 0; margin: var(--s-2) 0 0; display: grid; gap: var(--s-2); flex: 1; }
.plan li { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0; }
.plan li svg { width: 20px; height: 20px; flex: none; color: var(--primary); margin-top: 2px; }
.plan li.minus svg { color: var(--ink-muted); }
.plan li.minus { color: var(--ink-muted); }
.plan .btn { margin-top: var(--s-2); }
.plans-note { margin-top: var(--s-6); color: var(--ink-muted); font-size: 0.875rem; max-width: 60ch; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  padding: var(--s-4) 0; font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary-container); color: var(--on-primary-container);
  font-weight: 700; line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { color: var(--primary); }
.faq .answer { padding: 0 0 var(--s-4); color: var(--ink-muted); max-width: 64ch; }
.faq .answer p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Final CTA
   -------------------------------------------------------------------------- */
.cta {
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-xl); padding: var(--s-12) var(--s-6); text-align: center;
  position: relative; overflow: hidden;
}
.cta h2 { color: inherit; }
.cta p { color: inherit; opacity: 0.9; max-width: 44ch; margin-left: auto; margin-right: auto; }
.cta .store-badges { justify-content: center; margin-top: var(--s-6); }
.cta img.mark { width: 72px; height: 72px; margin: 0 auto var(--s-4); }
.cta a { color: inherit; }

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */
.legal { max-width: 800px; margin: 0 auto; padding: var(--s-12) var(--s-4) var(--s-16); }
@media (min-width: 640px) { .legal { padding-left: var(--s-6); padding-right: var(--s-6); } }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: var(--s-1); }
.legal h2 { font-size: 1.75rem; margin: var(--s-8) 0 var(--s-2); }
.legal h3 { font-size: 1.25rem; font-family: var(--font-body); font-weight: 600; margin: var(--s-6) 0 var(--s-1); }
.legal .sub { color: var(--ink-muted); margin: 0 0 var(--s-6); }
.legal .callout { border-left: 4px solid var(--primary); background: var(--bg-high); padding: var(--s-3) var(--s-4); margin: var(--s-4) 0; border-radius: var(--r-sm); }
.legal .callout ul { margin: var(--s-1) 0 0; }
.legal .table-wrap { overflow-x: auto; margin: var(--s-3) 0; -webkit-overflow-scrolling: touch; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--bg-high); }
.legal .button { display: inline-block; margin: 8px 0 4px; padding: 10px 18px; background: var(--primary); color: var(--on-primary); border-radius: var(--r-md); text-decoration: none; font-weight: 600; }
.legal .button:hover { background: var(--grape-deep); }
@media (prefers-color-scheme: dark) { .legal .button:hover { background: #DCCFF7; } }

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: var(--s-16) var(--s-4); }
.notfound img { width: 120px; height: 120px; margin: 0 auto var(--s-4); }
.notfound .code { font-family: var(--font-display); font-size: clamp(4rem, 14vw, 8rem); line-height: 1; color: var(--primary); margin: 0; }
.notfound .actions { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; margin-top: var(--s-6); }
.notfound blockquote { margin: var(--s-6) auto 0; color: var(--ink-muted); max-width: 40ch; font-style: italic; }

/* --------------------------------------------------------------------------
   Reduced motion: no transitions anywhere
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
