/* ---------- Vytier legal pages (Terms + Privacy) ---------- */
/* Extends the same design tokens from index.html.
   These pages are structured for long-form reading. */

:root,
[data-theme='light'] {
  --color-bg: #f3f8fe;
  --color-surface: #ffffff;
  --color-surface-2: #f8fbfe;
  --color-surface-offset: #e8f1f5;
  --color-surface-offset-2: #d9e8ee;
  --color-divider: #dbe6ec;
  --color-border: #c2d3dc;
  --color-text: #0f3a3a;
  --color-text-muted: #656c78;
  --color-text-faint: #9aa6ae;
  --color-text-inverse: #ffffff;
  --color-primary: #317d3c;
  --color-primary-hover: #266630;
  --color-primary-soft: #d5ecd9;
  --color-accent: #00b6c8;
  --color-accent-soft: #cdeff3;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --radius-sm: 0.4rem;
  --radius-md: 0.65rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(35, 48, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(35, 48, 42, 0.08);
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-narrow: 720px;
  --content-default: 1040px;
}

[data-theme='dark'] {
  --color-bg: #0b1e22;
  --color-surface: #12292d;
  --color-surface-2: #163137;
  --color-surface-offset: #1b3a41;
  --color-divider: #234249;
  --color-border: #315560;
  --color-text: #e6f1f2;
  --color-text-muted: #9fb2b7;
  --color-text-faint: #6a7d82;
  --color-text-inverse: #0b1e22;
  --color-primary: #57c86a;
  --color-primary-hover: #6fd57f;
  --color-primary-soft: #1e3d29;
  --color-accent: #22c6d6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body {
  min-height: 100dvh;
  line-height: 1.7;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
}
a { color: var(--color-primary); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition-interactive), color var(--transition-interactive); }
a:hover { border-bottom-color: var(--color-primary); }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.prose-wrap { max-width: var(--content-narrow); margin: 0 auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

/* ---- Header (same shell as index.html) ---- */
.header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in oklab, var(--color-bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-interactive);
}
.header.is-scrolled { border-bottom-color: var(--color-divider); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-4); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; letter-spacing: -0.01em; color: var(--color-text); border: 0; }
.brand:hover { border: 0; }
.brand svg,
.brand img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  display: inline-grid; place-items: center;
  color: var(--color-text-muted); border: 1px solid transparent;
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-border); }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.75rem 1.15rem; font-size: var(--text-sm); font-weight: 500;
  border-radius: var(--radius-full); border: 1px solid transparent; white-space: nowrap;
}
.btn-ghost { color: var(--color-text); border-color: var(--color-border); background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ---- Page title band ---- */
.legal-hero {
  padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--color-divider);
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
}
.legal-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  color: var(--color-text);
}
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  display: inline-block;
}
.meta {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.meta span + span::before { content: ' · '; margin: 0 0.35rem; color: var(--color-text-faint); }

/* ---- Article layout with sidebar TOC ---- */
.legal-body { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.legal-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 960px) {
  .legal-grid { grid-template-columns: 240px 1fr; }
}
.toc {
  position: sticky;
  top: 5.5rem;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
}
.toc h2 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.toc ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  color: var(--color-text-muted);
  border-bottom: 0;
  display: block;
  padding: 0.25rem 0;
  line-height: 1.45;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--color-text-faint);
  margin-right: 0.55rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
}
.toc a:hover { color: var(--color-primary); }

.prose {
  max-width: 68ch;
  color: var(--color-text);
}
.prose > * + * { margin-top: var(--space-6); }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-xl);
  letter-spacing: -0.015em;
  margin-top: var(--space-12) !important;
  color: var(--color-text);
  scroll-margin-top: 6rem;
}
.prose h2:first-of-type { margin-top: var(--space-6) !important; }
.prose h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-8) !important;
}
.prose p { color: var(--color-text); line-height: 1.75; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { margin-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.prose ul li::marker { color: var(--color-primary); }
.prose strong { color: var(--color-text); font-weight: 600; }
.prose em { font-style: italic; color: var(--color-text-muted); }
.prose blockquote {
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.prose blockquote strong { color: var(--color-text); }
.prose hr { border: 0; height: 1px; background: var(--color-divider); margin: var(--space-10) 0; }

.callout {
  padding: var(--space-6);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.callout strong { color: var(--color-text); }

/* ---- Footer (compact, matches home) ---- */
.footer {
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface);
  padding-block: var(--space-10);
  font-size: var(--text-sm);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-muted);
}
.footer a { color: var(--color-text-muted); border-bottom: 0; }
.footer a:hover { color: var(--color-primary); }
.footer-links { display: flex; gap: var(--space-6); }

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
