/* ──────────────────────────────────────────────────────────
   Shared styles for standalone pages: contact, privacy,
   terms, security. Mirrors the design tokens used in
   index.html so the look matches without duplicating the
   full landing-page CSS.
   ────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-soft: #FAFAFB;
  --bg-muted: #F4F4F7;
  --ink: #0A0A0A;
  --ink-soft: #3F3F46;
  --ink-muted: #71717A;
  --rule: rgba(10, 10, 10, 0.09);
  --rule-soft: rgba(10, 10, 10, 0.05);
  --rule-strong: rgba(10, 10, 10, 0.15);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --surface-invert: #0A0A0A;
  --surface-invert-deep: #050505;
  --on-invert: #FFFFFF;
  --on-invert-soft: rgba(255, 255, 255, 0.72);
  --on-invert-muted: rgba(255, 255, 255, 0.62);
  --on-invert-faint: rgba(255, 255, 255, 0.4);
  --on-invert-rule: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(10, 10, 10, 0.06), 0 2px 4px -2px rgba(10, 10, 10, 0.04);
  --shadow-lg: 0 24px 48px -16px rgba(10, 10, 10, 0.14), 0 8px 16px -8px rgba(10, 10, 10, 0.06);

  --primary: #635BFF;
  --primary-deep: #4F46E5;
  --accent: #00B4D8;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --gradient: linear-gradient(135deg, #635BFF 0%, #00B4D8 100%);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0B0F;
  --bg-soft: #131419;
  --bg-muted: #1B1C22;
  --ink: #F4F4F5;
  --ink-soft: #D4D4D8;
  --ink-muted: #9CA3AF;
  --rule: rgba(255, 255, 255, 0.09);
  --rule-soft: rgba(255, 255, 255, 0.05);
  --rule-strong: rgba(255, 255, 255, 0.18);
  --nav-bg: rgba(11, 11, 15, 0.78);
  --surface-invert: #16171C;
  --surface-invert-deep: #08080B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 8px 16px -8px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0B0F;
    --bg-soft: #131419;
    --bg-muted: #1B1C22;
    --ink: #F4F4F5;
    --ink-soft: #D4D4D8;
    --ink-muted: #9CA3AF;
    --rule: rgba(255, 255, 255, 0.09);
    --rule-soft: rgba(255, 255, 255, 0.05);
    --rule-strong: rgba(255, 255, 255, 0.18);
    --nav-bg: rgba(11, 11, 15, 0.78);
    --surface-invert: #16171C;
    --surface-invert-deep: #08080B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 8px 16px -8px rgba(0, 0, 0, 0.4);
  }
}

/* Light-mode brand-color polish — keep gradient consumers (.btn-primary,
   any future gradient text) in indigo-only so light mode reads as a
   single brand purple. Mirrors the override in index.html. Dark mode
   keeps the original purple→cyan gradient. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --gradient: linear-gradient(135deg, #635BFF 0%, #4F46E5 100%);
  }
}
:root[data-theme="light"] {
  --gradient: linear-gradient(135deg, #635BFF 0%, #4F46E5 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); text-decoration: underline; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Top nav — mirrors index.html structure but simplified for static pages. */
nav.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
nav.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
}
.brand:hover, .brand:focus { color: var(--ink); text-decoration: none; }
.brand em { color: var(--primary); font-style: normal; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--ink);
}
.brand-mark svg { width: 28px; height: 28px; }
/* Seam color matches the surface behind the mark — nav and footer differ. */
.brand-mark svg path[fill="var(--bg, #ffffff)"] { fill: var(--bg); }
footer.site .brand-mark { color: var(--on-invert); }
footer.site .brand-mark svg path[fill="var(--bg, #ffffff)"] { fill: var(--surface-invert-deep); }
.nav-links {
  display: flex; align-items: center; gap: 28px;
  font-size: 14px; font-weight: 500;
}
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta { display: inline-flex; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn-ghost { color: var(--ink); border-color: var(--rule-strong); background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; color: var(--ink); }
.btn-primary {
  color: #fff; background: var(--gradient); border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(99, 91, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  color: #fff; text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 8px 24px -6px rgba(99, 91, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--rule-strong); background: transparent;
  color: var(--ink-soft); cursor: pointer;
}
.theme-toggle svg { width: 16px; height: 16px; display: none; }
.theme-toggle .auto { display: block; }
[data-theme="light"] .theme-toggle .auto,
[data-theme="dark"] .theme-toggle .auto { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .btn-ghost { display: none; }
}

/* Page hero + body */
.page-hero { padding: 64px 0 24px; border-bottom: 1px solid var(--rule); }
.page-hero .eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 14px;
}
.page-hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 5vw, 52px); line-height: 1.1;
  letter-spacing: -0.02em; color: var(--ink);
}
.page-hero .lede {
  margin-top: 16px; max-width: 720px;
  font-size: 18px; line-height: 1.6; color: var(--ink-soft);
}
.page-hero .meta {
  margin-top: 18px; font-size: 13px; color: var(--ink-muted);
  font-family: var(--mono);
}

main.page { padding: 48px 0 80px; }
main.page .wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
@media (max-width: 880px) {
  main.page .wrap { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static !important; border-right: none; padding-right: 0; }
}

.toc {
  position: sticky; top: 88px; align-self: start;
  border-right: 1px solid var(--rule);
  padding-right: 24px;
  font-size: 13px;
}
.toc h4 {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 12px;
}
.toc ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--ink); text-decoration: none; }

.prose { max-width: 760px; }
.prose section { padding: 32px 0; border-top: 1px solid var(--rule-soft); }
.prose section:first-child { border-top: none; padding-top: 0; }
.prose h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: 24px; letter-spacing: -0.01em;
  color: var(--ink); margin-bottom: 14px;
  scroll-margin-top: 96px;
}
.prose h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 16px; color: var(--ink);
  margin-top: 22px; margin-bottom: 8px;
}
.prose p { color: var(--ink-soft); margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 14px; color: var(--ink-soft); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-muted); color: var(--ink);
  padding: 2px 6px; border-radius: 4px;
}
.prose a { color: var(--primary); }
.prose .callout {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--primary);
  background: var(--bg-soft);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Contact-specific */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.contact-card {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
}
.contact-card h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 15px; color: var(--ink); margin-bottom: 6px;
}
.contact-card p { font-size: 14px; color: var(--ink-muted); margin-bottom: 12px; }
.contact-card a {
  display: inline-block;
  font-size: 14px; font-weight: 500;
  color: var(--primary);
}

/* Footer (simplified mirror of index.html) */
footer.site {
  background: var(--surface-invert-deep); color: var(--on-invert);
  padding: 56px 0 32px; margin-top: 32px;
}
footer.site .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}
@media (max-width: 800px) {
  footer.site .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  footer.site .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
footer.site h4 {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 14px;
}
footer.site ul { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
footer.site a { color: var(--on-invert-soft); }
footer.site a:hover { color: var(--on-invert); text-decoration: none; }
footer.site .footer-brand p {
  margin-top: 14px; max-width: 320px;
  color: var(--on-invert-muted); font-size: 14px; line-height: 1.55;
}
footer.site .footer-brand .brand { color: var(--on-invert); }
footer.site .footer-brand .brand em { color: var(--accent); }
footer.site .footer-bottom {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--on-invert-rule);
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--on-invert-faint);
}
@media (max-width: 480px) {
  footer.site .footer-bottom { flex-direction: column; gap: 6px; }
}
