:root {
  --navy: #0d1520;
  --navy2: #1c2c4a;
  --panel: #0f1a2c;
  --orange: #f26522;
  --blue: #38bdf8;
  --green: #8dc63f;
  --white: #f0f4ff;
  --dim: #8899bb;
  --body: #c3ccdf;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: 'Barlow', sans-serif;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--white); }
::selection { background: #38bdf822; }

.topbar {
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--blue), var(--green));
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Nav */
.nav {
  position: sticky;
  top: 4px;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 56px;
  background: #0d1520cc;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--navy2);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 2px;
}

.nav-logo .bracket { color: var(--dim); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dim);
}

.nav-links a { color: var(--dim); }

.nav-github {
  color: var(--white) !important;
  border: 1px solid #38bdf855;
  padding: 8px 16px;
  border-radius: 3px;
}

/* Shared eyebrow / section headers */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--orange);
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid #f2652255;
  padding: 6px 14px;
  border-radius: 3px;
  background: #f2652212;
  margin-bottom: 28px;
}

.section-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-eyebrow.c-orange { color: var(--orange); }
.section-eyebrow.c-blue { color: var(--blue); }
.section-eyebrow.c-green { color: var(--green); }
.section-eyebrow.c-dim { color: var(--dim); }

.section-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 44px;
  margin: 0 0 20px;
  max-width: 700px;
}

.section-lede {
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  max-width: 680px;
  margin: 0 0 48px;
}

/* Hero */
.hero {
  position: relative;
  padding: 100px 56px 120px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, #38bdf81a, transparent 55%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(#1c2c4a55 1px, transparent 1px),
    linear-gradient(90deg, #1c2c4a55 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 88px;
  line-height: 0.98;
  letter-spacing: 0.5px;
  margin: 0 0 28px;
  max-width: 820px;
}

.hero-title .accent { color: var(--blue); }

.hero-lede {
  font-size: 20px;
  line-height: 1.6;
  color: var(--body);
  max-width: 640px;
  margin: 0 0 40px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--blue);
  color: var(--navy) !important;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 4px;
  display: inline-block;
}

.license-tag {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--dim);
}

/* Stats */
.stats {
  border-top: 1px solid var(--navy2);
  border-bottom: 1px solid var(--navy2);
  padding: 36px 56px;
  background: var(--panel);
}

.stats-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 44px;
  color: var(--white);
}

.stat-label {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 6px;
}

.c-orange { color: var(--orange); }
.c-blue { color: var(--blue); }
.c-green { color: var(--green); }
.c-dim { color: var(--dim); }

/* Watch it think */
.pulse-section {
  padding: 80px 0;
  background: var(--navy);
}

.pulse-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 56px;
}

.pulse-frame {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--navy2);
  box-shadow: 0 30px 80px #00000066;
  position: relative;
}

/* Generic sections */
.section { padding: 100px 56px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section.on-panel { background: var(--panel); }
.section.bordered { border-top: 1px solid var(--navy2); }
.section.bordered-both { border-top: 1px solid var(--navy2); border-bottom: 1px solid var(--navy2); }

/* Card grids (selfmod / cognition) */
.card-grid {
  display: grid;
  gap: 20px;
}

.card-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--navy2);
  border: 1px solid var(--navy2);
  border-radius: 8px;
  overflow: hidden;
}

.card-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--navy);
  padding: 28px;
}

.card-grid.cols-2 .card {
  border: 1px solid var(--navy2);
  border-radius: 8px;
  background: var(--panel);
}

.card-title {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 15px;
  color: var(--body);
  line-height: 1.6;
}

.cognition-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--white);
  margin-bottom: 10px;
}

.cognition-title .suffix {
  color: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 400;
}

.cognition-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--body);
}

.note-row {
  margin-top: 24px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-row .marker { color: var(--orange); }

/* Architecture diagram */
.arch-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.arch-box {
  border: 1px solid var(--navy2);
  border-radius: 6px;
  padding: 16px 20px;
  background: var(--navy);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  text-align: center;
  color: var(--dim);
}

.arch-box.blue { border-color: #38bdf855; color: var(--blue); }
.arch-box.green { border-color: #8dc63f55; color: var(--green); }

.arch-connector {
  height: 32px;
  width: 1px;
  background: var(--navy2);
  margin-left: calc(50% - 0.5px);
}

.arch-connector.blue { background: #38bdf855; }

.arch-host {
  border: 1px solid var(--navy2);
  border-radius: 8px;
  padding: 28px;
  background: var(--navy);
}

.arch-host-title {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--white);
  font-weight: 700;
  margin-bottom: 16px;
}

.arch-subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.arch-subbox {
  border: 1px solid var(--navy2);
  border-radius: 6px;
  padding: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}

.arch-subbox span { display: block; margin-top: 2px; }
.arch-subbox .green { color: var(--green); }
.arch-subbox .blue { color: var(--blue); }
.arch-subbox .orange { color: var(--orange); }

/* Closing */
.closing {
  padding: 120px 56px;
  text-align: center;
  background: var(--navy);
}

.closing-inner { max-width: 640px; margin: 0 auto; }

.closing-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.closing-quote {
  font-family: 'Space Mono', monospace;
  font-size: 24px;
  color: var(--white);
  line-height: 1.5;
  margin-bottom: 44px;
}

.closing .btn-primary { font-size: 16px; padding: 16px 36px; }

/* Footer */
.site-footer {
  padding: 32px 56px;
  border-top: 1px solid var(--navy2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--dim);
}

.site-footer a { color: var(--dim); }

/* ---------- Pulse animation embed ---------- */
.pulse-embed {
  width: 100%;
  height: 556px;
  position: relative;
  display: block;
  background: var(--navy);
  overflow: hidden;
}

.pulse-embed-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#1c2c4a55 1px, transparent 1px),
    linear-gradient(90deg, #1c2c4a55 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
}

.pulse-embed-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 640px;
  height: 640px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #38bdf822, transparent 60%);
  pointer-events: none;
}

.pulse-embed-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--blue), var(--green));
}

.pulse-embed-wordmark {
  position: absolute;
  top: 20px;
  left: 24px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--white);
  opacity: 0.7;
  z-index: 5;
}

.pulse-embed-wordmark .bracket { color: var(--dim); }

.pulse-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.pulse-scene.active { opacity: 1; }

/* Boot scene */
.boot-terminal {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  line-height: 2.1;
  text-align: left;
  min-height: 130px;
}

.boot-line {
  color: var(--green);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.boot-line.visible { opacity: 1; transform: translateY(0); }
.boot-line.highlight { color: var(--blue); }

.boot-title {
  text-align: center;
  margin-top: 28px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.boot-title.visible { opacity: 1; }

.boot-title .k10-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 40px;
  color: var(--white);
  letter-spacing: 1px;
}

.boot-title .k10-name .delta { color: var(--blue); }

.boot-title .k10-sub {
  margin-top: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
}

/* Cycle scene */
.cycle-svg { width: 420px; height: 420px; }

.cycle-node-box {
  fill: var(--navy);
  stroke: var(--navy2);
  stroke-width: 1.5;
  transition: stroke 0.3s ease, fill 0.3s ease;
}

.cycle-node.active .cycle-node-box {
  stroke: var(--blue);
  fill: #38bdf81a;
}

.cycle-node-label {
  fill: var(--dim);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  text-anchor: middle;
  dominant-baseline: middle;
  transition: fill 0.3s ease;
}

.cycle-node.active .cycle-node-label { fill: var(--blue); }

.cycle-edge {
  stroke: var(--navy2);
  stroke-width: 2;
  fill: none;
  transition: stroke 0.3s ease;
}

.cycle-edge.active { stroke: var(--blue); }

.cycle-center-circle {
  fill: var(--navy);
  stroke: var(--orange);
  stroke-width: 1.5;
}

.cycle-center-label {
  fill: var(--white);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Pulse scene */
.pulse-dot-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 36px;
}

.pulse-dot-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf866, transparent 70%);
  animation: pulseGlow 2.2s ease-in-out infinite;
}

.pulse-dot-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 20px 4px #38bdf8aa;
  animation: pulseCore 2.2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes pulseCore {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.1); }
}

.pulse-typewriter {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  color: var(--white);
  min-height: 24px;
  white-space: pre;
}

.pulse-typewriter .cursor {
  display: inline-block;
  width: 8px;
  background: var(--white);
  margin-left: 2px;
  animation: cursorBlink 0.9s step-end infinite;
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.pulse-engines {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.pulse-pill {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 8px 16px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.pulse-pill.visible { opacity: 1; transform: translateY(0); }

.pulse-pill.orange { color: var(--orange); border: 1px solid #f2652255; background: #f2652212; }
.pulse-pill.blue { color: var(--blue); border: 1px solid #38bdf855; background: #38bdf812; }
.pulse-pill.green { color: var(--green); border: 1px solid #8dc63f55; background: #8dc63f12; }
.pulse-pill.white { color: var(--white); border: 1px solid #f0f4ff55; background: #f0f4ff12; }

.pulse-cta {
  margin-top: 36px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.pulse-cta.visible { opacity: 1; }

.pulse-cta .k10-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 34px;
  color: var(--white);
}

.pulse-cta .k10-name .delta { color: var(--blue); }

.pulse-cta .k10-url {
  margin-top: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--dim);
}

/* Responsive */
@media (max-width: 860px) {
  .nav { padding: 16px 24px; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.nav-github) { display: none; }

  .hero { padding: 72px 24px 80px; }
  .hero-title { font-size: 48px; }
  .hero-lede { font-size: 17px; }

  .stats { padding: 28px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }

  .pulse-inner { padding: 0 24px; }
  .pulse-embed { height: 420px; }

  .section { padding: 64px 24px; }
  .section-heading { font-size: 32px; }

  .card-grid.cols-3 { grid-template-columns: 1fr; }
  .card-grid.cols-2 { grid-template-columns: 1fr; }

  .arch-subgrid { grid-template-columns: 1fr; }

  .closing { padding: 80px 24px; }
  .closing-quote { font-size: 19px; }

  .site-footer { padding: 24px; flex-direction: column; text-align: center; }

  .cycle-svg { width: 320px; height: 320px; }
}
