/* ============================================================================
   HOAI legal pages (/privacy, /terms, /delete-account)
   Plain static pages in the v2 Living Swarm look: same tokens, same Space
   Grotesk, same corner header and footer. No build step, no JavaScript needed
   to read them: without a stored choice the theme follows the system.
============================================================================ */

@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:300;font-display:swap;src:url('fonts/space-grotesk-latin-300-normal.woff2') format('woff2')}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/space-grotesk-latin-400-normal.woff2') format('woff2')}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/space-grotesk-latin-500-normal.woff2') format('woff2')}

/* ---------- tokens (copied from v2-swarm/src/style.css) ---------- */
:root,
html[data-theme='dark'] {
  --bg: #262624;
  --bg-soft: #2d2d2b;
  --ink: #f5f5f2;
  --ink-muted: #b8b8b1;
  --ink-subtle: #8a8a83;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --gold: #ffd900;
  --gold-soft: rgba(255, 217, 0, 0.14);
  --accent-ink: #ffd900;
  --scrim: rgba(38, 38, 36, 0.66);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #faf9f5;
    --bg-soft: #f1f0ea;
    --ink: #1a1a18;
    --ink-muted: #4a4a46;
    --ink-subtle: #75756f;
    --hairline: #e8e8e4;
    --hairline-strong: #dcdcd6;
    --gold-soft: rgba(255, 217, 0, 0.22);
    --accent-ink: #8f7400;
    --scrim: rgba(250, 249, 245, 0.78);
    color-scheme: light;
  }
}
html[data-theme='light'] {
  --bg: #faf9f5;
  --bg-soft: #f1f0ea;
  --ink: #1a1a18;
  --ink-muted: #4a4a46;
  --ink-subtle: #75756f;
  --hairline: #e8e8e4;
  --hairline-strong: #dcdcd6;
  --gold-soft: rgba(255, 217, 0, 0.22);
  --accent-ink: #8f7400;
  --scrim: rgba(250, 249, 245, 0.78);
  color-scheme: light;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.65;
  overflow-x: clip;
  transition: background-color 0.45s ease, color 0.45s ease;
}
::selection {
  background: var(--gold);
  color: #1a1a18;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- corner nav (as v2: emblem + toggle) ---------- */
.site-nav nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 26px;
}
.brand,
.theme-toggle {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 9px;
  text-decoration: none;
  color: var(--ink);
}
.brand img {
  display: block;
}
.brand span {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.16em;
}
.theme-toggle {
  display: none; /* shown once the script below runs: it does nothing without it */
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--ink-subtle);
  cursor: pointer;
  gap: 7px;
  padding: 8px 16px;
}
html.js .theme-toggle {
  display: inline-flex;
}
.theme-toggle span {
  transition: color 0.25s ease;
}
html[data-theme='dark'] .t-night,
html[data-theme='light'] .t-day {
  color: var(--ink);
}

/* ---------- the document ---------- */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 88px;
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.legal h1 {
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 10px 0 10px;
}
.legal .updated {
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
}
.legal h2 {
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.3;
  margin: 44px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.legal h3 {
  font-size: 1.02rem;
  font-weight: 500;
  margin: 22px 0 6px;
}
.legal p,
.legal li {
  color: var(--ink-muted);
  font-size: 1.02rem;
}
.legal p + p {
  margin-top: 12px;
}
.legal strong {
  font-weight: 500;
  color: var(--ink);
}
.legal ul,
.legal ol {
  padding-left: 22px;
  margin: 10px 0;
}
.legal li + li {
  margin-top: 8px;
}
.legal a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}
.legal .lead {
  font-size: 1.12rem;
  color: var(--ink);
  margin-top: 22px;
}
.callout {
  margin: 18px 0;
  padding: 14px 18px;
  border: 1px solid var(--hairline-strong);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  background: var(--bg-soft);
}
.callout p {
  color: var(--ink);
}

/* permission table: a table on wide screens, stacked rows on phones */
.perm {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.98rem;
}
.perm th,
.perm td {
  text-align: left;
  vertical-align: top;
  padding: 12px 10px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-muted);
}
.perm th {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.perm td:first-child {
  color: var(--ink);
  font-weight: 400;
  width: 34%;
}
@media (max-width: 560px) {
  .perm thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .perm,
  .perm tbody,
  .perm tr,
  .perm td {
    display: block;
    width: 100%;
  }
  .perm tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--hairline);
  }
  .perm td {
    border: 0;
    padding: 2px 0;
  }
  .perm td:first-child {
    width: 100%;
  }
}

/* ---------- footer (as v2, plus the legal links) ---------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--hairline);
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 26px 48px;
}
.f-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.f-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
}
.f-links a {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-decoration: none;
}
.f-links a:hover,
.f-links a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.f-copy {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ink-subtle);
}

@media (max-width: 560px) {
  .site-nav nav {
    padding: 16px;
  }
  .legal {
    padding: 24px 16px 72px;
  }
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 16px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .theme-toggle span {
    transition: none;
  }
}
