/* SpokenSync website. Colours are the app's own (src/ui/theme.ts in the app repo): LIGHT and DARK palettes. */
:root {
  --bg: #F6F2EA;
  --surface: #FFFDF9;
  --surface-alt: #EDE6D9;
  --paper: #F4ECD8;
  --text: #1F1A15;
  --muted: #675D52;
  --faint: #9A8F82;
  --border: #E0D6C6;
  --accent: #A3441C;
  --accent-text: #FFFFFF;
  --accent-soft: #F3DCCD;
  --highlight: #F0D49A;
  --word: #E6A53E;
  --shadow: 0 30px 60px -28px rgba(70, 40, 15, 0.45), 0 12px 24px -16px rgba(70, 40, 15, 0.3);
  --serif: ui-serif, "New York", "Iowan Old Style", "Charter", "Georgia", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120F;
    --surface: #1D1A16;
    --surface-alt: #29251F;
    --paper: #1C1B19;
    --text: #F0E9DF;
    --muted: #ADA295;
    --faint: #786E62;
    --border: #36302A;
    --accent: #E58457;
    --accent-text: #1C0E06;
    --accent-soft: #3D2619;
    --highlight: #6E5A22;
    --word: #A87A1E;
    --shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.8), 0 12px 24px -16px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav .btn { color: var(--accent-text); white-space: nowrap; }
.show-sm { display: none; }
@media (max-width: 640px) {
  .nav { gap: 14px; }
  .nav .hide-sm { display: none; }
  .nav .show-sm { display: inline; }
  .nav .btn { padding: 0 16px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font: 600 15px/1 var(--sans); text-decoration: none; border: 0; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 16px; }

/* Store buttons (not yet released) */
.store {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 54px; padding: 8px 20px 8px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.store svg { width: 26px; height: 26px; color: var(--muted); flex: none; }
.store small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.store strong { display: block; font-size: 17px; line-height: 1.2; }

/* Hero */
.hero { padding: 72px 0 40px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(40px, 6.4vw, 76px); line-height: 1.16; letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.hero .lede { font-size: clamp(18px, 2vw, 20px); color: var(--muted); max-width: 34em; margin: 0 0 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store-row { margin-top: 12px; }
@media (max-width: 480px) {
  .store-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .store { padding: 8px 12px; gap: 10px; min-height: 52px; }
  .store svg { width: 22px; height: 22px; }
  .store strong { font-size: 15px; }
}

/* The headline reads itself: a sentence highlight with a word moving through it. */
.ra { display: inline; }
.ra .s { background: var(--highlight); border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 0 0.08em; }
/* Positioned, so each word paints above the next line's sentence highlight (descenders stay visible). */
.ra .w { position: relative; border-radius: 6px; animation: word 6s infinite steps(1, end); }
.ra .w:nth-child(2) { animation-delay: 0.6s; }
.ra .w:nth-child(3) { animation-delay: 1.2s; }
.ra .w:nth-child(4) { animation-delay: 1.8s; }
.ra .w:nth-child(5) { animation-delay: 2.4s; }
@keyframes word { 0% { background: var(--word); } 10% { background: transparent; } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .ra .w { animation: none; } .ra .w.still { background: var(--word); } }

/* Phones */
.phones { position: relative; height: 640px; }
.phone {
  position: absolute; width: 290px; aspect-ratio: 603 / 1311;
  border-radius: 46px; padding: 9px; background: #1A1714;
  box-shadow: var(--shadow), inset 0 0 0 1.5px #3A332C;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 38px; }
.phone.back { right: 4%; top: 0; transform: rotate(4deg); }
.phone.front { left: 4%; top: 40px; transform: rotate(-3deg); }

@media (max-width: 900px) {
  .hero { padding-top: 48px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .phones { height: 540px; max-width: 520px; width: 100%; margin-inline: auto; }
  .phone { width: 240px; border-radius: 38px; padding: 8px; }
  .phone img { border-radius: 31px; }
}
@media (max-width: 480px) {
  .phones { height: 430px; }
  .phone { width: 190px; border-radius: 32px; padding: 7px; }
  .phone img { border-radius: 26px; }
  .phone.front { left: 0; }
  .phone.back { right: 0; }
}

/* Platforms */
.platforms { margin-top: 36px; }
.platforms > p { font-size: 14px; color: var(--faint); margin: 0 0 14px; }
.platform-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-width: 620px; }
.platform {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; text-align: center;
}
.platform svg { width: 26px; height: 26px; }
.platform span { font-size: 13px; font-weight: 600; line-height: 1.2; }
.platform em { font-style: normal; font-size: 11px; color: var(--faint); }
a.platform { border-color: var(--accent); }
a.platform em { color: var(--accent); font-weight: 700; }
a.platform:hover { background: var(--accent-soft); }
@media (max-width: 560px) { .platform-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Sections */
section { padding: 88px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2, .band h2 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 14px;
}
.section-head p { color: var(--muted); margin: 0; font-size: 18px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); font-weight: 700; margin-bottom: 18px;
}
.step h3 { margin: 0 0 8px; font-size: 20px; }
.step p { margin: 0; color: var(--muted); font-size: 16px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 4px 4px 4px 0; }
.feature svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; font-size: 19px; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) { .steps, .features { grid-template-columns: 1fr; } }

.band { background: var(--surface); border-block: 1px solid var(--border); }
.band .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.band p { color: var(--muted); font-size: 18px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; }
.checks svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 3px; }
@media (max-width: 860px) { .band .wrap { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { padding: 48px 0 56px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--border); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer p { margin: 0 0 6px; }

/* Text pages (privacy, support) */
.page-hero { padding: 64px 0 24px; }
.page-hero h1 { font-family: var(--serif); font-size: clamp(38px, 5vw, 56px); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 14px; }
.page-hero p { color: var(--muted); font-size: 18px; margin: 0 0 8px; }
.summary {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent);
  border-radius: 16px; padding: 22px 26px; margin: 24px 0 8px;
}
.summary h2 { font-size: 18px; margin: 0 0 8px; font-family: var(--sans); }
.summary ul { margin: 0; padding-left: 20px; }
.summary li { margin: 4px 0; }
.prose { padding: 24px 0 88px; }
.prose h2 { font-family: var(--serif); font-size: 28px; line-height: 1.2; margin: 48px 0 12px; scroll-margin-top: 84px; }
.prose h3 { font-size: 18px; margin: 28px 0 6px; }
.prose p, .prose li { color: var(--text); }
.prose li { margin: 6px 0; }
.prose .muted { color: var(--muted); }
.toc { background: var(--surface-alt); border-radius: 16px; padding: 18px 22px; margin: 16px 0 0; }
.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.toc li { margin: 3px 0; font-size: 15px; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.card h2 { font-family: var(--sans); font-size: 18px; margin: 0 0 6px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.card a { font-weight: 600; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

.faq details { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 36px 16px 0; position: relative;
  font-weight: 600; font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details > div { padding: 0 0 18px; color: var(--muted); }
.faq details > div p { color: var(--muted); margin: 0 0 10px; }
