:root {
  --ink: #060910;
  --paper: #e7eefc;
  --mist: #93a0b8;
  --mint: #3dffb0;
  --azure: #67d4ff;
  --rose: #ff6b8a;
  --amber: #ffc46b;
  --line: rgba(255, 255, 255, 0.1);
  --panel: rgba(12, 18, 32, 0.82);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

h1, h2, h3, [id] { scroll-margin-top: 5.5rem; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  font-family: Manrope, sans-serif;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(880px 420px at 100% -8%, rgba(103, 212, 255, 0.16), transparent 58%),
    radial-gradient(640px 360px at -12% 8%, rgba(61, 255, 176, 0.1), transparent 55%);
}

body::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 74%);
}

main { flex: 1; }

::selection {
  background: var(--mint);
  color: #062018;
}

:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--mint);
  color: #062018;
  padding: 0.5rem 0.8rem;
  border-radius: 0.6rem;
  font-weight: 700;
}

.skip:focus { top: 1rem; }

.font-display { font-family: Outfit, sans-serif; }
.font-mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 16, 0.82);
  backdrop-filter: blur(16px);
}

.nav-link {
  color: var(--mist);
  font-size: 0.875rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
}

.nav-link:hover { color: white; }

.nav-link[aria-current="page"] {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
}

.mobile-link {
  display: block;
  padding: 0.75rem 0.2rem;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--mint);
  color: #062018;
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost:hover { border-color: var(--azure); }

.kicker {
  color: var(--mint);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
}

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

a.card:hover {
  border-color: rgba(103, 212, 255, 0.5);
  transform: translateY(-2px);
}

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(61, 255, 176, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(61, 255, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 255, 176, 0); }
}

[data-dir="up"] { color: var(--mint); }
[data-dir="down"] { color: var(--rose); }

.disclaimer,
.callout,
.callout-warn {
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  margin: 1.25rem 0;
}

.disclaimer,
.callout-warn {
  background: rgba(255, 196, 107, 0.08);
  border: 1px solid rgba(255, 196, 107, 0.28);
  color: #f3e2c2;
  font-size: 0.92rem;
}

.callout {
  background: rgba(61, 255, 176, 0.06);
  border: 1px solid rgba(61, 255, 176, 0.22);
}

.prose-vela > * + * { margin-top: 1rem; }

.prose-vela h2 {
  font-family: Outfit, sans-serif;
  font-size: 1.7rem;
  line-height: 1.2;
  margin-top: 2.4rem;
}

.prose-vela h3 {
  font-family: Outfit, sans-serif;
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

.prose-vela p,
.prose-vela li { color: #d5deef; line-height: 1.7; }

.prose-vela ul,
.prose-vela ol { padding-left: 1.15rem; }

.prose-vela li + li { margin-top: 0.4rem; }

.prose-vela strong { color: white; font-weight: 700; }

.prose-vela a { color: var(--azure); }

.toc a {
  display: block;
  color: var(--mist);
  text-decoration: none;
  padding: 0.35rem 0;
  font-size: 0.88rem;
}

.toc a:hover { color: white; }

.checklist { list-style: none; padding: 0; margin: 0; }

.checklist label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.checklist input {
  margin-top: 0.25rem;
  accent-color: var(--mint);
  width: 1rem;
  height: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.88rem; }
.field span { color: var(--mist); }

.field input {
  background: #0c1220;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.8rem;
  padding: 0.7rem 0.8rem;
  color: var(--paper);
  font: inherit;
}

.stat-grid { display: grid; gap: 0.75rem; }
.stat-grid div {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
}
.stat-grid dt { color: var(--mist); font-size: 0.78rem; }
.stat-grid dd { margin: 0.2rem 0 0; font-family: "IBM Plex Mono", monospace; font-size: 1rem; }

.chart-frame {
  background: #0c1220;
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
}

.chart-frame svg { display: block; width: 100%; height: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th {
  text-align: left;
  color: var(--mist);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
}

table.data td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

table.data tr:hover td { background: rgba(255, 255, 255, 0.02); }

#menu-btn[aria-expanded="true"] .icon-open { display: none; }
#menu-btn[aria-expanded="false"] .icon-close { display: none; }

footer a {
  color: #d5deef;
  text-decoration: none;
}

footer a:hover { color: white; }

.symbol-btn[aria-pressed="true"] {
  background: #3dffb0;
  color: #062018;
  border-color: #3dffb0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse-dot { animation: none; }
  a.card { transition: none; }
  a.card:hover { transform: none; }
}
