/* ───────────────────────────────────────────────────────────────────
   site.css — shared chrome for every FriendShelf page (home + legal).
   Design tokens, base reset, the atmospheric wash, the header lockup,
   and the footer. Page-specific styles (the hero on index.html, the
   document styles in legal.css) load alongside this file and may override.
   Mirrors the app's design system (DESIGN.md / Color+FriendShelf.swift).
   --container is intentionally NOT set here: each page picks its own
   measure (a wide hero vs a narrow reading column).
   ─────────────────────────────────────────────────────────────────── */
:root {
  --bg:          #F7F1E6;
  --surface:     #FCF7EE;
  --fg:          #3D352B;
  --muted:       #6E6353;
  --border:      rgba(61, 53, 43, 0.10);
  --accent:      #C77E70;
  --accent-deep: #A65F52;
  --accent-ink:  #9A5346;   /* accent as text on cream: passes AA (5.05:1) */

  --font-display: 'Newsreader', Georgia, 'Iowan Old Style', ui-serif, serif;
  --font-body:    'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --gutter: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 500;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
/* Atmospheric washes on a fixed, GPU-composited layer the content scrolls
   over. Same always-present look as background-attachment:fixed, without the
   per-frame background repaint that one costs while scrolling (esp. mobile). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(900px 600px at 88% -12%, rgba(199, 126, 112, 0.10), transparent 60%),
    radial-gradient(700px 500px at -10% 90%, rgba(168, 184, 154, 0.10), transparent 60%);
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }

/* Visually hidden, still announced to screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}

/* ── Header lockup (the hand-painted four-book BarsLogo + wordmark) ──── */
.topnav { padding-block: clamp(16px, 2.4vh, 26px); }
.topnav .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
/* The mark sits directly on the cream like the app's BrandMarkView; the
   painted books' mass reads ~7% high, so nudge it down to optically
   centre it against the wordmark. */
.brand-mark {
  height: clamp(28px, 3.4vh, 36px); width: auto;
  transform: translateY(-5%);
}
.brand-name {
  font-size: clamp(19px, 2.5vh, 23px);
  color: var(--fg);
  letter-spacing: -0.01em;
}
/* Wordmark = Newsreader 500, "friend" italic + "shelf" upright, all ink. */
.brand-name strong { font-weight: 500; }
.brand-name em { font-style: italic; font-weight: 500; }

/* ── Footer ─────────────────────────────────────────────────────────
   Desktop: wordmark left, links right. Phones: a centred vertical stack
   with thumb-sized rows; links reflow as whole words (white-space:nowrap). */
.pagefoot {
  padding-block: clamp(20px, 3vh, 32px);
  border-top: 1px solid var(--border);
}
.pagefoot .inner {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 8px 28px;
  font-size: 13px; color: var(--muted);
}
.pagefoot .links {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 2px 22px;
}
.pagefoot a { color: var(--muted); transition: color 0.15s ease; }
.pagefoot .links a { white-space: nowrap; padding: 8px 2px; }
.pagefoot a:hover { color: var(--fg); }
/* Current page reads via weight + colour, not colour alone (forced-colors). */
.pagefoot a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.pagefoot .wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 680px) {
  .brand-name { font-size: 19px; }
}
@media (max-width: 600px) {
  .pagefoot .inner {
    flex-direction: column-reverse;   /* links above, © beneath */
    align-items: stretch;
    gap: 4px; text-align: center;
  }
  .pagefoot .links { flex-direction: column; gap: 0; }
  .pagefoot .links a { padding: 12px; white-space: normal; }   /* ~44px tap target; long/translated links wrap instead of clipping */
  .pagefoot .wordmark { margin-top: 12px; }
}
