/* Shared styles for the legal pages (legal.html, privacy.html). Tokens match the landing page. */
:root {
  --paper: #F4F7F5;
  --surface: #FFFFFF;
  --sunk: #E8EEEA;
  --ink: #0F1F1A;
  --muted: #4D5E57;
  --line: #D7E0DB;
  --line-strong: #B4C3BB;
  --answer: #11804A;
  --answer-hover: #0C6A3C;
  --answer-ink: #FFFFFF;
  --answer-soft: #DDF1E5;
  --answer-line: #A9DDBF;
  --focus: #11804A;
  --ph-bg: #FFF0BF;
  --ph-ink: #5A4300;
  --note-bg: #EEF2EF;

  --font-display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1411;
    --surface: #121E1A;
    --sunk: #1A2823;
    --ink: #E6EEEA;
    --muted: #9AADA5;
    --line: #23342D;
    --line-strong: #364B42;
    --answer: #3DCB80;
    --answer-hover: #62D898;
    --answer-ink: #05130C;
    --answer-soft: #133828;
    --answer-line: #22593E;
    --focus: #3DCB80;
    --ph-bg: #4A3B0A;
    --ph-ink: #FFE7A3;
    --note-bg: #15221D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0B1411;
  --surface: #121E1A;
  --sunk: #1A2823;
  --ink: #E6EEEA;
  --muted: #9AADA5;
  --line: #23342D;
  --line-strong: #364B42;
  --answer: #3DCB80;
  --answer-hover: #62D898;
  --answer-ink: #05130C;
  --answer-soft: #133828;
  --answer-line: #22593E;
  --focus: #3DCB80;
  --ph-bg: #4A3B0A;
  --ph-ink: #FFE7A3;
  --note-bg: #15221D;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--answer); text-underline-offset: 3px; }
a:hover { color: var(--answer-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 640px) {
  .wrap {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }
}

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 70px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 1.1875rem; letter-spacing: -.02em;
  min-height: 44px;
}
.brand:hover { color: var(--ink); }
.mark { width: 30px; height: 30px; color: var(--answer); flex: none; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: .9375rem; text-decoration: none; }

/* Document */
.doc { padding-block: clamp(40px, 6vw, 80px) clamp(64px, 8vw, 112px); }
.doc-inner { max-width: 46rem; }
.eyebrow { margin: 0 0 14px; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--answer); }
.doc h1 {
  margin: 0 0 12px; font-family: var(--font-display); font-stretch: 125%; font-weight: 800;
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); line-height: 1.04; letter-spacing: -.025em; text-wrap: balance;
}
.updated { margin: 0 0 40px; color: var(--muted); font-size: .9375rem; }
.doc h2 {
  margin: 48px 0 12px; padding-top: 24px; border-top: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance;
}
.doc h3 { margin: 28px 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.35; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 16px; padding-left: 1.25rem; }
.doc li { margin-bottom: 6px; }
.doc address { font-style: normal; margin: 0 0 14px; }
.doc dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; margin: 0 0 16px; }
.doc dt { font-weight: 600; }
.doc dd { margin: 0; min-width: 0; }
.toc { margin: 0 0 8px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.toc p { margin: 0 0 8px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.25rem; columns: 2; column-gap: 32px; }
.toc li { margin-bottom: 0; break-inside: avoid; }
.toc a { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--answer); text-decoration: underline; }
.callout { margin: 16px 0; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--answer-line); background: var(--answer-soft); }
.callout p:last-child { margin-bottom: 0; }

/* Template helpers: delete before going live */
/* Side padding is drawn with box-shadow so wrapped placeholders never stick out of their paragraph. */
.ph { padding: 1px 0; border-radius: 4px; background: var(--ph-bg); color: var(--ph-ink); font-weight: 600; box-shadow: 4px 0 0 var(--ph-bg), -4px 0 0 var(--ph-bg); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.note {
  margin: 12px 0 18px; padding: 12px 16px; border-radius: 12px; border: 1px dashed var(--line-strong);
  background: var(--note-bg); color: var(--muted); font-size: .9063rem; line-height: 1.55;
}
.note strong { color: var(--ink); }
.template-banner {
  margin: 0 0 32px; padding: 16px 20px; border-radius: 14px;
  background: var(--ph-bg); color: var(--ph-ink); font-size: .9375rem; line-height: 1.55;
}
.template-banner strong { display: block; margin-bottom: 4px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px 36px; color: var(--muted); font-size: .875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer .wrap { align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 44px; color: var(--ink); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--answer); }

@media (max-width: 560px) {
  .toc ol { columns: 1; }
  .doc dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .doc dd { margin-bottom: 10px; }
}
