/* Shared chrome for narraloud.com: tokens, Newsreader faces, header
   wordmark, footer, type scale, and the index hero with the CSS-only
   QR morph. No JavaScript anywhere on this site. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/Newsreader-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/Newsreader-Italic-latin.woff2) format("woff2");
}

:root {
  --paper: #FAFAF8;
  --ink: #1A1A18;
  --muted: #55524C;
  --accent: #C0510F;
  --mark: #F07033;
  --rule: #E7E3DB;
  --card: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121210;
    --ink: #F2F1ED;
    --muted: #A8A49C;
    --accent: #F0854D;
    --rule: #2E2C28;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: ui-sans-serif, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
}

.serif {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-optical-sizing: auto;
}

/* Header wordmark: the mark plus Narraloud in Newsreader. */
header { padding: 1.25rem 1.5rem; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
}
.wordmark svg { height: 0.95em; width: auto; color: var(--mark); }

main { flex: 1; }

/* Prose pages (privacy, terms, support). */
.prose {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.prose h1 {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 420;
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 1.5rem 0 0.35rem;
}
.prose h2 {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 2.25rem 0 0.5rem;
}
.dateline {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 1.75rem;
}
.prose a { color: var(--accent); }

footer {
  text-align: center;
  padding: 1.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
footer a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 0.6rem;
}
footer a:hover { text-decoration: underline; }

/* Index hero: one subject, one action. */
.hero-main {
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem 3rem;
}
.hero { text-align: center; max-width: 38rem; }
.hero-mark { height: 3.25rem; width: auto; color: var(--mark); }
.hero h1 {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 420;
  font-size: clamp(2.6rem, 8vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 1rem 0 1.25rem;
}
.hero h1 em {
  font-style: italic;
  font-weight: 440;
}
.blurb {
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto 2.5rem;
}

/* The Get-the-app control. On touch devices it is a plain App Store
   button. On hover-capable fine-pointer devices (the desktop signal)
   the button morphs into a scannable QR card on hover -- pure CSS.
   The wrapper keeps the button's flow size so the morph overlays
   instead of shifting layout. */
.get {
  position: relative;
  width: 17rem;
  height: 3.5rem;
  margin: 0 auto;
}
.get-app {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 17rem;
  height: 3.5rem;
  overflow: hidden;
  display: block;
  border: 1.5px solid var(--accent);
  border-radius: 2rem;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  z-index: 1;
  transition: width 0.35s ease, height 0.35s ease, border-radius 0.35s ease,
    background-color 0.35s ease, border-color 0.35s ease;
}
.get-label {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}
.get-qr { display: none; }

@media (hover: hover) and (pointer: fine) {
  .get-qr {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.25s ease 0.08s, transform 0.3s ease 0.08s;
  }
  /* The QR card stays paper-on-ink in both schemes so cameras can scan it. */
  .get-qr img { width: 10.5rem; height: 10.5rem; display: block; }
  .get-caption {
    font-family: "Newsreader", ui-serif, Georgia, serif;
    font-style: italic;
    font-weight: 450;
    font-size: 0.95rem;
    color: #55524C;
  }
  .get-app:hover,
  .get-app:focus-visible {
    width: 17rem;
    height: 16.75rem;
    border-radius: 1.25rem;
    background: #FFFFFF;
    border-color: #E7E3DB;
  }
  .get-app:hover .get-label,
  .get-app:focus-visible .get-label { opacity: 0; }
  .get-app:hover .get-qr,
  .get-app:focus-visible .get-qr {
    opacity: 1;
    transform: none;
  }
}

/* Plain pill link (404 back link). */
.get-app-plain {
  display: inline-block;
  padding: 0.65rem 1.75rem;
  border: 1.5px solid var(--accent);
  border-radius: 2rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.get-app-plain:hover {
  background: var(--accent);
  color: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
  .get-app, .get-label, .get-qr { transition: none; }
}
