/* Paperwire landing page: a light, airy page. The brand colours are the
   app's Warm Paper theme (FolioReader/ReaderSettings.swift); the spoken
   word and sentence colours are the app's read-along highlight. */

:root {
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Newsreader", "New York", Georgia, serif;

  --page: #FFFFFF;
  --ink: #1D1A17;
  --muted: #6F665E;
  --line: #ECE6DD;
  --field: #F7F4EF;
  --panel: #FAF7F2;
  --accent: #9A4B1C;
  --amber: #E0A458;
  --word: #F7D78C;
  --block: #F5EDDD;

  --wrap: 1040px;
  --gutter: 24px;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(29, 26, 23, 0.04), 0 12px 32px -12px rgba(29, 26, 23, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 30; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Top bar ---------- */

.topbar { position: sticky; top: 0; z-index: 20; transition: background-color 0.2s ease, box-shadow 0.2s ease; }
.topbar.is-scrolled { background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); box-shadow: 0 1px 0 var(--line); }
.topbar-row { display: flex; align-items: center; gap: 28px; height: 72px; }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: #fff; box-shadow: 0 0 0 1px var(--line), 0 4px 14px -6px rgba(29, 26, 23, 0.16);
  color: var(--accent); margin-right: auto;
}
.badge svg { width: 20px; height: 20px; }
.badge-sep { width: 1px; height: 18px; background: var(--line); }

.topbar nav { display: flex; gap: 26px; }
.topbar nav a { text-decoration: none; font-weight: 500; font-size: 0.97rem; color: var(--muted); transition: color 0.15s ease; }
.topbar nav a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px;
  font: 600 0.98rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-accent { background: linear-gradient(180deg, #B25A26, var(--accent)); color: #fff; box-shadow: 0 8px 20px -8px rgba(154, 75, 28, 0.6); }
.btn-accent:hover { box-shadow: 0 12px 26px -8px rgba(154, 75, 28, 0.7); }
.btn-line { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.btn-line:hover { box-shadow: 0 0 0 1px #D6CDC1; }

/* ---------- Hero ---------- */

.hero {
  padding: 40px 0 72px;
  margin-top: -72px;
  padding-top: 132px;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(247, 215, 140, 0.42), rgba(247, 215, 140, 0) 70%),
    radial-gradient(40% 40% at 85% 10%, rgba(224, 164, 88, 0.16), rgba(224, 164, 88, 0) 70%),
    linear-gradient(180deg, #FFFBF3 0%, #FFFFFF 62%);
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.wordmark { display: inline-flex; align-items: center; gap: clamp(14px, 2vw, 22px); font: 600 clamp(3.4rem, 2rem + 6vw, 6.4rem)/1 var(--serif); letter-spacing: -0.03em; font-variation-settings: "opsz" 72; }
.wordmark img { width: clamp(60px, 4rem + 2vw, 88px); height: auto; border-radius: 22%; box-shadow: 0 12px 30px -12px rgba(43, 36, 32, 0.55); }

.hero-line { margin-top: 28px; font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); font-weight: 500; color: #3A332D; }
.hero-sub { margin-top: 10px; font-size: 1.08rem; color: var(--muted); max-width: 36rem; }
.hero-sub a { color: var(--accent); font-weight: 600; text-decoration: none; }
.hero-sub a:hover { text-decoration: underline; }

/* The live phones in the hero, set out like the screenshots were: Listen and a
   story on either side, Today raised in front. Each slot composes its resting
   offset (--fx, --fy, --fr) with the scroll depth main.js sets (--py). */
.hero { overflow-x: clip; }
.live { width: 100%; margin-top: 56px; display: flex; flex-direction: column; align-items: center; }
.slot { position: relative; --fx: 0px; --fy: 0px; --py: 0px; --fr: 0deg; transform: translate(var(--fx), calc(var(--fy) + var(--py))) rotate(var(--fr)); }
.trio-live { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(16px, 3vw, 40px); }
.trio-live .center { z-index: 2; --fy: -14px; }
.trio-live .center .iphone { --phone-w: clamp(280px, 25vw, 330px); }
.trio-live .side .iphone { --phone-w: clamp(220px, 21vw, 290px); }
.trio-live .left { justify-self: end; --fy: 44px; }
.trio-live .right { justify-self: start; --fy: 44px; }
.live .switch { margin-top: 30px; }
.live-info { width: min(900px, 100%); margin-top: 36px; display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 12px; align-items: start; text-align: left; }

.try { padding: 18px 20px 16px; background: #fff; border-radius: 18px; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.try-h { font: 500 0.72rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.try ol { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.try li { counter-increment: step; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.98rem; line-height: 1.4; color: #3A332D; }
.try li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--field); color: var(--accent); font: 600 0.8rem/1 var(--mono); }
.try-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--muted); }

/* Warm Paper or Midnight, for the phone beside it. */
.switch { display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 6px 16px -8px rgba(29, 26, 23, 0.2); }
.switch button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border: 0; border-radius: 999px; background: none; cursor: pointer; font: 600 0.9rem/1 var(--sans); color: var(--muted); transition: background-color 0.2s ease, color 0.2s ease; }
.switch button:hover { color: var(--ink); }
.switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.switch .sw { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.4); }

.fact-card { margin: 0; padding: 4px 18px; background: #fff; border-radius: 16px; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.fact-card div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.fact-card div + div { border-top: 1px solid var(--line); }
.fact-card dt { color: #3A332D; }
.fact-card dd { margin: 0; color: var(--accent); font-weight: 600; }

/* ---------- Product band and features ---------- */

.band { padding: 24px 0 40px; }

.stage {
  margin: 0; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 48px);
  border-radius: 28px; background: var(--panel);
  box-shadow: 0 0 0 1px var(--line);
  display: flex; justify-content: center;
  overflow: hidden;
}
.stage-wide {
  background:
    radial-gradient(70% 80% at 50% 100%, rgba(247, 215, 140, 0.35), rgba(247, 215, 140, 0) 70%),
    var(--panel);
}

/* Two live phones side by side, the second set lower, as the screenshots were. */
.stage-live { flex-direction: column; align-items: center; gap: 8px; }
.duo-live { display: grid; grid-template-columns: auto auto; align-items: start; gap: clamp(24px, 5vw, 64px); padding-bottom: 96px; }
.duo-live .iphone { --phone-w: clamp(260px, 26vw, 300px); }
.duo-live .lower { --fy: 64px; }
.onair { width: min(640px, 100%); padding: 22px 24px; border-radius: 20px; background: #15171C; color: #D9D4CA; box-shadow: 0 24px 50px -28px rgba(21, 23, 28, 0.75); }
.onair-label { display: flex; align-items: center; gap: 8px; font: 500 0.72rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #E0A458; }
.onair-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #5E5B57; }
.onair.is-live .onair-dot { background: #E0A458; }
.onair-text { margin-top: 14px; min-height: 3em; font: 400 1.2rem/1.5 var(--serif); }
.onair-text span { border-radius: 0.2em; transition: background-color 0.12s ease, box-shadow 0.12s ease; }
.onair-text span.on { background: #5B4A22; box-shadow: 0 0 0 0.12em #5B4A22; }
.onair-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid #2A2E37; font-size: 0.88rem; color: #8E8A83; }
@media (prefers-reduced-motion: no-preference) {
  .onair.is-live .onair-dot { animation: onair 1.6s ease-in-out infinite; }
  @keyframes onair { 50% { opacity: 0.3; } }
}


.pill {
  display: table; margin: -18px auto 0; position: relative; z-index: 2;
  padding: 9px 18px; border-radius: 20px; background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 6px 16px -8px rgba(29, 26, 23, 0.2);
  font-size: 0.93rem; color: #3A332D; text-align: center; max-width: calc(100% - 32px);
}

.feature { padding: clamp(72px, 9vw, 112px) 0 0; }

.eyebrow {
  display: inline-block; font: 600 clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem)/1.2 var(--sans);
  letter-spacing: 0.06em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.feature h2 { margin-top: 8px; font: 700 clamp(1.6rem, 1.3rem + 1vw, 2rem)/1.2 var(--sans); letter-spacing: -0.02em; }
.lede { margin-top: 14px; max-width: 46rem; font-size: 1.12rem; line-height: 1.65; color: var(--muted); }
.feature .stage { margin-top: 40px; }

/* Reading themes as small pages. */
.themes { list-style: none; padding: 0; margin: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.theme { display: flex; flex-direction: column; gap: 6px; min-height: 200px; padding: 20px 18px; border-radius: 18px; background: var(--t-bg); color: var(--t-ink); box-shadow: 0 0 0 1px rgba(29, 26, 23, 0.08), 0 14px 28px -20px rgba(29, 26, 23, 0.5); }
.theme-name { font: 500 0.68rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-accent); margin-bottom: 10px; }
.theme-title { font: 600 1.18rem/1.2 var(--serif); font-variation-settings: "opsz" 24; }
.theme-body { margin-top: auto; padding-top: 14px; font: 400 0.98rem/1.5 var(--serif); }
.theme mark { background: var(--t-word); color: inherit; border-radius: 0.2em; box-shadow: 0 0 0 0.1em var(--t-word); }

/* How a station introduces its stories. */
.bulletin { list-style: none; padding: 0; margin: 0; width: min(760px, 100%); display: grid; gap: 10px; }
.bulletin li { display: grid; grid-template-columns: 44px 1fr; align-items: baseline; gap: 12px; padding: 16px 20px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line); font: 400 1.12rem/1.45 var(--serif); }
.bulletin .lang { font: 500 0.75rem/1 var(--mono); letter-spacing: 0.08em; color: var(--accent); }

.tiles { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tiles li { padding: 22px 20px; border-radius: 18px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.tiles h3 { font: 600 1.05rem/1.3 var(--sans); }
.tiles p { margin-top: 8px; color: var(--muted); font-size: 0.95rem; }
.tiles a { color: var(--accent); }

.stage-film { background: #15171C; box-shadow: none; padding: clamp(20px, 4vw, 40px); }
.stage-film video { width: min(420px, 100%); border-radius: 16px; }

/* ---------- Call to action and footer ---------- */

.cta { padding: clamp(80px, 10vw, 128px) 0; }
.cta-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(40px, 6vw, 64px) 24px; border-radius: 28px;
  background:
    radial-gradient(60% 90% at 50% 0%, rgba(247, 215, 140, 0.4), rgba(247, 215, 140, 0) 70%),
    #FFFBF3;
  box-shadow: 0 0 0 1px var(--line);
}
.cta-card img { border-radius: 22%; box-shadow: 0 12px 28px -12px rgba(43, 36, 32, 0.55); }
.cta-card h2 { margin-top: 22px; font: 700 clamp(1.8rem, 1.4rem + 1.4vw, 2.5rem)/1.15 var(--sans); letter-spacing: -0.025em; }
.cta-card p { margin-top: 10px; max-width: 30rem; color: var(--muted); font-size: 1.08rem; }
.cta-actions { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.footer { border-top: 1px solid var(--line); }
.footer-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 24px; padding: 28px 0 36px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.15rem/1 var(--serif); }
.footer-brand img { border-radius: 7px; }
.footer nav { justify-self: end; display: flex; gap: 22px; }
.footer nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.footer nav a:hover { color: var(--ink); }
.footer-note { grid-column: 1 / -1; color: var(--muted); font-size: 0.88rem; }

/* ---------- Reveal on scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .themes, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-info { width: min(560px, 100%); grid-template-columns: 1fr 1fr; }
  .try { grid-column: 1 / -1; }
  .onair-text { min-height: 4.5em; }
}

/* Narrow: the side phones fan out behind the one in front, and peek past it. */
@media (max-width: 820px) {
  .live { margin-top: 44px; }
  .trio-live { display: block; position: relative; width: min(300px, 100%); }
  .trio-live .center { --fy: 0px; }
  .trio-live .center .iphone { --phone-w: 300px; }
  .trio-live .side { position: absolute; z-index: 0; top: 36px; left: 9%; width: 82%; pointer-events: none; }
  .trio-live .side .iphone { --phone-w: 100%; }
  .trio-live .left { --fx: -60%; --fy: 0px; --fr: -6deg; }
  .trio-live .right { --fx: 60%; --fy: 0px; --fr: 6deg; }
}

@media (max-width: 760px) {
  /* Phones side by side become a row you swipe, the second still a little lower. */
  .duo-live { display: flex; width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px 40px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 14px; }
  .duo-live::-webkit-scrollbar { display: none; }
  .duo-live .slot { flex: none; scroll-snap-align: center; }
  .duo-live .iphone { --phone-w: 268px; }
  .duo-live .lower { --fy: 28px; }
  :root { --gutter: 16px; }
  .topbar nav { display: none; }
}

@media (max-width: 520px) {
  .themes, .tiles { grid-template-columns: minmax(0, 1fr); }
  .theme { min-height: 0; }
  .live-info { grid-template-columns: minmax(0, 1fr); }
  .bulletin li { grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 1.02rem; }
  .footer-row { grid-template-columns: minmax(0, 1fr); }
  .footer nav { justify-self: start; }
}

/* ---------- Legal pages ---------- */

.legal-page { background: var(--page); }
.legal-page .topbar { position: sticky; }
.legal-brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; font: 600 1.2rem/1 var(--serif); }
.legal-brand img { border-radius: 7px; }
.topbar nav a[aria-current="page"] { color: var(--ink); }

.legal { max-width: 720px; padding: 56px 0 96px; }
.legal h1 { margin-top: 8px; font: 700 clamp(2rem, 1.6rem + 1.6vw, 2.8rem)/1.1 var(--sans); letter-spacing: -0.025em; }
.legal-meta { margin-top: 10px; color: var(--muted); font: 400 0.85rem/1.4 var(--mono); }
.legal h2 { margin-top: 44px; font: 650 1.3rem/1.3 var(--sans); letter-spacing: -0.01em; }
.legal h3 { margin-top: 24px; font: 600 1.05rem/1.35 var(--sans); }
.legal p, .legal li, .legal address { color: #3A332D; font-size: 1.02rem; line-height: 1.7; }
.legal p { margin-top: 12px; }
.legal ul, .legal ol { margin: 12px 0 0; padding-left: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--accent); }
.legal address { margin-top: 12px; font-style: normal; }
.legal strong { color: var(--ink); }

.legal-summary { margin-top: 32px; padding: 22px 24px; border-radius: 18px; background: #FFFBF3; box-shadow: 0 0 0 1px var(--line); }
.legal-summary h2 { margin-top: 0; font-size: 1.05rem; }
.legal-summary ul { margin-top: 10px; }

.legal-toc { margin-top: 28px; padding: 18px 24px; border-radius: 18px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.legal-toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 32px; }
.legal-toc li { font-size: 0.95rem; break-inside: avoid; }
.legal-toc a { text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }

.legal-alpha { list-style: lower-alpha; }

@media (max-width: 600px) {
  .legal { padding-top: 36px; }
  .legal-toc ol { columns: 1; }
}
