/* ─────────────────────────────────────────────────────────────
   Respite — shared styles for the legal / support pages.
   Tokens mirror apps/migraine/Reprieve/Resources/Assets.xcassets
   ("Quiet Dark" designed default + "Soft Light" alternative).
   Display face is Fraunces (the app's "Humane" type direction),
   self-hosted from fonts/ (OFL) — no font CDN, no analytics, no
   cookies, no external requests.
   ───────────────────────────────────────────────────────────── */

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

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces72pt-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces72pt-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --bg-primary:     #F4F6F7;
  --bg-secondary:   #FCFDFD;
  --field:          #EDEFF1;
  --accent:         #2E6B7B;
  --accent-subtle:  #E1EDF0;
  --emphasis:       #B07A2E;
  --border:         #E2E6E9;
  --text-primary:   #1A2024;
  --text-secondary: #566069;

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Fraunces', ui-serif, 'New York', Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --duration: 240ms;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:     #14181C;
    --bg-secondary:   #1D2329;
    --field:          #1D2329;
    --accent:         #5FA8B8;
    --accent-subtle:  #21333A;
    --emphasis:       #D9A85C;
    --border:         #2C343B;
    --text-primary:   #E8ECEF;
    --text-secondary: #A7B0B8;
  }
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}
.nav-inner {
  max-width: 760px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.wordmark {
  font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.wordmark .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-subtle); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
}
.wordmark .mark svg { width: 15px; height: 15px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-back {
  font-size: 15px; color: var(--text-secondary); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
  transition: color var(--duration) var(--ease);
}
.nav-back:hover { color: var(--text-primary); }

.container { max-width: 760px; margin: 0 auto; padding: 56px 24px 96px; }

h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 42px); font-weight: 600; letter-spacing: -0.012em; line-height: 1.14; margin-bottom: 12px; }
.lede { font-size: 18px; color: var(--text-secondary); margin-bottom: 16px; }
.updated { font-size: 14px; color: var(--text-secondary); padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }

h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin-top: 44px; margin-bottom: 12px; }
h3 { font-size: 17px; font-weight: 600; margin-top: 24px; margin-bottom: 8px; }
p { margin-bottom: 14px; }
ul { padding-left: 22px; margin-bottom: 16px; }
li { margin-bottom: 8px; }
strong { font-weight: 600; }

.callout {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px; margin: 24px 0;
}
.callout p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 16px; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: 15px; color: var(--text-secondary); padding-bottom: 10px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; font-size: 15px; }
tbody tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

footer { border-top: 1px solid var(--border); padding: 32px 0 56px; }
.footer-inner { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { font-size: 15px; color: var(--text-secondary); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.footer-links a:hover { color: var(--text-primary); }
.footer-legal { font-size: 14px; color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 620px) {
  body { font-size: 16px; }
  .container { padding-top: 40px; }
  /* Tighten the table so it fits a phone without sideways scrolling;
     .table-scroll remains the fallback on anything narrower. */
  th, td { padding: 10px 8px; font-size: 15px; }
}
