:root {
  --bg: #0A0E1A;
  --panel: rgba(15, 20, 34, 0.7);
  --panel-solid: #0F1422;
  --border: rgba(237, 243, 239, 0.12);
  --text: #EDF3EF;
  --text-dim: #9FB0AA;
  --text-faint: #6E7C78;
  --cyan: #2FD38A;
  --violet: #0B7A54;
  --glow-1: rgba(47, 211, 138, 0.28);
  --glow-2: rgba(11, 122, 84, 0.22);
  --grid-line: rgba(237, 243, 239, 0.035);
  --header-bg: rgba(10, 14, 26, 0.7);
  --badge-bg: rgba(15, 20, 34, 0.85);
  --shadow: rgba(0, 0, 0, 0.4);
  --good: #4ADE80;
  --bad: #FF6B6B;
}

[data-theme="light"] {
  --bg: #F4F6FA;
  --panel: rgba(255, 255, 255, 0.55);
  --panel-solid: #FFFFFF;
  --border: rgba(10, 14, 26, 0.1);
  --text: #0A0E1A;
  --text-dim: #56636A;
  --text-faint: #7C8790;
  --glow-1: rgba(47, 211, 138, 0.22);
  --glow-2: rgba(11, 122, 84, 0.16);
  --grid-line: rgba(10, 14, 26, 0.045);
  --header-bg: rgba(244, 246, 250, 0.75);
  --badge-bg: rgba(255, 255, 255, 0.88);
  --shadow: rgba(10, 14, 26, 0.1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }

a { color: var(--cyan); text-decoration: none; transition: opacity .2s ease; }
a:hover { opacity: 0.8; }

h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }

.glow {
  position: fixed;
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  width: 1100px;
  height: 700px;
  background: radial-gradient(ellipse at center, var(--glow-1) 0%, var(--glow-2) 38%, transparent 70%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
  transition: background .35s ease;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  z-index: 0;
  pointer-events: none;
  transition: background-image .35s ease;
}

main, header, footer { position: relative; z-index: 1; }

/* header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  transition: border-color .35s ease;
}
/* the frosted-glass blur lives on a pseudo-element rather than .header
   itself, because backdrop-filter on an ancestor makes it the containing
   block for position:fixed descendants (the mobile menu overlay needs to
   stay pinned to the viewport, not shrink to the header's own box) */
.header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  transition: background-color .35s ease;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
}
.wordmark { font-size: 19px; font-weight: 700; }
.wordmark span { color: var(--cyan); }
.wordmark.small { font-size: 17px; }

.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 24px; }

.nav { display: flex; align-items: center; justify-content: center; gap: 20px; }

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color .2s ease, opacity .2s ease;
}
.nav-link:hover { color: var(--text); opacity: 1; }
.nav-link.is-active { color: var(--text); }

/* mobile hamburger menu */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  border: none;
  background: var(--panel-solid);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.menu-toggle svg { width: 18px; height: 18px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle.is-open .icon-menu { display: none; }
.menu-toggle.is-open .icon-close { display: block; }

@media (max-width: 640px) {
  .header-inner { grid-template-columns: auto 1fr auto; padding: 14px 16px; column-gap: 16px; }
  .menu-toggle { display: inline-flex; position: relative; z-index: 21; }
  .menu-toggle.is-open { color: var(--cyan); }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: var(--bg);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
  }
  .nav.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-link { font-size: 21px; padding: 6px 4px; }
}

/* theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  border: none;
  background: var(--panel-solid);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: transform .25s ease, color .25s ease, background-color .35s ease;
}
.theme-toggle:hover { transform: rotate(14deg) scale(1.08); color: var(--cyan); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 28px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease, border-color .22s ease, background-color .35s ease, color .35s ease;
}
.btn-pill { border-radius: 100px; }
.btn-gradient {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  background-clip: padding-box;
  border: none;
  color: #0A0E1A;
  box-shadow: 0 6px 16px var(--shadow);
}
[data-theme="light"] .btn-gradient { color: #FFFFFF; }
.btn-gradient:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px var(--glow-1);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: rgba(237, 243, 239, 0.3);
}
[data-theme="light"] .btn-outline { border-color: rgba(10, 14, 26, 0.25); }
.btn-outline:hover {
  color: var(--text);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

/* footer */
.footer { border-top: 1px solid var(--border); padding: 48px 24px; transition: border-color .35s ease; }
.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.footer-tagline { font-size: 14px; color: var(--text-dim); margin: 12px 0 8px; }
.footer-disclaimer { font-size: 12px; color: var(--text-faint); }

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