/* ==========================================================================
   Levelan — legal & support page shell
   Shares color tokens, type, and header/footer language with styles-v2.css
   (Archivo display, Inter body, deep-navy ground, blue/violet accent) so
   /support, /privacy, /health-privacy, and /terms read as part of the same
   site rather than a bolted-on legal template.
   ========================================================================== */

:root {
  --bg-0: #060812;
  --panel: #10162e;
  --line: rgba(155, 165, 220, 0.16);
  --line-strong: rgba(155, 165, 220, 0.28);

  --text: #eceff8;
  --muted: #a7b0cf;
  --faint: #7a84ac;

  --blue: #3b82f6;
  --blue-lift: #7ab0ff;
  --violet: #8b5cf6;
  --ember: #fb923c;

  --font-d: "Archivo", "Helvetica Neue", sans-serif;
  --font-b: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --well: 760px;
  --pad: clamp(20px, 5vw, 40px);
  --nav-h: 56px;
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-lift); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #fff; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue-lift);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Header ── */
.legalnav {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--nav-h);
  background: rgba(6, 8, 18, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.legalnav__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--pad);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.legalnav__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  padding: 10px 0;
}
.legalnav__brand img { width: 22px; height: 22px; }
.legalnav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
  font-size: 0.88rem;
}
.legalnav__links a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 0;
}
.legalnav__links a:hover { color: var(--text); }
.legalnav__links a[aria-current="page"] {
  color: var(--text);
  border-bottom: 2px solid var(--blue);
}

/* ── Content ── */
main {
  max-width: var(--well);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) var(--pad) clamp(40px, 8vw, 72px);
}

h1 {
  font-family: var(--font-d);
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.3em;
}
.updated {
  font-size: 0.9rem;
  color: var(--faint);
  margin-bottom: 1.75rem;
}
h2 {
  font-family: var(--font-d);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.2em 0 0.65em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
h2:first-of-type { margin-top: 1.6em; }
h3 {
  font-family: var(--font-d);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.4em 0 0.5em;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
p { margin: 0.6em 0 1.1em; color: var(--text); }
ul, ol { margin: 0.6em 0 1.1em; padding-left: 1.4em; }
li { margin: 0.4em 0; }
strong { color: #fff; }

/* ── Tables (kept usable at 320px via horizontal scroll, not clipping) ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  padding: 0.65em 0.85em;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--panel);
  font-weight: 700;
  font-family: var(--font-d);
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }

/* ── Callouts ── */
.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 1.1em 1.3em;
  margin: 1.6em 0;
  font-size: 0.95rem;
}
.box strong.box-label {
  display: block;
  margin-bottom: 0.4em;
  color: #fff;
  font-family: var(--font-d);
}
.box--warn { border-left-color: var(--ember); }

/* ── Table of contents ── */
.toc { margin: 1.6em 0 2em; }
.toc-label {
  font-family: var(--font-d);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6em;
}
.toc ol { list-style: none; padding-left: 0; margin: 0; display: grid; gap: 0.4em; }
.toc a { color: var(--muted); text-decoration: none; font-size: 0.94rem; }
.toc a:hover { color: var(--blue-lift); text-decoration: underline; }

/* ── Footer (mirrors index.html .footer) ── */
.footer { padding: 48px 0 40px; border-top: 1px solid var(--line); }
.footer__inner {
  max-width: var(--well);
  margin: 0 auto;
  padding: 0 var(--pad) 32px;
  display: flex; flex-wrap: wrap; gap: 40px;
  justify-content: space-between;
}
.footer__brand-block { max-width: 260px; }
.footer__brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-d); font-weight: 700; font-size: 1rem;
  color: var(--text); text-decoration: none;
}
.footer__brand img { width: 22px; height: 22px; }
.footer__tagline { font-size: 0.85rem; color: var(--faint); margin-top: 8px; line-height: 1.5; }
.footer__cols { display: flex; flex-wrap: wrap; gap: 40px 56px; }
.footer__col { display: flex; flex-direction: column; gap: 10px; min-width: 140px; }
.footer__col-title {
  font-family: var(--font-d); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 2px;
}
.footer__col a { font-size: 0.88rem; color: var(--muted); text-decoration: none; }
.footer__col a:hover { color: var(--text); }
.footer__bottom {
  max-width: var(--well);
  margin: 0 auto;
  padding: 24px var(--pad) 0;
  border-top: 1px solid var(--line);
}
.footer__copy { font-size: 0.78rem; color: var(--faint); }

/* ── Reduced motion / print / small screens ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 480px) {
  .legalnav__links { gap: 12px 16px; font-size: 0.84rem; }
}

@media print {
  .legalnav { position: static; background: #fff; border-bottom: 1px solid #ccc; }
  body { background: #fff; color: #111; }
  main { max-width: 100%; padding: 0 8px; }
  a { color: #0645ad; text-decoration: underline; }
  a[href^="http"]::after,
  a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  h1, h2, h3, .legalnav__brand, .footer__brand, th { color: #111; }
  h2 { break-after: avoid; border-bottom-color: #ccc; }
  .box { background: #f4f4f4; border-color: #ccc; }
  table, th, td { border-color: #ccc; }
  th { background: #eee; }
  .footer { border-top-color: #ccc; }
}
