/*
 * Shared stylesheet for every page. Colours are injected from config brand.colors
 * by web/build.mjs. Light is the default; dark follows prefers-color-scheme.
 * The accent colour is decorative only (3.4:1 on the light background): never use
 * it for body text. System fonts only, so the site makes no third-party requests.
 */
:root {
  color-scheme: light dark;
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-alt: #F2EDE4;
  --text: #1A2232;
  --text-muted: #5A6372;
  --primary: #1F3A5F;
  --on-primary: #FFFFFF;
  --accent: #B7791F;
  --record: #C8321E;
  --border: #E4DDD1;
  --success: #2E7A4E;
  --danger: #B42318;
  --shadow: 0 1px 2px rgb(26 34 50 / 0.06), 0 12px 32px rgb(26 34 50 / 0.1);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151C;
    --surface: #1A202B;
    --surface-alt: #222A37;
    --text: #F1ECE3;
    --text-muted: #A4ACB9;
    --primary: #8FB3E0;
    --on-primary: #0E1623;
    --accent: #E2B25C;
    --record: #F0624D;
    --border: #2C3443;
    --success: #5FBF86;
    --danger: #F97066;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.45);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  text-decoration-thickness: 0.15em;
}

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

h1,
h2,
h3 {
  font-family: var(--font-serif);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
}

.wrap {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -5rem;
  z-index: 10;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

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

/* ---- Header and footer ------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.nav ul,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.8rem;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.nav a:hover,
.footer-links a:hover,
.nav a[aria-current="page"] {
  background: var(--surface-alt);
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.site-footer .footer-links {
  margin: 0 0 1rem -0.8rem;
}

.site-footer .footer-links a {
  color: var(--text);
}

.small {
  font-size: 0.875rem;
}

/* ---- Landing page ----------------------------------------------------------- */

.hero {
  padding: 2.5rem 0 3rem;
  background: radial-gradient(
    55rem 26rem at 90% -8%,
    color-mix(in srgb, var(--accent) 18%, transparent),
    transparent
  );
}

.hero .wrap {
  display: grid;
  gap: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 8vw, 4rem);
}

.lead {
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.store-badge {
  margin: 1rem 0 1.25rem;
}

.store-badge a {
  display: inline-block;
  border-radius: 9px;
}

/* Apple's artwork, unmodified; at least 40 px tall with clear space around it. */
.store-badge img {
  display: block;
  width: auto;
  height: 54px;
}

.fineprint {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.grid + .fineprint,
.plans + .fineprint {
  margin-top: 1.5rem;
}

.section {
  padding: 3rem 0;
}

.section--alt {
  background: var(--surface-alt);
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
}

.intro {
  max-width: 42rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.card,
.plan {
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3,
.plan h3 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.card p,
.plan p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.card p:last-child,
.plan p:last-child {
  margin-bottom: 0;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 1.25rem 1.4rem 1.25rem 4.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 1.2rem;
  left: 1.25rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

.steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
}

.split {
  display: grid;
  gap: 2rem;
}

.checklist {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 1.9rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 0.15rem;
  width: 0.55rem;
  height: 0.9rem;
  border: solid var(--success);
  border-width: 0 3px 3px 0;
  transform: translateY(-50%) rotate(45deg);
}

/* Example Recap card (HTML and CSS only, no image) */

.recap-figure {
  margin: 0;
}

.recap {
  max-width: 27rem;
  margin-inline: auto;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.recap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.chip--ai {
  border-color: var(--accent);
}

.recap-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
}

.recap-idea {
  margin: 0 0 0.25rem;
}

.recap-label {
  margin: 1.1rem 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.recap ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ts {
  display: inline-block;
  min-width: 3.4rem;
  margin-right: 0.5rem;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-align: center;
}

.verse {
  padding-left: 0.8rem;
  border-left: 3px solid var(--accent);
}

.verse cite {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 600;
}

.figure-note {
  margin: 0.9rem auto 0;
  max-width: 27rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* Pricing */

.plans {
  display: grid;
  gap: 1rem;
}

.plan--featured {
  border: 2px solid var(--primary);
}

.price {
  margin: 0.25rem 0 0.5rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.plan p.price {
  color: var(--text);
}

.per {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
}

/* ---- Legal and support pages ------------------------------------------------ */

.doc {
  max-width: 46rem;
  padding: 2rem 0 1rem;
}

.doc h1 {
  font-size: clamp(2.1rem, 6vw, 2.9rem);
}

.doc h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.6rem;
}

.doc h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.2rem;
}

.doc ul,
.doc ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.doc li {
  margin-bottom: 0.4rem;
}

.meta {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.summary,
.callout {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
}

.summary h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.summary ul,
.callout p:last-child {
  margin-bottom: 0;
}

.toc {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.3rem;
  border-radius: 12px;
  background: var(--surface-alt);
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.toc ol {
  columns: 16rem;
  margin: 0;
  padding-left: 1.3rem;
}

.toc li {
  margin-bottom: 0.3rem;
}

.table-wrap {
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table-wrap table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  background: var(--surface-alt);
  font-weight: 700;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

/* Short tables (such as the subscription plans) must fit a phone without scrolling. */
.table-wrap--compact table {
  min-width: 0;
}

.table-wrap--compact th,
.table-wrap--compact td {
  padding: 0.65rem 0.5rem;
}

.contact-card {
  margin: 1.5rem 0 2.5rem;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}

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

.faq details {
  margin: 0 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  padding: 0.8rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
}

.faq details[open] > summary::after {
  content: "\2212";
}

.faq .answer {
  padding: 0 1.25rem 1.1rem;
}

.faq .answer > :last-child {
  margin-bottom: 0;
}

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

.center .lead {
  margin-inline: auto;
}

/* ---- Wider screens ---------------------------------------------------------- */

@media (min-width: 40em) {
  .grid--2,
  .plans {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 56em) {
  .hero .wrap {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
  }

  .grid--3,
  .plans {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps li {
    padding: 4.5rem 1.4rem 1.25rem;
  }

  .steps li::before {
    top: 1.25rem;
  }

  .split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .section {
    padding: 4.5rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer .footer-links,
  .skip-link,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: inherit;
  }
}
