/* OpenSchwa test website — styles.
 *
 * The palette follows the project's brand system (see the OpenSchwa repo,
 * assets/brand/README.md): the artwork is the source of truth.
 *   amber  #e36c02 — the [ə] brackets, the accent
 *   slate  #3b3e45 — the glyph
 *   cream  #fcf8f0 — background / tile
 * Both light and dark schemes are defined so the page never goes dark-on-dark. */

:root {
  color-scheme: light dark;

  /* Brand constants (never overridden by the dark scheme). */
  --brand-amber: #e36c02;
  --brand-slate: #3b3e45;
  --brand-cream: #fcf8f0;

  /* Light scheme (default). */
  --bg: #fcf8f0;
  --surface: #ffffff;
  --surface-inset: #f5efe3;
  --fg: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --border: #e7ddcb;
  --accent: var(--brand-amber);
  --accent-fg: #1c1917;
  --chip-bg: var(--brand-cream);
  --code-bg: #f1eadb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-inset: #172033;
    --fg: #e2e8f0;
    --muted: #94a3b8;
    --faint: #94a3b8;
    --border: #334155;
    --accent: #fbbf24;
    --accent-fg: #0f172a;
    --chip-bg: var(--brand-cream);
    --code-bg: #172033;
  }
}

/* Typography: a serif display for the phonetics-textbook feel,
 * system sans for body. No webfonts — the site works offline. */
:root {
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 6rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--fg);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand:hover {
  color: var(--fg);
}

/* The transparent mark cannot sit on a dark surface unaided (its glyph is
 * ~1.6:1 against #0f172a), so dark mode puts it on a cream chip — the same
 * trick as Logo.svelte in the app. */
.logo-chip {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 55px;
}

@media (prefers-color-scheme: dark) {
  .logo-chip {
    background: var(--chip-bg);
    border-radius: 10px;
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-ipa {
  color: var(--faint);
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
}

.nav-download {
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  color: var(--accent) !important;
  font-weight: 600;
}

.nav-download:hover {
  background: var(--accent);
  color: var(--accent-fg) !important;
}

/* ---------- Hero ---------- */

.hero {
  padding: 4.5rem 0 4rem;
  text-align: center;
}

.badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.2rem 0.8rem;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 auto 1rem;
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
}

.lede {
  margin: 0 auto 2rem;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.2rem;
}

.promise {
  margin: 0 auto 2.25rem;
  max-width: 58ch;
  padding: 1rem 1.25rem;
  background: var(--surface-inset);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: left;
}

.promise strong {
  color: var(--fg);
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  min-height: 44px;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, var(--fg));
  color: var(--accent-fg);
}

.btn-secondary {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--fg);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Sections ---------- */

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  line-height: 1.2;
}

.section-lede {
  margin: 0 0 2rem;
  max-width: 60ch;
  color: var(--muted);
}

.section p {
  max-width: 66ch;
  margin: 0 0 1rem;
  color: var(--muted);
}

.section p:last-child {
  margin-bottom: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
}

.card em {
  color: var(--fg);
  font-style: italic;
}

/* ---------- Roadmap ---------- */

.roadmap {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.roadmap li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.roadmap li:last-child {
  border-bottom: none;
}

.roadmap li strong {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.roadmap .done {
  color: var(--faint);
}

.chip-done {
  padding: 0.05rem 0.5rem;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Releases ---------- */

.download-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.download-text {
  flex: 1 1 24rem;
}

.download-text p {
  margin: 0;
}

code {
  padding: 0.1em 0.35em;
  background: var(--code-bg);
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem 0;
  color: var(--faint);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--faint);
}

.footer-inner a:hover {
  color: var(--accent);
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .hero {
    padding: 3rem 0 2.5rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .header-inner {
    justify-content: center;
    text-align: center;
  }

  .site-nav {
    gap: 0.9rem;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
