/* Anomalia — legal pages (privacy.html, terms.html)
   Extends styles.css (loaded first) for variables, fonts, base reset.
   Adds legal-specific styles: page wrapper, doc title, TOC, callouts, glossary, footer.
   Print styles preserve a paper-friendly light theme.
*/

.page {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) 24px 80px;
}

header.brand {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  line-height: 1.1;
}

.brand-tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.9375rem;
  margin: 0;
  letter-spacing: 0.01em;
}

h1.doc-title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 500;
  margin: 40px 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.doc-meta {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin: 0 0 48px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 500;
  margin: 64px 0 16px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
  scroll-margin-top: 16px;
}

h2 .num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 12px;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 32px 0 12px;
  line-height: 1.3;
  color: var(--accent);
  letter-spacing: -0.005em;
}

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease-out, color 150ms ease-out;
}
a:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }

ul, ol { padding-left: 24px; margin: 0 0 16px; }
li { margin-bottom: 8px; }
li:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; color: var(--text); }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.toc {
  background: var(--accent-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px 20px;
  margin: 8px 0 56px;
  font-size: 0.9375rem;
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 500;
}

.toc ol { padding-left: 22px; margin: 0; column-count: 1; }
.toc li { margin-bottom: 6px; line-height: 1.4; break-inside: avoid; }
.toc a {
  color: var(--text);
  border-bottom: none;
}
.toc a:hover { color: var(--accent); }

@media (min-width: 640px) {
  .toc ol { column-count: 2; column-gap: 32px; }
}

.callout {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9375rem;
}
.callout p:last-child { margin-bottom: 0; }

.glossary {
  margin-top: 24px;
  padding: 24px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.glossary dt {
  font-weight: 600;
  color: var(--text);
  margin-top: 16px;
  font-family: var(--font-display);
}
.glossary dt:first-of-type { margin-top: 4px; }
.glossary dd {
  margin: 6px 0 0 0;
  color: var(--text-muted);
}

footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

footer a { color: var(--text-muted); border-bottom: none; }
footer a:hover { color: var(--accent); }

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 40px 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  display: inline-block;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 16px;
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .page { max-width: none; padding: 0.5in 0.6in; }
  .toc, .glossary, .callout {
    background: transparent;
    border: 1px solid #999;
    page-break-inside: avoid;
  }
  .callout { border-left: 3px solid #000; }
  h1.doc-title { font-size: 22pt; }
  h2 { font-size: 14pt; page-break-after: avoid; }
  h3 { font-size: 12pt; page-break-after: avoid; }
  a { color: #000; text-decoration: none; border-bottom: none; }
  a[href^="http"]::after, a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
    word-break: break-all;
  }
  .no-print, .skip-link { display: none; }
  footer { font-size: 10pt; }
  .toc ol { column-count: 1; }
}
