/* ============================================================
   TURF RUNNING — static document pages (/privacy, /support)
   ============================================================

   WHY THIS FILE EXISTS, AND WHY IT IS NOT index.html's <style>.
   index.html is a 4,800-line single-file app whose CSS is inline. These
   two pages are static documents with no app behaviour, no Supabase, no
   Leaflet and no JS at all — which is the point: a privacy policy and a
   support page must render for a reviewer, a regulator, or someone whose
   phone just broke, on a bad connection, with scripts blocked. Linking
   them into the app's stylesheet would make a legal document depend on
   the planner's layout, and sharing one file would mean a planner change
   could break the page Apple fetches.

   TOKEN DUPLICATION IS DELIBERATE BUT NOT FREE. The :root block below
   mirrors index.html's, which itself mirrors app/src/theme/tokens.ts
   (docs/DESIGN_TOKENS.md). Three copies drift. Only the values these
   pages actually use are copied, so the surface for drift is small, and
   a colour change that misses this file is a cosmetic mismatch on two
   static pages — never a broken page.
   ============================================================ */

:root {
  --accent:       #FFA500;
  --accent-light: #FFB84D;
  --on-amber:     #1A1005;

  --bg:             #14100F;
  --bg-darker:      #0E0B0A;
  --text:           #F5F1E8;
  --text-secondary: #9C8F88;
  /* Lifted from the app's #7C726B (3.4:1) to clear WCAG AA on web — same
     reasoning as index.html. Do not "restore" it to the app value. */
  --text-tertiary:  #8A7F79;

  --teal:   #7FD4C9;
  --gold:   #DCC48E;
  --danger: #E8827C;

  --surface:   #1D1918;
  --surface-2: #24201E;
  --line:      rgba(245, 241, 232, 0.09);
  --line-2:    rgba(245, 241, 232, 0.18);

  --font-display: 'Merriweather Sans', Helvetica, Arial, sans-serif;
  --font-label:   'Sono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-body:    'Buenard', Georgia, 'Times New Roman', serif;

  --r-badge: 7px;
  --r-row:   18px;
  --r-card:  22px;
  --r-pill:  999px;

  --nav-h: 66px;

  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* The sticky header must not cover a heading jumped to from the
     contents list — without this, #deleting-your-account lands with its
     own title hidden behind the bar. */
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 27px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--on-amber); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-badge);
}

/* ---------- type primitives (names match index.html) ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: -0.028em;
}

.label {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 12px;
  line-height: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.label-sm {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 10px;
  line-height: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ---------- shell ---------- */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(22px, 4vw, 40px);
}

.doc-wrap {
  /* 68ch, because a privacy policy is read, not scanned. */
  max-width: 68ch;
  margin: 0 auto;
  padding: 0 clamp(22px, 5vw, 40px);
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(20, 16, 15, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand img { width: 26px; height: 26px; display: block; }
.brand:hover { color: var(--accent-light); }
.brand span { white-space: nowrap; }

.head-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 26px);
}

/* At 375px the brand and three links together exceed the row, and
   "Turf Running" wraps to two lines inside a 66px bar. The mark plus
   "Turf" still identifies the site, and the links are what someone came
   to this page to use — so the second word goes, not the navigation. */
@media (max-width: 440px) {
  .brand .brand-word { display: none; }
  .head-links { gap: 15px; }
  .head-link { font-size: 10px; letter-spacing: 0.12em; }
}

.head-link {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.head-link:hover { color: var(--text); }
.head-link[aria-current='page'] { color: var(--accent); }

/* ---------- document ---------- */

.doc-header {
  padding: clamp(44px, 7vw, 84px) 0 clamp(26px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(30px, 5vw, 48px);
}

.doc-title {
  font-size: clamp(34px, 7vw, 56px);
  margin: 14px 0 0;
}

.doc-meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.doc-lede {
  font-size: clamp(17px, 2.2vw, 19px);
  line-height: 1.65;
  color: var(--text-secondary);
  margin-top: 22px;
}

.doc-body { padding-bottom: clamp(60px, 9vw, 110px); }

.doc-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 25px);
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: clamp(38px, 5vw, 54px) 0 14px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.doc-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text);
  margin: 28px 0 10px;
}

.doc-body p { color: var(--text-secondary); margin-bottom: 16px; }
.doc-body p strong, .doc-body li strong { color: var(--text); font-weight: 700; }

.doc-body ul, .doc-body ol {
  color: var(--text-secondary);
  margin: 0 0 18px;
  padding-left: 22px;
}

.doc-body li { margin-bottom: 9px; }
.doc-body li::marker { color: var(--teal); }

.doc-body a {
  color: var(--accent);
  text-decoration-color: rgba(255, 165, 0, 0.42);
  text-underline-offset: 3px;
}

.doc-body a:hover { color: var(--accent-light); }

.doc-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: clamp(34px, 5vw, 50px) 0;
}

/* An email address is the one thing on these pages someone needs to
   copy correctly, so it is set in the mono face at full contrast. */
.mail {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--accent);
  word-break: break-word;
}

/* ---------- contents ---------- */

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 3vw, 26px);
}

.toc ol {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  columns: 2;
  column-gap: 26px;
}

.toc li { margin: 0 0 9px; break-inside: avoid; }

.toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
}

.toc a:hover { color: var(--accent); }

@media (max-width: 620px) {
  .toc ol { columns: 1; }
}

/* ---------- callout ---------- */

.note {
  border-left: 2px solid var(--teal);
  background: var(--surface);
  border-radius: 0 var(--r-row) var(--r-row) 0;
  padding: 18px 20px;
  margin: 24px 0;
}

.note p:last-child { margin-bottom: 0; }
.note.warn { border-left-color: var(--danger); }
.note.warn p strong { color: var(--danger); }

/* ---------- table ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-row);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 21px;
  min-width: 520px;
}

th {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-align: left;
  padding: 13px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--text); font-weight: 700; }

/* ---------- support: question cards ---------- */

.faq {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-row);
  padding: 18px 20px;
}

.faq-item h3 { margin-top: 0; }
.faq-item p:last-child { margin-bottom: 0; }

.path {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--gold);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-badge);
  padding: 2px 7px;
  white-space: nowrap;
}

/* ---------- contact panel ---------- */

.contact {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2);
  border-radius: var(--r-card);
  padding: clamp(24px, 4vw, 34px);
  margin: 30px 0;
}

.contact .mail { font-size: clamp(17px, 3vw, 21px); display: inline-block; margin: 12px 0 6px; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--bg-darker);
  padding: 30px 0;
}

.site-foot .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.foot-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.foot-links a {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
}

.foot-links a:hover { color: var(--accent); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-amber);
  font-family: var(--font-label);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 10px 16px;
  z-index: 100;
}

.skip-link:focus { left: 8px; top: 8px; }
