/**
 * LAOUTS · the public site: home, help, legal, 404, password reset.
 *
 * The app's brand (mobile/src/styles/laouts-quiet-grotesk.tokens.css): parchment, ink, olive,
 * Apfel Grotezk for titles, Uncut Sans for text, the same font files. Pages are written by
 * scripts/build-site-pages.mjs and the legal builders; the header and footer come from
 * scripts/lib/site-chrome.mjs.
 */
@font-face {
  font-family: "Apfel Grotezk";
  src: url("/ui/site/fonts/apfel-grotezk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Uncut Sans";
  src: url("/ui/site/fonts/uncut-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Uncut Sans";
  src: url("/ui/site/fonts/uncut-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F4F2E9;
  --surface: #EAE6D7;
  --paper: #FBFAF5;
  --ink: #2E2C27;
  --body: #4A473E;
  --muted: #6B675C;
  --rule: #CFC9B8;
  --olive: #3F3D2E;
  --on-olive: #F4F2E9;
  --clay: #8C5A2B;
  /* The welcome shelf (mobile/src/styles/welcome.css). */
  --room: #E8E1D2;
  --board: #DDD5C3;
  --board-edge: #CBC1AC;
  --board-foot: #D3CAB6;
  /* Shelf labels: the app's muted is 4.3:1 on the room; this is 5.2:1. */
  --room-label: #5F5B51;
  --title: "Apfel Grotezk", "Helvetica Neue", Arial, sans-serif;
  --text: "Uncut Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --page: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--olive); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--title); font-weight: 400; margin: 0; }
p { margin: 0; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--olive);
  color: var(--on-olive);
  padding: 10px 14px;
  z-index: 10;
}
.skip:focus { left: 12px; top: 12px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-head {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-family: var(--title);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 15px;
  color: var(--body);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* ── Home · hero ────────────────────────────────────────────────────── */
.hero {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) var(--gutter) clamp(48px, 7vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero__title {
  font-size: clamp(48px, 6.4vw, 92px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.hero__promise {
  margin-top: clamp(14px, 1.6vw, 22px);
  font-family: var(--title);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--body);
}
.hero__lede {
  margin-top: 18px;
  max-width: 30em;
  font-size: 17px;
  color: var(--muted);
}
/* Apple: the badge at least 40 px tall, clear space a quarter of its height on every side. */
.store {
  display: inline-block;
  margin-top: clamp(26px, 3vw, 36px);
  padding: 12px;
  margin-left: -12px;
  line-height: 0;
}
.store img { height: 48px; width: auto; display: block; }
.store:hover { opacity: .86; }
.hero__note { margin-top: 2px; font-size: 14px; color: var(--muted); }
/* No badge between them (SITE_APP_LIVE off). */
.hero__lede + .hero__note { margin-top: 14px; }

/* ── Home · hero iPhone ─────────────────────────────────────────────── */
/* 540 × 1140 px recording; 320 px wide here (675 px tall), 360 px at most on phones. */
.hero__phone {
  justify-self: center;
  width: min(100%, 320px);
  aspect-ratio: 540 / 1140;
  margin: 0;
  container-type: inline-size;
}
.hero__phone video,
.hero__poster {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 540 / 1140;
  /* The phone's outline in the 540 px frame: 15 / 9 / 16 / 10 px in, 60 px corners. */
  clip-path: inset(2.778cqw 1.667cqw 2.963cqw 1.852cqw round 11.11cqw);
}
.hero__poster { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hero__phone video { display: none; }
  .hero__poster { display: block; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Home · books (the app's welcome shelf, under the hero) ─────────── */
.books {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 8vw, 112px);
}

/* ── The shelf ──────────────────────────────────────────────────────── */
/* The app's welcome stage is 390 × 540 pt; this shows its books band, y 92 → 540 (448 pt). */
.room {
  position: relative;
  overflow: hidden;
  background: var(--room);
  padding: clamp(8px, 2vw, 28px) 0;
}
.stage {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  aspect-ratio: 390 / 448;
  container-type: inline-size;
}
.stage > * { position: absolute; margin: 0; }
.shelf {
  left: -100vw;
  right: -100vw;
  height: calc(26 / 448 * 100%);
  border-top: 1px solid var(--board-edge);
  background: var(--board);
}
.shelf::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--board-foot);
}
.stage img { display: block; max-width: none; user-select: none; -webkit-user-select: none; }
.stage .label {
  white-space: nowrap;
  font-weight: 500;
  font-size: max(11px, calc(12 / 390 * 100cqw));
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--room-label);
}

/* ── Home · features ────────────────────────────────────────────────── */
.features {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 8vw, 112px);
}
.features__title {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.features__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 56px);
}
.features__list li {
  border-top: 1px solid var(--rule);
  padding: 20px 0 30px;
}
.features__list h3 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.features__list p { color: var(--body); font-size: 16px; line-height: 1.5; max-width: 30em; }

.closing {
  border-top: 1px solid var(--rule);
  margin-top: clamp(8px, 2vw, 24px);
  padding-top: clamp(28px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
}
.closing p { font-family: var(--title); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; letter-spacing: -0.01em; }
.closing .store { margin-top: 0; }

/* ── Reading pages: help, legal, 404, reset ─────────────────────────── */
.doc {
  max-width: calc(760px + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px) var(--gutter) clamp(56px, 8vw, 96px);
}
.doc__kicker {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.doc h1 {
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.doc__lede { font-size: 19px; line-height: 1.5; color: var(--body); max-width: 34em; }
.doc h2 {
  font-size: clamp(26px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 48px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.doc h3 { font-size: 21px; line-height: 1.25; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--body); }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { margin: 10px 0 16px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--ink); font-weight: 500; }
.doc a { color: var(--ink); }
.doc blockquote { margin: 16px 0 24px; padding: 4px 0 4px 18px; border-left: 2px solid var(--rule); }
.doc code { font-size: .92em; }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: 16px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); color: var(--body); }
.doc th { color: var(--ink); font-weight: 500; }
.doc .contact-line { font-family: var(--title); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; margin-top: 6px; }
.doc .contact-line a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.doc .contact-line a:hover { border-bottom-color: var(--olive); }
.doc .small { font-size: 15px; color: var(--muted); }
.toc { list-style: none; padding: 0 !important; margin: 26px 0 0 !important; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.toc a { font-size: 15px; color: var(--body); }
[id] { scroll-margin-top: 16px; }

/* Legal pages keep the class names their builders and the app's extractor read. */
.doc .langSwitch { display: flex; justify-content: flex-end; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.doc .langSwitch a { color: var(--body); }
.doc .langSwitch__on { color: var(--ink); }
.doc .hero__kicker { font-size: 14px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.doc h1.title { font-size: clamp(36px, 4.6vw, 56px); }
.doc .updated { font-size: 14px; color: var(--muted); margin-bottom: 36px; }
.doc .acceptance { background: var(--surface); padding: 20px 22px; margin-bottom: 40px; }
.doc .acceptance h3 { margin-top: 0; font-family: var(--text); font-size: 14px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc ul.legal-rows li { margin-bottom: 12px; }

/* Forms (password reset) */
.field { display: block; margin-top: 18px; }
.field span { display: block; font-size: 14px; font-weight: 500; color: var(--body); margin-bottom: 6px; }
.field input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 12px 14px;
  min-height: 48px;
  border-radius: 0;
}
.field input:focus { outline: 2px solid var(--olive); outline-offset: 0; border-color: var(--olive); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 26px;
  min-height: 52px;
  width: 100%;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--olive);
  color: var(--on-olive);
  font: 500 17px/1 var(--text);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--ink); color: var(--on-olive); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.panel { background: var(--paper); border: 1px solid var(--rule); padding: 20px 22px; margin: 26px 0 8px; }
.panel ul { margin-bottom: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; font-size: 16px; color: var(--body); cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--olive); }
.notice { margin-top: 18px; padding: 14px 16px; font-size: 15px; background: var(--surface); color: var(--ink); }
.notice[hidden] { display: none; }
.notice.is-error { background: #F1E4D6; color: #6E3F17; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.site-foot__inner {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px 40px;
  align-items: start;
}
.site-foot .wordmark { font-size: 22px; min-height: 0; }
.site-foot__links { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 0; padding: 0; list-style: none; }
.site-foot__links a,
.site-foot__lang a,
.site-foot__lang span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  font-size: 15px;
  color: var(--body);
  text-decoration: none;
}
.site-foot__links a:hover, .site-foot__lang a:hover { color: var(--ink); text-decoration: underline; }
.site-foot__links a[aria-current="page"] { color: var(--ink); }
.site-foot__lang { display: flex; align-items: center; white-space: nowrap; }
.site-foot__lang span[aria-current] { color: var(--ink); }
.site-foot__lang .sep { padding: 0; color: var(--muted); }
.site-foot__legal {
  grid-column: 1 / -1;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

/* ── Narrow screens ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .features__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero__text { max-width: 36em; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-left: 0; padding-right: 0; gap: 28px; }
  .hero__text { padding: 0 var(--gutter); }
  .hero__phone { width: min(100% - 2 * var(--gutter), 360px); }
  .books { padding-left: 0; padding-right: 0; }
  .store img { height: 46px; }
  .features__list { grid-template-columns: 1fr; }
  .features__list li { padding: 16px 0 20px; }
  .closing { flex-direction: column; align-items: flex-start; }
  .site-foot__inner { grid-template-columns: 1fr; gap: 10px; }
  .site-foot__links a, .site-foot__lang a, .site-foot__lang span { padding: 0 12px 0 0; min-height: 44px; }
  .site-foot__lang .sep { padding: 0 12px 0 0; }
  .doc__lede { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
