/* ============================================================
   Wordhoard marketing site
   Editorial-minimal base, dependency-free, mobile-first.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  --bg: #F4F2EE;          /* cream page canvas */
  --surface: #FFFFFF;     /* hero card + notify form only */
  --mint: #E1F5EE;        /* accentLight: privacy band, card panel */
  --text: #1A1A18;        /* headings + primary body */
  --muted: #6B6B66;       /* supporting text, ipa, fine print */
  --hint: #A0A09A;        /* placeholder text only */
  --accent: #1D9E75;      /* teal, rationed to action */
  --cloze: #5DCAA5;       /* the app's real cloze colour */
  --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;

  --container: 64rem;
  --measure: 60ch;
}

html[data-theme="dark"] {
  --bg: #14161A;
  --surface: #1E2128;
  --surface2: #262A33;
  --mint: #11362A;
  --text: #ECEAE4;
  --muted: #A6A49C;
  --hint: #6E6D66;
  --accent: #2FB78A;
  --cloze: #5DCAA5;
  --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);
}

/* ---- 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;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
}
.wordmark-text { font-family: var(--serif); font-size: 1.5rem; line-height: 1; }
.mark { flex: none; }

.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 ------------------------------------------------- */
.hero { padding-top: clamp(3rem, 8vw, 6rem); }
.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 52% 48%; }
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.01em; }
.lede {
  color: var(--muted);
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  line-height: 1.65;
  margin-top: 1.4rem;
  max-width: 46ch;
}

.cta-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}
.micro { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.trust { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.trust span { margin-inline: 0.35rem; color: var(--hint); }

/* ---- Hero cloze card -------------------------------------- */
.hero-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;
}

/* ---- The method ------------------------------------------- */
.the-method h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1.25rem; }
.reframe { font-size: 1.15rem; margin-bottom: 1.5rem; max-width: 62ch; }
.the-method .measure > p + p { margin-top: 1.1rem; }
.the-method .measure p { color: var(--text); }

.stat-row {
  display: grid;
  gap: 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
@media (min-width: 720px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }
.stat { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-num { font-family: var(--serif); font-size: clamp(2.5rem, 6vw, 3.5rem); line-height: 1; color: var(--text); }
.stat-label { color: var(--muted); max-width: 30ch; }

.footnote { margin-top: clamp(2.25rem, 5vw, 3rem); color: var(--muted); font-size: 0.95rem; }

/* ---- What you get ----------------------------------------- */
.what-you-get h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 2rem; }
.feature-list { margin: 0; display: grid; gap: 0; }
@media (min-width: 720px) {
  .feature-list { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
}
.dl-row { padding-block: 1.4rem; border-top: 1px solid var(--border); }
.dl-row dt { font-weight: 600; color: var(--text); margin-bottom: 0.45rem; font-size: 1.1rem; }
.dl-row dd { margin: 0; color: var(--muted); max-width: 42ch; }

/* ---- 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); }

/* ---- Privacy ---------------------------------------------- */
.privacy { background: var(--mint); }
.privacy h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1.25rem; }
.privacy > .measure > p { color: var(--text); margin-inline: auto; }
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
}
.chip {
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 500;
  font-size: 0.9rem;
}
html[data-theme="dark"] .chip { color: var(--cloze); border-color: var(--cloze); }
.pull {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25;
  color: var(--text);
  margin-top: 2rem;
}

/* ---- 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); }
.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;
  }
}
