/* ==========================================================
   mxguard.sh landing — design tokens + global styles
   ========================================================== */

:root {
  --font-heading: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* dark palette (default) — cool slate */
  --bg: #080B13;
  --bg-elev: #0D1220;
  --bg-card: #0F1628;
  --bg-card-hi: #141C32;
  --line: rgba(255, 255, 255, 0.06);
  --line-hi: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);

  --fg: #F2F4F8;
  --fg-dim: #B4BCCC;
  --fg-muted: #7A8598;
  --fg-faint: #4E5769;

  --primary: #00D9A3;
  --primary-dim: rgba(0, 217, 163, 0.14);
  --primary-faint: rgba(0, 217, 163, 0.06);
  --violet: #8B5CF6;
  --violet-dim: rgba(139, 92, 246, 0.14);
  --amber: #F59E0B;
  --red: #F87171;
  --pink: #EC4899;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 1px rgba(0, 217, 163, 0.3), 0 0 40px rgba(0, 217, 163, 0.18);
}

[data-theme="light"] {
  --bg: #FAFBFC;
  --bg-elev: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hi: #F6F8FB;
  --line: rgba(15, 23, 42, 0.08);
  --line-hi: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.2);

  --fg: #0B1220;
  --fg-dim: #334155;
  --fg-muted: #64748B;
  --fg-faint: #94A3B8;

  --primary: #059669;
  --primary-dim: rgba(5, 150, 105, 0.1);
  --primary-faint: rgba(5, 150, 105, 0.04);
  --violet: #7C3AED;
  --violet-dim: rgba(124, 58, 237, 0.1);
  --amber: #D97706;
  --red: #DC2626;
  --pink: #DB2777;

  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 0 1px rgba(5, 150, 105, 0.25), 0 0 40px rgba(5, 150, 105, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
input, select { font: inherit; color: inherit; }

/* Typography helpers */
.display {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  font-size: clamp(2rem, 3.4vw, 3rem);
}
.h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 1.15rem;
  line-height: 1.25;
}
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--primary-dim);
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent);
}
.kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}
section { position: relative; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--primary);
  color: #04140F;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 16px color-mix(in oklab, var(--primary) 35%, transparent);
}
[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 24px color-mix(in oklab, var(--primary) 45%, transparent);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border-color: var(--line-hi);
}
.btn-secondary:hover {
  background: var(--bg-card-hi);
  border-color: var(--line-strong);
}
.btn-ghost {
  color: var(--fg-dim);
  padding: 8px 12px;
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--fg); }

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.card-hi { background: var(--bg-card-hi); }
.card:hover { border-color: var(--line-hi); }

/* Reveal (on-scroll fade) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section heading block */
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}
.section-head .eyebrow { margin-bottom: 14px; display: block; }
.section-head .h2 { margin-bottom: 14px; }
.section-head p {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto;
  text-wrap: pretty;
}

/* Divider rule */
.divider-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi) 20%, var(--line-hi) 80%, transparent);
  margin: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid var(--bg); }

/* Hero canvas layer */
.hero-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hero-canvas svg { width: 100%; height: 100%; }
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 85%);
}
.hero-glow-1 {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--primary) 18%, transparent), transparent 65%);
  top: -200px;
  left: -150px;
  filter: blur(40px);
}
.hero-glow-2 {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--violet) 14%, transparent), transparent 65%);
  top: 100px;
  right: -150px;
  filter: blur(40px);
}

/* Node network animation */
.node {
  fill: var(--bg-card);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}
.node-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--fg-muted);
}
.link {
  stroke: var(--line-hi);
  stroke-width: 1;
  fill: none;
}
.packet {
  fill: var(--primary);
  filter: drop-shadow(0 0 6px var(--primary));
}
@keyframes dash {
  to { stroke-dashoffset: -20; }
}

/* Dashboard mock */
.mockup-chrome {
  background: var(--bg-card-hi);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
}
.mockup-chrome .dot { width: 10px; height: 10px; border-radius: 50%; }
.mockup-chrome .dot-r { background: #FF5F57; }
.mockup-chrome .dot-y { background: #FEBC2E; }
.mockup-chrome .dot-g { background: #28C840; }

/* Tweaks panel */
.tweaks {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  padding: 16px;
  min-width: 260px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  flex-direction: column;
  gap: 12px;
}
.tweaks.is-open { display: flex; }
.tweaks h4 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tweaks label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tweaks select, .tweaks input[type="range"] {
  background: var(--bg);
  border: 1px solid var(--line-hi);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--fg);
  font-size: 0.78rem;
}

/* range slider */
input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--line-hi);
  border-radius: 2px;
  outline: none;
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 20%, transparent);
  border: 2px solid var(--bg);
}
input[type="range"].slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
}

/* FAQ */
details.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.2s;
}
details.faq[open] { border-color: var(--line-hi); }
details.faq summary {
  padding: 18px 22px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--fg-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
details.faq[open] summary::after { transform: rotate(45deg); color: var(--primary); }
details.faq .faq-body {
  padding: 0 22px 20px;
  color: var(--fg-dim);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Logos */
.logo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  color: var(--fg-muted);
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}
.logo-cell:hover { opacity: 1; color: var(--fg-dim); }

/* Benchmark ticker */
.bench-live::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  margin-right: 6px;
  animation: pulse 1.4s ease-in-out infinite;
}

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .nav-links { display: none !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
  .legal-nav-links a:not(.btn) { display: none !important; }
}

/* ---------- Legal / policy prose ---------- */
.legal-prose {
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--fg-dim);
}
.legal-prose h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--fg);
  margin: 44px 0 14px;
  letter-spacing: -0.015em;
  scroll-margin-top: 80px;
}
.legal-prose h2:first-child { margin-top: 0; }
.legal-prose h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg);
  margin: 28px 0 8px;
}
.legal-prose p { margin: 0 0 14px; text-wrap: pretty; }
.legal-prose ul, .legal-prose ol { margin: 8px 0 18px; padding-left: 22px; }
.legal-prose li { margin: 6px 0; }
.legal-prose strong { color: var(--fg); font-weight: 600; }
.legal-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.legal-prose a:hover { color: var(--fg); }
.legal-prose code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.86em;
  color: var(--fg);
}
.legal-prose blockquote {
  margin: 18px 0;
  padding: 14px 20px;
  border-left: 2px solid var(--primary);
  background: var(--primary-faint);
  border-radius: 0 8px 8px 0;
  color: var(--fg-dim);
}
.legal-prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.legal-prose .toc {
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 32px;
}
.legal-prose .toc-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.legal-prose .toc ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.88rem;
  columns: 2;
  column-gap: 24px;
}
.legal-prose .toc li { break-inside: avoid; margin: 4px 0; }
@media (max-width: 640px) {
  .legal-prose .toc ol { columns: 1; }
}
