/* Tale Stories website.
   Palette and type match the app (Theme.swift): warm paper, dark ink, sage green for actions,
   and the app's yellow read-along highlight as the one accent and identity motif. */

:root {
  --paper: #FBF7EF;
  --card: #F3EDE2;
  --ink: #3B3630;
  --muted: #6B6359;     /* 5.5:1 on paper, 5.0:1 on card */
  --accent: #4F6E61;    /* 5.3:1 on paper; white text on it 5.6:1 */
  --accent-dark: #3F5A4F;
  --highlight: #FEE4A0;
  --error: #9A3B2E;     /* 6.4:1 on paper */
  --line: #E4DCCD;
  /* Serif for reading text, like the app's story pages; system sans for small interface text. */
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --page: min(1120px, 100% - 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
p { margin: 0 0 1em; }
a { color: var(--accent-dark); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The read-along highlight: same colour and soft corners as the app. */
mark { background: var(--highlight); color: inherit; padding: 0 .12em; border-radius: .2em; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  background: var(--accent); color: #fff;
  font: 600 1rem var(--sans); text-decoration: none;
  border: 0; border-radius: 999px; cursor: pointer;
}
.button:hover { background: var(--accent-dark); }
.button[disabled] { background: var(--accent-dark); cursor: progress; }

/* Header */
.top {
  width: var(--page); margin: 0 auto; padding: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark { font: 600 1.35rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; }
.wordmark img { width: 30px; height: 30px; flex: none; }
.top-cta { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

/* Header links: the other audience's page, then sign-up. */
.top-nav { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; justify-content: flex-end; }
.top-lang { color: var(--muted); font-size: .95rem; min-height: 44px; display: inline-flex; align-items: center; }

.eyebrow { font-weight: 600; color: var(--accent-dark); margin-bottom: .6em; letter-spacing: .01em; }

/* Why: three short reasons for this audience. */
.why { width: var(--page); margin: 110px auto 0; }
.why-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.why-list li { border-top: 3px solid var(--highlight); padding-top: 16px; }
.why-list strong { display: block; font: 600 1.2rem var(--serif); margin-bottom: 6px; }

/* Arabic meanings */
.meaning [dir="rtl"] { display: block; text-align: right; font-size: 1.1em; }

/* Hero: copy on the left, a working page from the app on the right. */
.hero {
  width: var(--page); margin: 24px auto 0;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.9rem); letter-spacing: -.01em; }
.lede { font-size: 1.2rem; color: var(--ink); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.note { color: var(--muted); font-size: .95rem; max-width: 22em; }

.page { margin: 0; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(59, 54, 48, .35); }
.page figcaption { padding: 20px 24px 24px; }
.demo-hint { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.sentence { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); line-height: 1.5; margin: 0 0 14px; }
.word {
  font: inherit; color: inherit; background: transparent; border: 0;
  padding: 0 .15em; margin: 0 -.05em; border-radius: .25em; cursor: pointer;
  transition: background-color .15s ease-out;
}
.word:hover { background: var(--card); }
.word.is-lit, .word[aria-current="true"] { background: var(--highlight); }

.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.read {
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent-dark);
  font: 600 .95rem var(--sans); cursor: pointer;
}
.read[aria-pressed="true"] { background: var(--accent); color: #fff; }
.lang-switch { border: 0; padding: 0; margin: 0; display: flex; gap: 14px; font-size: .95rem; }
.lang-switch label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.lang-switch input { accent-color: var(--accent); width: 18px; height: 18px; }

.meaning { margin-top: 12px; min-height: 64px; padding: 12px 16px; background: var(--card); border-radius: var(--radius); }
.meaning-empty { color: var(--muted); font-size: .95rem; }
.meaning-word { font: 600 1.2rem var(--serif); display: block; }
.meaning-text { color: var(--muted); }
.voice-note { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }

/* Inside the app: three real screenshots, the reading screen larger and in the middle. */
.inside { width: var(--page); margin: 120px auto 0; }
.inside h2 { text-align: center; }
.screens { display: grid; grid-template-columns: 1fr 1.18fr 1fr; gap: 36px; align-items: end; margin-top: 36px; }
.screens figure { margin: 0; }
.screens img { border-radius: 28px; border: 1px solid var(--line); background: #fff; }
.screens figcaption { margin-top: 14px; font-size: .98rem; color: var(--muted); max-width: 24em; }
.screen-main figcaption { color: var(--ink); }

/* Made to be put down: a plain list beside the reason, not cards. */
.calm {
  width: var(--page); margin: 130px auto 0;
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start;
}
.calm-intro p { font-size: 1.15rem; max-width: 26em; }
.calm-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.calm-list li { padding: 14px 0 14px 34px; border-bottom: 1px solid var(--line); position: relative; }
.calm-list li::before {
  content: ""; position: absolute; left: 4px; top: 22px;
  width: 16px; height: 10px; border-radius: 3px; background: var(--highlight);
}

/* Made for reading together: same list style as "Made to be put down", with one screenshot. */
.together {
  width: var(--page); margin: 130px auto 0;
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start;
}
.together-shot { width: min(300px, 70%); margin-top: 24px; border-radius: 28px; border: 1px solid var(--line); background: #fff; }
.plans { margin: 0 0 1em; padding-left: 1.2em; }
.plans li { margin-bottom: .3em; }

/* The shelf */
.shelf { width: var(--page); margin: 130px auto 0; }
.section-lede { color: var(--muted); }
.covers { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 22px; }
.covers img { border-radius: var(--radius); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.cover-title { font: 600 1.05rem var(--serif); margin: 10px 0 0; }
.cover-meaning { color: var(--muted); font-size: .92rem; margin: 0; }
.cover-free { font-size: .8rem; font-weight: 600; color: var(--accent-dark); }

/* Price */
.price { width: min(720px, 100% - 40px); margin: 130px auto 0; font-size: 1.12rem; }

/* FAQ */
.faq { width: min(720px, 100% - 40px); margin: 110px auto 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 0; font: 600 1.12rem var(--serif); list-style-position: outside; min-height: 44px; }
.faq details p { color: var(--ink); max-width: 38em; }

/* Waitlist */
.waitlist {
  width: min(720px, 100% - 40px); margin: 110px auto 0;
  background: var(--card); border-radius: 24px; padding: clamp(24px, 4vw, 44px);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid #8C8273; border-radius: 10px; /* 3.7:1 on white */
}
.field input[aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: .92rem; margin: 6px 0 0; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 14px 0 0; min-height: 1.6em; font-weight: 600; }
.form-status.is-error { color: var(--error); }
.form-status.is-done { color: var(--accent-dark); }
.fine { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }

.privacy { width: min(720px, 100% - 40px); margin: 80px auto 0; font-size: .95rem; color: var(--muted); }
.privacy h2 { font-size: 1.3rem; color: var(--ink); }
.placeholder { background: var(--highlight); color: var(--ink); padding: 0 4px; border-radius: 4px; }

.bottom { width: var(--page); margin: 80px auto 0; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Privacy policy */
.legal { width: min(720px, 100% - 40px); margin: 40px auto 0; }
.legal h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); }
.legal h2 { font-size: 1.4rem; margin-top: 1.6em; }
.legal-date { color: var(--muted); }
.legal li { margin-bottom: .6em; }

/* Tablet */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .calm, .together { grid-template-columns: 1fr; gap: 24px; }
  .covers { grid-template-columns: repeat(2, 1fr); }
  .why-list { grid-template-columns: 1fr; gap: 18px; }
}

/* Phone: screenshots become a horizontal row you can swipe, so the page stays short. */
@media (max-width: 720px) {
  body { font-size: 1rem; }
  .inside, .calm, .together, .shelf { margin-top: 90px; }
  .price, .faq, .waitlist { margin-top: 80px; }
  .screens {
    grid-template-columns: repeat(3, 72%); gap: 18px; align-items: start;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  }
  .screens figure { scroll-snap-align: center; }
  .page figcaption { padding: 16px 18px 20px; }
  .top-cta { font-size: .95rem; }
  .top-lang-long { display: none; }
  .top-nav { gap: 4px 16px; }
}
.notfound { margin-top: 20vh; }
