/* Inter-Variable.woff2 is a static instance despite its name: it has no fvar
   table. Claiming 100-900 would suppress synthetic bold for <strong>. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #04060a;
  --bg-elevated: #0a0f16;
  --panel: rgba(10, 16, 24, 0.86);
  --text: #e8eef7;
  --copy: #c5cdd8;
  --muted: #9aa8bc;
  --line: rgba(148, 180, 200, 0.14);
  --phosphor: #5eead4;
  --phosphor-dim: rgba(94, 234, 212, 0.28);
  --signal: #7dd3fc;
  --warn: #f0ab7a;
  --max: 1120px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 4px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* Atmospheric base */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 70% 0%, rgba(94, 234, 212, 0.04), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(125, 211, 252, 0.03), transparent 50%),
    linear-gradient(180deg, #04060a 0%, #070b12 50%, #04060a 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.page-blog {
  --max: 820px;
}

.page-blog-index {
  --max: 1120px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(4, 6, 10, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 8px;
  height: 8px;
  background: var(--phosphor);
}

.nav-toggle {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.nav-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.8;
  stroke-linecap: square;
  transition: transform 200ms ease, opacity 160ms ease;
}

.nav-icon-close {
  position: absolute;
  opacity: 0;
  transform: scale(0.7) rotate(-40deg);
}

.nav-toggle.open .nav-icon-menu {
  opacity: 0;
  transform: scale(0.7) rotate(40deg);
}

.nav-toggle.open .nav-icon-close {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  position: relative;
  padding: 10px 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  color: var(--phosphor);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 1px;
  background: var(--phosphor);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}

.button-primary {
  color: #04110e;
  background: var(--phosphor);
  border-color: var(--phosphor);
}

.button-primary:hover {
  background: #7ff0dc;
  border-color: #7ff0dc;
}

.button-secondary {
  color: var(--text);
  background: transparent;
}

.button-secondary:hover {
  border-color: var(--phosphor);
  color: var(--phosphor);
}

.section-kicker {
  font-family: var(--font-mono);
  color: var(--phosphor);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

h1,
h2,
h3,
.hero-name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

footer {
  padding: 28px 0 40px;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease, transform 400ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 820px) {
  .nav-inner {
    min-height: 60px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-links {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    gap: 4px;
    border: 0 solid var(--line);
    transition: max-height 240ms ease, opacity 200ms ease, padding 200ms ease, border-width 200ms ease;
  }

  .nav-links.open {
    max-height: 420px;
    opacity: 1;
    padding: 8px;
    border-width: 1px;
    background: rgba(8, 14, 22, 0.95);
  }

  .nav-links a {
    padding: 12px 10px;
  }

  .nav-links a.active::after {
    display: none;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 28px, var(--max));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .button,
  .nav-icon {
    transition: none;
  }
}
