@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #04060a;
  --bg-elevated: #0a0f16;
  --panel: rgba(8, 14, 22, 0.72);
  --text: #e8eef7;
  --muted: #7f8da3;
  --line: rgba(140, 220, 255, 0.16);
  --phosphor: #5eead4;
  --phosphor-dim: rgba(94, 234, 212, 0.45);
  --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: 2px;
}

* {
  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 + faint tech grid */
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.08), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(125, 211, 252, 0.06), transparent 50%),
    linear-gradient(180deg, #04060a 0%, #070b12 50%, #04060a 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  opacity: 0.035;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.7) 0,
      rgba(255, 255, 255, 0.7) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: overlay;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.hud-frame {
  position: fixed;
  inset: 14px;
  pointer-events: none;
  z-index: 60;
  border: 1px solid rgba(94, 234, 212, 0.12);
}

.hud-frame::before,
.hud-frame::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--phosphor);
  border-style: solid;
}

.hud-frame::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.hud-frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
}

.hud-corners {
  position: fixed;
  inset: 14px;
  pointer-events: none;
  z-index: 60;
}

.hud-corners::before,
.hud-corners::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--phosphor);
  border-style: solid;
}

.hud-corners::before {
  top: -1px;
  right: -1px;
  border-width: 2px 2px 0 0;
}

.hud-corners::after {
  left: -1px;
  bottom: -1px;
  border-width: 0 0 2px 2px;
}

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

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

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

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

.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.04em;
  text-transform: uppercase;
}

.brand-mark {
  width: 10px;
  height: 10px;
  background: var(--phosphor);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.55);
  animation: pulse-mark 2.8s ease-in-out infinite;
}

@keyframes pulse-mark {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 10px rgba(94, 234, 212, 0.45);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 18px rgba(94, 234, 212, 0.75);
  }
}

.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.12em;
  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);
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.6);
}

.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.12em;
  text-transform: uppercase;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #04110e;
  background: var(--phosphor);
  border-color: var(--phosphor);
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.25);
}

.button-primary:hover {
  box-shadow: 0 0 36px rgba(94, 234, 212, 0.4);
}

.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.22em;
  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.08em;
  text-transform: uppercase;
  border-top: 1px solid rgba(140, 220, 255, 0.08);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

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

@media (max-width: 820px) {
  .hud-frame,
  .hud-corners {
    inset: 8px;
  }

  .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: 360px;
    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;
  }

  .brand-mark {
    animation: none;
  }

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

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