:root {
  --bg-deep: #0b0d12;
  --bg-elevated: #12151d;
  --bg-card: #161a24;
  --text: #e8ecf4;
  --muted: #9aa3b5;
  --accent: #5eead4;
  --accent-dim: rgba(94, 234, 212, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-sans: "Outfit", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --header-h: 4.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 800px at 10% -10%, rgba(94, 234, 212, 0.08), transparent), radial-gradient(900px 600px at 90% 0%, rgba(99, 102, 241, 0.12), transparent), var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
}

.boids-background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  overflow: hidden;
}

.boids-background .simulation-window {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: blur(0.4px);
}

.site-header,
main,
.site-footer,
.skip-link {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #9cf5e8;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #04201a;
  font-weight: 600;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  min-height: var(--header-h);
  background: rgba(11, 13, 18, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--accent-dim);
}

main {
  padding-bottom: 4rem;
}

.hero {
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 6vw, 4.5rem);
  max-width: 920px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent);
  margin: 0 0 1rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.15;
  margin: 0 0 1.25rem;
  font-weight: 700;
}

.hero__lede {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 62ch;
}

.hero__aside {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 62ch;
  padding-left: 0.85rem;
  border-left: 2px solid var(--accent-dim);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button--primary {
  background: var(--accent);
  color: #04221c;
  border-color: rgba(0, 0, 0, 0.06);
}

.button--primary:hover {
  background: #8af0e0;
  color: #04221c;
}

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

.button--ghost:hover {
  border-color: rgba(94, 234, 212, 0.45);
  color: var(--accent);
}

.section {
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1rem, 4vw, 2.5rem);
  max-width: 1100px;
  margin: 0 auto;
}

.section--tight {
  padding-top: 0;
}

.section--alt {
  background: linear-gradient(180deg, rgba(18, 21, 29, 0.78), rgba(18, 21, 29, 0.92));
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: none;
}

.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.section__head {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.section__sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.section__note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 72ch;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 68ch;
}

.prose strong {
  color: var(--text);
}

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: rgba(22, 26, 36, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
}

.timeline li {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.timeline strong {
  color: var(--text);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.site-footer {
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }
}
/* ---------- Per-letter effects (see client/effects.js) ----------
   Words wrap as units; individual characters become inline-block boxes
   so they can transform, fade, and recolor without breaking layout. */
.word {
  display: inline-block;
  white-space: nowrap;
}

.ch {
  display: inline-block;
  will-change: transform, color, opacity, filter;
  transform-origin: center 60%;
  transition: color 0.18s ease;
}

.ch--scrambling {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(94, 234, 212, 0.35);
}

.ch--jitter {
  animation: chJitter 0.28s ease;
  color: var(--accent);
}

@keyframes chJitter {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-1px, -3px) rotate(-8deg);
  }
  50% {
    transform: translate(2px, 1px) rotate(6deg);
  }
  75% {
    transform: translate(-1px, 2px) rotate(-4deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}
.ch--wave {
  animation: chWave 0.42s ease;
  color: #9cf5e8;
  text-shadow: 0 0 10px rgba(94, 234, 212, 0.4);
}

@keyframes chWave {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
    color: var(--accent);
  }
  100% {
    transform: translateY(0);
  }
}
.ch--burning {
  animation: chBurn 0.7s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes chBurn {
  0% {
    color: #ffd089;
    text-shadow: 0 0 6px #ff8e3c, 0 0 14px #ff5c1f;
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
    filter: blur(0);
  }
  35% {
    color: #ff4d2e;
    text-shadow: 0 0 10px #ff2c00, 0 0 20px #b81c00;
    transform: translate(calc(var(--burn-dx, 0px) * 0.4), -3px) rotate(calc(var(--burn-rot, 0deg) * 0.4)) scale(1.05);
    opacity: 0.95;
    filter: blur(0);
  }
  70% {
    color: #6b1a0c;
    text-shadow: 0 0 6px #4a0f06;
    transform: translate(calc(var(--burn-dx, 0px) * 0.85), calc(var(--burn-dy, -18px) * 0.7)) rotate(var(--burn-rot, 12deg)) scale(0.75);
    opacity: 0.55;
    filter: blur(1px);
  }
  100% {
    color: #1b0e0a;
    text-shadow: none;
    transform: translate(var(--burn-dx, 0px), var(--burn-dy, -22px)) rotate(var(--burn-rot, 20deg)) scale(0.35);
    opacity: 0;
    filter: blur(3px);
  }
}
.ember-wrap {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1;
}

.ember {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
  color: #ffd089;
  text-shadow: 0 0 8px #ff5b1f, 0 0 14px #ff2200;
  animation: emberFly var(--life, 900ms) ease-out forwards;
  will-change: transform, opacity, color;
}

@keyframes emberFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
    color: #fff1c2;
  }
  55% {
    color: #ff4d2e;
    opacity: 0.95;
  }
  100% {
    transform: translate(var(--dx, 0px), var(--dy, -60px)) scale(0.4);
    opacity: 0;
    color: #1b0e0a;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ch--scrambling,
  .ch--jitter,
  .ch--wave,
  .ch--burning {
    animation: none !important;
    transform: none !important;
  }
}
