/* CocoDrilo site — shared styles for the landing page and document pages.
   Tokens mirror the app's Theme.swift: system font, navy primary, steel and
   light-blue accents, teal for correct, cool grey grounds, white cards. */

:root {
  --bg: #f7f9fc;
  --bg-2: #eef3f9;
  --surface: #ffffff;
  --control: #f1f5f9;
  --primary: #1a3557;
  --secondary: #466f9e;
  --accent: #7ab8e8;
  --text: #1e293b;
  --text-2: #64748b;
  --border: #e2e8f0;
  --positive: #3f9886;     /* teal, darkened from #5FB3A2 for text contrast */
  --positive-fill: #5fb3a2;
  --negative: #b85050;
  --band: #1a3557;
  --shadow: 0 5px 12px rgba(0, 0, 0, .055), 0 1px 2px rgba(0, 0, 0, .04);

  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  --max: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-2: #131d33;
    --surface: #162238;
    --control: #23344d;
    --primary: #e5e7eb;
    --secondary: #7a9fc8;
    --accent: #7ab8e8;
    --text: #e5e7eb;
    --text-2: #94a3b8;
    --border: #23344d;
    --positive: #6bc6b3;
    --positive-fill: #6bc6b3;
    --negative: #d97a7a;
    --band: #162238;
    --shadow: 0 5px 12px rgba(0, 0, 0, .13);
    color-scheme: dark;
  }
}

/* ── Base ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--secondary); }
p { margin: 0; text-wrap: pretty; }

.wrap { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3 { margin: 0; color: var(--primary); text-wrap: balance; }
h1 { font-size: clamp(40px, 6.4vw, 68px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; }
h2 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }

/* The app's overline: small, bold, uppercase, tracked. */
.overline, .eyebrow, .tag, .step-es {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.2;
}

/* ── Header / footer ─────────────────────────────── */

.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { border-radius: 22%; }
.site-header nav { display: flex; gap: 24px; }
.site-header nav a, .site-footer nav a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-header nav a:hover, .site-footer nav a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--border); padding: 32px 0 48px; font-size: 14px; color: var(--text-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.site-footer .brand { font-size: 15px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer p { margin-left: auto; }

/* ── Badge ────────────────────────────────────────── */

.badge { display: inline-block; line-height: 0; }
.badge img { height: 50px; width: auto; }
.badge .on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .badge .on-light { display: none; }
  .badge .on-dark { display: block; }
}

/* ── Hero ─────────────────────────────────────────── */

.hero { text-align: center; padding: clamp(56px, 9vw, 112px) 0 clamp(72px, 10vw, 128px); }
.hero .wrap { display: flex; flex-direction: column; align-items: center; }
.hero-icon { width: 84px; height: 84px; border-radius: 22%; box-shadow: 0 8px 16px rgba(0, 0, 0, .1); margin-bottom: 28px; }
.eyebrow { color: var(--secondary); margin-bottom: 16px; }
.hero h1 { max-width: 13ch; }
.lede { font-size: clamp(18px, 1.6vw, 20px); color: var(--text-2); max-width: 34em; margin: 22px 0 34px; }

/* ── Sections ─────────────────────────────────────── */

.section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { color: var(--text-2); font-size: 18px; margin-top: 10px; }

.how { background: var(--bg-2); padding: clamp(72px, 10vw, 120px) 0; }

.step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
  padding: clamp(28px, 4vw, 48px) 0;
}
.step + .step { border-top: 1px solid var(--border); }
@media (min-width: 820px) {
  .step { grid-template-columns: 1fr 1fr; gap: 72px; }
  .step:nth-of-type(even) .step-copy { order: 2; }
}
.step-copy { max-width: 30em; }
.step-es { color: var(--secondary); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.step-es span {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--primary); color: var(--bg); font: 700 14px/1 var(--rounded); letter-spacing: 0;
}
.step h3 { font-size: 28px; letter-spacing: -0.02em; margin-bottom: 10px; }
.step-copy > p:last-child { color: var(--text-2); }

/* ── Vignettes: illustrations of ideas, not app screens ── */

.vignette { margin: 0; display: flex; justify-content: center; }
.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.tag { display: inline-block; color: var(--text-2); }

.word-card .word { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--primary); margin-top: 12px; }
.word-card .gloss { color: var(--text-2); margin-top: 2px; }
.word-card .example { margin-top: 20px; padding: 14px 16px; background: var(--control); border-radius: 12px; font-size: 15px; }
.word-card .example p:last-child { color: var(--text-2); }
.word-card b { font-weight: 600; color: var(--secondary); }

.schedule .row { display: grid; gap: 10px; margin-bottom: 20px; }
.row-label { font-size: 14px; font-weight: 600; color: var(--text); }
.line { position: relative; height: 14px; }
.line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--border); border-radius: 4px; }
.line i, .legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--secondary); display: inline-block; }
.line i { position: absolute; top: 1px; left: calc(var(--x) * .96); }
i.miss { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--negative); }
i.soon { background: var(--positive-fill); }
.axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; }

.cloze .sentence { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.4; color: var(--primary); margin-top: 14px; }
.cloze .blank { display: inline-block; padding: 0 10px; border-radius: 8px; background: color-mix(in srgb, var(--positive-fill) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--positive-fill); color: var(--positive); }
.cloze .gloss { color: var(--text-2); font-size: 15px; margin-top: 8px; }
.cloze .result { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--positive); }

/* ── What to expect ───────────────────────────────── */

.expect { padding: clamp(72px, 10vw, 120px) 0; }
.traits { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 820px) { .traits { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.traits li { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; }
.traits h3 { font-size: 19px; margin-bottom: 8px; }
.traits p { color: var(--text-2); font-size: 16px; }

/* ── Closing ──────────────────────────────────────── */

.closing { padding: 0 0 clamp(72px, 10vw, 120px); }
.closing .wrap > * { max-width: none; }
.closing .wrap {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.closing-panel {
  width: 100%; background: var(--band); color: #e5e7eb; border-radius: 26px;
  padding: clamp(48px, 7vw, 80px) 24px; display: flex; flex-direction: column; align-items: center;
}
.closing h2 { color: #fff; }
.closing p { max-width: 32em; margin: 16px 0 30px; font-size: 18px; color: #c8d3e2; }

@media (max-width: 560px) {
  .site-header nav a[href="#how"] { display: none; }
  .site-footer p { margin-left: 0; }
  .card { padding: 20px; }
  .word-card .word { font-size: 30px; }
  .cloze .sentence { font-size: 21px; }
}

/* ── Document pages: Privacy, Terms, Support ─────── */

.doc { padding: clamp(40px, 7vw, 80px) 0 clamp(72px, 10vw, 112px); }
.doc .wrap { max-width: calc(720px + 2 * var(--gutter)); }
.doc-head { margin-bottom: clamp(28px, 4vw, 40px); }
.doc-head h1 { font-size: clamp(36px, 5vw, 52px); }
.doc-head .updated { color: var(--text-2); font-size: 15px; margin-top: 10px; }

.prose {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px);
}
.prose h2 { font-size: 21px; letter-spacing: -0.015em; margin: 36px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--secondary); }
.prose strong { font-weight: 600; color: var(--text); }
.prose a { text-underline-offset: 3px; }

.contact-card {
  background: var(--band); color: #c8d3e2; border-radius: 20px; padding: clamp(24px, 5vw, 40px);
  margin-bottom: clamp(40px, 6vw, 56px);
}
.contact-card h2 { color: #fff; font-size: 24px; letter-spacing: -0.02em; margin-bottom: 8px; }
.contact-card p { margin-bottom: 22px; }
.button {
  display: inline-block; background: #fff; color: #1a3557; font-weight: 600; font-size: 16px;
  text-decoration: none; padding: 12px 20px; border-radius: 12px;
}
.button:hover { background: #eef3f9; }

.faq h2.overline { font-size: 12px; color: var(--text-2); margin-bottom: 14px; letter-spacing: .1em; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 52px 18px 22px; position: relative;
  font-weight: 600; font-size: 17px; color: var(--primary);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 22px 20px; color: var(--text-2); }
.faq details strong { color: var(--text); font-weight: 600; }
