/* ============================================================================
   legal.css — the reading layout for /privacy/ and /terms/. Layout only: tokens.css carries
   every value and components.css the shared components (brand, skip link, theme toggle, focus
   ring, reduced motion); this sheet is linked after both. A same-origin sheet rather than an
   inline <style> block, because the site's CSP is `style-src 'self'` — an inline block is
   refused in production and the page renders unstyled, while looking fine served locally
   without headers.
   ============================================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* ── Header — the site's brand lockup, so the two surfaces read as one ──────── */
.legal-nav {
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.legal-nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 52rem;
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
}
/* ── The document ───────────────────────────────────────────────────────────── */
.wrap {
  max-width: 44rem;
  margin-inline: auto;
  padding: var(--space-7) var(--space-4) var(--space-8);
}

h1 {
  margin: 0 0 var(--space-2);
  color: var(--ink-heading);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
h2 {
  margin: var(--space-7) 0 var(--space-3);
  color: var(--ink-heading);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-snug);
}
p, li { color: var(--text-secondary); text-wrap: pretty; }
p { margin: 0 0 var(--space-4); }
strong { color: var(--text-primary); font-weight: 650; }

.updated {
  margin: 0 0 var(--space-6);
  color: var(--text-label);
  font-size: var(--text-base);
}

ul { margin: 0 0 var(--space-4); padding-left: 1.35rem; }
li { margin: 0 0 var(--space-2); }
li::marker { color: var(--text-label); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: from-font;
}
a:hover { color: var(--ink-heading); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-7) 0;
}

/* Back to the sales page — a real target, not a 25px-tall line of text. */
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--space-6);
  padding: 0 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-heading);
  font-weight: 650;
  font-size: var(--text-base);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.back:hover { color: var(--accent); border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); }

@media (min-width: 48rem) {
  .wrap { padding-inline: var(--space-5); }
  .legal-nav-inner { padding-inline: var(--space-5); }
}

/* ── Print ──────────────────────────────────────────────────────────────────────
   These two pages are the ones people print, or save as PDF and send to someone who
   checks things — a Terms page is a document before it is a web page. The dark theme
   is deliberately NOT carried to paper: prefers-color-scheme still applies when
   printing in most browsers, and a viewer on a dark OS would otherwise print
   white-on-navy across every page. */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff;
    --text-primary: #000; --text-secondary: #1a1a1a; --text-label: #333;
    --ink-heading: #000; --accent: #000; --line: #bbb; --line-soft: #ddd;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  .legal-nav, .skip-link { display: none; }
  .wrap { max-width: none; padding: 0; }

  /* A reader on paper cannot follow a link, so the destination has to be on the page.
     mailto: is unwrapped to the bare address — "(mailto:sam@devkoe.com)" is noise. */
  a { text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  a[href^="mailto:"]::after { content: ""; }

  /* Never orphan a heading at the foot of a page, and never split a clause across one. */
  h1, h2 { break-after: avoid-page; }
  li, p { break-inside: avoid-page; orphans: 3; widows: 3; }
  .back { display: none; }
}
