/* NovaSites shared styles: tokens, base, header, footer, buttons, motion, legal pages */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-sunk: #eef1f4;
  --ink: #0b1220;
  --text: #1f2937;
  --muted: #5b6472;
  --line: #e6e8ec;
  --line-strong: #d3d7de;
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-soft: #effbf8;
  --brand-tint: #ccf3ea;
  --brand-glow: rgba(15, 118, 110, 0.18);
  --ok: #15803d;
  --warn: #b45309;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.05);
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 10px 28px -10px rgba(11, 18, 32, 0.14);
  --shadow-lg: 0 2px 4px rgba(11, 18, 32, 0.04), 0 28px 56px -18px rgba(11, 18, 32, 0.24);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --surface: #ffffff;
  --panel: #0b1220;
  --panel-deep: #0b1220;
  --solid: #0b1220;
  --solid-hover: #1e293b;
  --on-solid: #ffffff;
  --on-brand: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.82);
  --ok-soft: #dcfce7;
  --bad: #9f1239;
  --star: #d97706;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --err-line: #fecaca;
  --note-bg: #fff7ed;
  --note-line: #fed7aa;
  --note-text: #7c3d0a;
  --note-strong: #9a3412;
  color-scheme: light;
}

/* Dark theme: follows the system unless the visitor picks one with the header toggle */
:root[data-theme="dark"] {
  --bg: #0a0f1d;
  --bg-soft: #0e1527;
  --bg-sunk: #131b30;
  --surface: #121a2e;
  --ink: #f1f5f9;
  --text: #cbd5e1;
  --muted: #94a3b8;
  --line: #222c46;
  --line-strong: #34405f;
  --brand: #2dd4bf;
  --brand-hover: #5eead4;
  --brand-soft: rgba(45, 212, 191, 0.1);
  --brand-tint: rgba(45, 212, 191, 0.22);
  --brand-glow: rgba(45, 212, 191, 0.22);
  --ok: #4ade80;
  --warn: #fbbf24;
  --panel: #111c33;
  --panel-deep: #060a14;
  --solid: #f1f5f9;
  --solid-hover: #ffffff;
  --on-solid: #0a0f1d;
  --on-brand: #04201c;
  --header-bg: rgba(10, 15, 29, 0.8);
  --ok-soft: rgba(74, 222, 128, 0.14);
  --bad: #fb7185;
  --star: #fbbf24;
  --err: #fca5a5;
  --err-bg: rgba(248, 113, 113, 0.1);
  --err-line: rgba(248, 113, 113, 0.35);
  --note-bg: rgba(251, 146, 60, 0.1);
  --note-line: rgba(251, 146, 60, 0.35);
  --note-text: #fdba74;
  --note-strong: #fed7aa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 56px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1d;
    --bg-soft: #0e1527;
    --bg-sunk: #131b30;
    --surface: #121a2e;
    --ink: #f1f5f9;
    --text: #cbd5e1;
    --muted: #94a3b8;
    --line: #222c46;
    --line-strong: #34405f;
    --brand: #2dd4bf;
    --brand-hover: #5eead4;
    --brand-soft: rgba(45, 212, 191, 0.1);
    --brand-tint: rgba(45, 212, 191, 0.22);
    --brand-glow: rgba(45, 212, 191, 0.22);
    --ok: #4ade80;
    --warn: #fbbf24;
    --panel: #111c33;
    --panel-deep: #060a14;
    --solid: #f1f5f9;
    --solid-hover: #ffffff;
    --on-solid: #0a0f1d;
    --on-brand: #04201c;
    --header-bg: rgba(10, 15, 29, 0.8);
    --ok-soft: rgba(74, 222, 128, 0.14);
    --bad: #fb7185;
    --star: #fbbf24;
    --err: #fca5a5;
    --err-bg: rgba(248, 113, 113, 0.1);
    --err-line: rgba(248, 113, 113, 0.35);
    --note-bg: rgba(251, 146, 60, 0.1);
    --note-line: rgba(251, 146, 60, 0.35);
    --note-text: #fdba74;
    --note-strong: #fed7aa;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 56px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}


*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, textarea, select { font: inherit; }
::selection { background: var(--brand-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--solid); color: var(--on-solid); padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; }
.skip-link:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 0.93rem; line-height: 1.2; white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { transition: transform 0.18s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn-primary { background: var(--solid); color: var(--on-solid); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--solid-hover); }
.btn-brand { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(15, 118, 110, 0.2), 0 8px 20px -10px rgba(15, 118, 110, 0.6); }
.btn-brand:hover { background: var(--brand-hover); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--ink); }
.btn-lg { padding: 15px 26px; font-size: 1rem; }
.btn-sm { padding: 9px 16px; font-size: 0.875rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40; background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s, box-shadow 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(11, 18, 32, 0.35); }
.header-row { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--ink); }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--panel); color: #5eead4; font-size: 17px; }
.nav { display: flex; align-items: center; gap: 4px; font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.nav a { position: relative; padding: 8px 11px; border-radius: 8px; transition: color 0.15s, background 0.15s; }
.nav a:hover { color: var(--ink); background: var(--bg-soft); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.link-quiet { font-size: 0.875rem; font-weight: 500; color: var(--muted); padding: 8px 10px; border-radius: 8px; }
.link-quiet:hover { color: var(--ink); background: var(--bg-soft); }
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); place-items: center; font-size: 18px; color: var(--ink); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
@media (max-width: 1080px) { .link-quiet { display: none; } }
@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -20px rgba(11, 18, 32, 0.35);
    opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden;
    transition: opacity 0.18s, transform 0.18s var(--ease), visibility 0.18s;
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  .nav a { padding: 12px; font-size: 1rem; }
  .nav a.is-active::after { display: none; }
}
@media (max-width: 420px) { .header-actions .btn-sm { padding: 9px 12px; } }

/* Section scaffolding */
.section { padding: 104px 0; }
.section-soft { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-head { max-width: 660px; margin: 0 auto 56px; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.section-head h2, .h2 { margin-top: 12px; font-size: clamp(1.9rem, 3.8vw, 2.7rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; color: var(--ink); }
.section-head p { margin-top: 16px; font-size: 1.07rem; color: var(--muted); }
@media (max-width: 640px) { .section { padding: 76px 0; } .section-head { margin-bottom: 40px; } }

/* Footer */
.site-footer { background: var(--panel-deep); color: #9aa4b2; padding: 64px 0 28px; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.site-footer .logo { color: #fff; }
.site-footer .logo-mark { background: #1e293b; }
.footer-blurb { margin-top: 14px; max-width: 340px; line-height: 1.65; }
.footer-col h3 { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #cbd2dc; margin-bottom: 14px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a, .footer-col button { color: #9aa4b2; transition: color 0.15s; text-align: left; }
.footer-col a:hover, .footer-col button:hover { color: #fff; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid #1e293b; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Motion: content reveals as it scrolls into view (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header { position: static; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .nav-toggle, .skip-link { display: none !important; }
}

/* Legal / long-form pages */
.page-hero { padding: 72px 0 40px; border-bottom: 1px solid var(--line); background: radial-gradient(700px 260px at 15% 0%, var(--brand-soft), transparent 70%); }
.page-hero h1 { margin-top: 12px; font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -0.035em; line-height: 1.08; color: var(--ink); }
.page-hero p { margin-top: 12px; color: var(--muted); font-size: 1.05rem; max-width: 640px; }
.page-hero .page-meta { margin-top: 8px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; }
.legal-layout { display: grid; grid-template-columns: 220px 1fr; gap: 56px; padding-block: 56px 96px; align-items: start; }
.legal-toc { position: sticky; top: 92px; font-size: 0.86rem; }
.legal-toc p { font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.legal-toc ol { display: grid; gap: 4px; counter-reset: toc; }
.legal-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); border-left: 2px solid transparent; }
.legal-toc a:hover { color: var(--ink); background: var(--bg-soft); }
.legal-toc a.is-active { color: var(--brand); border-left-color: var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.legal { max-width: 720px; line-height: 1.75; }
.legal h2 { font-size: 1.25rem; color: var(--ink); margin: 40px 0 10px; letter-spacing: -0.015em; scroll-margin-top: 92px; }
.legal h2:first-of-type { margin-top: 0; }
.legal p { margin: 10px 0; }
.legal ul { list-style: disc; padding-left: 22px; margin: 8px 0; }
.legal li { margin: 6px 0; }
.legal a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.legal .summary-box { background: var(--brand-soft); border: 1px solid var(--brand-tint); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 32px; color: var(--ink); }
.legal .summary-box strong { display: block; margin-bottom: 4px; }
.legal .summary-box { line-height: 1.65; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.legal th, .legal td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal tr:last-child td { border-bottom: 0; }
.legal th { background: var(--bg-soft); color: var(--ink); font-size: 0.8rem; font-weight: 600; }
.legal .muted { color: var(--muted); }
@media (max-width: 860px) { .legal-layout { grid-template-columns: 1fr; gap: 24px; padding-block: 32px 72px; } .legal-toc { position: static; } .legal-toc ol { display: flex; flex-wrap: wrap; gap: 6px; } .legal-toc a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; } .legal-toc a.is-active { border-radius: 999px; } }
@media (max-width: 560px) { .legal table { display: block; overflow-x: auto; } }

/* Theme toggle */
.theme-toggle { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 18px; color: var(--ink); background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle .i-sun { display: none; }
html[data-theme-active="dark"] .theme-toggle .i-sun { display: block; }
html[data-theme-active="dark"] .theme-toggle .i-moon { display: none; }
html:not(.js) .theme-toggle { display: none; }
html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after { transition: background-color 0.25s, border-color 0.25s, color 0.25s !important; }
