/* ============================================================
   Vocaboolary marketing site
   Editorial-minimal base, dependency-free, mobile-first.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  --bg: #F3F2F6;          /* page canvas, a faint violet grey */
  --surface: #FFFFFF;     /* hero card + notify form only */
  --mint: #EFE8FA;        /* accentLight: privacy band, card panel */
  --text: #1A191D;        /* headings + primary body */
  --muted: #6B6974;       /* supporting text, ipa, fine print */
  --hint: #A09EA8;        /* placeholder text only */
  --accent: #7A37C4;      /* the ghost's purple, rationed to action */
  --cloze: #7A37C4;       /* the blank, as in the app */
  --border: rgba(26, 26, 24, 0.12);
  --shadow: 0 1px 2px rgba(26, 26, 24, 0.04), 0 12px 32px rgba(26, 26, 24, 0.06);

  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* The wordmark's stand-in until the real one is drawn (logo board). */
  --wordmark: 'Fredoka', 'Outfit', system-ui, sans-serif;
  --boo: #7A37C4;         /* "boo" in the wordmark */
  --lilac: #B99AF0;       /* "boo" on black, where the purple is too dark */

  --container: 64rem;
  --measure: 60ch;
}

html[data-theme="dark"] {
  --bg: #141319;
  --surface: #1E1C25;
  --surface2: #28252F;
  --mint: #2A2140;
  --text: #ECEAF1;
  --muted: #A7A4AF;
  --hint: #6F6C78;
  --accent: #A57BEA;
  --cloze: #B99AF0;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.35);
  --boo: #B99AF0;
}

/* ---- Reset / base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; }
p { margin: 0; }
a { color: inherit; }

img, svg { display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.measure { max-width: var(--measure); }
.measure-wide { max-width: 68ch; margin-inline: auto; }
.center { text-align: center; margin-inline: auto; }

.section { padding-block: clamp(3.25rem, 8vw, 6.5rem); }

/* Anchor targets clear the sticky header */
[id] { scroll-margin-top: 84px; }

/* ---- Focus + skip link ------------------------------------ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* ---- Header ----------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
}
html[data-theme="dark"] .site-header { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* The side ghost beside the wordmark, as on the logo board. */
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}
.lockup-ghost { width: auto; height: 38px; flex: none; }
.wordmark-text { font-family: var(--wordmark); font-weight: 600; font-size: 1.45rem; line-height: 1; letter-spacing: -0.01em; }
.boo { color: var(--boo); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---- Buttons + links -------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
html[data-theme="dark"] .btn-primary { color: #0c1a14; }

.link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.link-quiet:hover, .link-quiet:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.glyph { flex: none; }

/* ---- Eyebrow / shared type -------------------------------- */
.eyebrow {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

/* ---- Hero: the store banner, black in both themes ------------ */
/* The ghost is drawn white on black, like the splash screen. */
.hero-band { background: #000; color: #fff; padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero-band-inner {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  justify-items: center;
  text-align: center;
}
@media (min-width: 820px) {
  .hero-band-inner { grid-template-columns: auto 1fr; justify-items: start; text-align: left; }
}
.hero-ghost { width: clamp(9rem, 26vw, 15rem); height: auto; }
.hero-wordmark {
  font-family: var(--wordmark);
  font-weight: 600;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.015em;
  color: #fff;
}
.hero-wordmark .boo { color: var(--lilac); }
.hero-line { color: #CFC8DE; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.45; margin-top: 1rem; max-width: 30ch; }
@media (max-width: 819px) { .hero-line { margin-inline: auto; } }

.cta-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: inherit;
  gap: 1rem 1.5rem;
  margin-top: 1.75rem;
}
@media (max-width: 819px) { .hero-band .cta-cluster { justify-content: center; } }
.hero-band .btn-primary { background: var(--lilac); color: #140c22; }
.hero-band .link-quiet { color: var(--lilac); }
.trust { color: #A39DB2; font-size: 0.9rem; margin-top: 1rem; }
.trust span { margin-inline: 0.35rem; }

/* ---- The card --------------------------------------------- */
.card-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 880px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.card-copy h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); margin-bottom: 1rem; }
.card-copy p:not(.eyebrow) { color: var(--muted); max-width: 44ch; }
.card-visual { display: flex; flex-direction: column; gap: 0.9rem; }

.cloze-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem 1.6rem 1.75rem;
  box-shadow: var(--shadow);
}

.chip-deck {
  display: inline-block;
  background: var(--mint);
  color: var(--accent);
  font-weight: 500;
  font-size: 0.78rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
}
html[data-theme="dark"] .chip-deck { color: var(--cloze); }

.cloze-sentence {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.45;
  color: var(--text);
  margin-top: 1rem;
}
.blank {
  display: inline-block;
  width: 4.5em;
  border-bottom: 3px solid var(--cloze);
  transform: translateY(-0.15em);
  margin-inline: 0.1em;
}
.answer { color: var(--cloze); }

.reveal-btn {
  margin-top: 1.1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}
.reveal-btn:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

.definition {
  margin-top: 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}
.def-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.pos { font-style: italic; color: var(--muted); }
.ipa { color: var(--muted); font-size: 0.95rem; }
.speaker {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.speaker:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.def-text { margin-top: 0.6rem; color: var(--text); }
.syns { margin-top: 0.35rem; color: var(--muted); }
.syns span { color: var(--hint); margin-inline: 0.2rem; }
.srs-line { margin-top: 0.9rem; color: var(--muted); font-size: 0.9rem; }

.card-caption { color: var(--muted); font-size: 0.9rem; padding-inline: 0.25rem; }

/* Progressive enhancement: only hide when JS is present */
html.js .reveal-btn { display: inline-block; }
.reveal-btn { display: none; } /* no-JS: card shows answer, hide dead button */

html.js .cloze-card:not(.revealed) .answer { display: none; }
html.js .cloze-card:not(.revealed) .blank { display: inline-block; }
html.js .cloze-card.revealed .answer { display: inline; }
html.js .cloze-card.revealed .blank { display: none; }

/* No-JS default: show the answer, hide the blank */
.blank { display: none; }
html.js .cloze-card:not(.revealed) .blank { display: inline-block; }

html.js .definition {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  margin-top: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
}
html.js .cloze-card.revealed .definition {
  max-height: 26rem;
  opacity: 1;
  visibility: visible;
  margin-top: 1.25rem;
}

/* ---- Features --------------------------------------------- */
.features { background: var(--mint); }
.features h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); margin-bottom: 2rem; max-width: 22ch; }
/* On a phone the tiles are a row to swipe, the next one peeking in, which
   halves the scroll five stacked tiles made. A grid from 640 px up. */
.tiles {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-inline: calc(-1 * clamp(1.25rem, 5vw, 3rem));
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  scroll-padding-inline: clamp(1.25rem, 5vw, 3rem);
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.tiles::-webkit-scrollbar { display: none; }
.tiles .tile { flex: 0 0 82%; scroll-snap-align: start; }
@media (min-width: 640px) {
  .tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; overflow: visible; margin-inline: 0; padding-inline: 0; }
}
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.35rem 1.5rem;
}
.tile h3 { font-family: var(--sans); font-weight: 600; font-size: 1.1rem; line-height: 1.3; margin-bottom: 0.5rem; }
.tile p { color: var(--muted); }

/* ---- Who it's for ----------------------------------------- */
.who-its-for { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.who-its-for h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 2rem; }
.audience-row { display: grid; gap: 2rem; }
@media (min-width: 720px) { .audience-row { grid-template-columns: repeat(3, 1fr); } }
.audience-label { font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.audience p:last-child { color: var(--muted); }

/* ---- FAQ -------------------------------------------------- */
.faq h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1.5rem; }
.faq-list { border-bottom: 1px solid var(--border); }
.faq details { border-top: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding-block: 1.2rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq-answer { padding-bottom: 1.3rem; color: var(--muted); max-width: 60ch; }

/* ---- CTA -------------------------------------------------- */
.cta h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1rem; }
.cta > .measure > p { color: var(--muted); margin-inline: auto; }

.play-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  min-width: 180px;
  min-height: 54px;
  justify-content: center;
  padding: 0 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.notify {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1.75rem;
  text-align: left;
  box-shadow: var(--shadow);
}
.notify label { display: block; font-weight: 500; margin-bottom: 0.55rem; }
.notify-row { display: flex; flex-direction: column; gap: 0.75rem; }
@media (min-width: 520px) { .notify-row { flex-direction: row; } }
.notify input {
  flex: 1;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.notify input::placeholder { color: var(--hint); }
.notify .btn-primary { justify-content: center; }
.form-error { color: #C4453A; font-size: 0.9rem; margin-top: 0.7rem; }
html[data-theme="dark"] .form-error { color: #F09189; }
.notify .micro { margin-top: 0.8rem; }

.notify-success {
  background: var(--mint);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  margin-top: 1.75rem;
  color: var(--text);
}
.fallback { margin-top: 1.5rem; color: var(--muted); font-size: 0.95rem; }
.fallback a { color: var(--accent); }

/* ---- Footer ----------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.5rem 3rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-tagline { color: var(--muted); margin-top: 0.5rem; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.footer-links span { color: var(--hint); }
/* On a phone the address gets a line of its own, so no dot is left hanging
   at the end of the first. */
@media (max-width: 439px) {
  .footer-links span:last-of-type { display: none; }
  .footer-links a:last-child { flex-basis: 100%; }
}
.fine-print { color: var(--muted); font-size: 0.85rem; margin-top: 1.75rem; max-width: 60ch; }

/* ---- Toast (audio affordance) ----------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(1rem);
  background: var(--text);
  color: var(--bg);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Legal / content pages (privacy, support) ------------- */
.doc { padding-block: clamp(2.5rem, 6vw, 4rem); }
.doc .container { max-width: 46rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.4rem; }
.doc h2 { font-size: 1.4rem; margin-top: 2.25rem; margin-bottom: 0.6rem; }
.doc p, .doc li { color: var(--text); }
.doc .muted { color: var(--muted); font-size: 0.9rem; }
.doc a { color: var(--accent); }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-block: 0.35rem; }
.doc ol { padding-left: 1.4rem; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.doc :not(pre) > code { background: var(--mint); padding: 0.1em 0.35em; border-radius: 6px; }
.doc pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.6; margin-block: 0.75rem;
}
.doc .note { background: var(--mint); border-radius: 12px; padding: 0.9rem 1.1rem; }
.doc .table-wrap { overflow-x: auto; margin-block: 1rem; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.doc th, .doc td { border-bottom: 1px solid var(--border); padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; }
.doc th { font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--accent); text-decoration: none; margin-bottom: 1.5rem; font-weight: 500; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
