/* ============================================================
   blueplanet · codex — main stylesheet
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Background scale */
  --bg-0: #050811;
  --bg-1: #0a1020;
  --bg-2: #0f1628;
  --bg-3: #141d36;
  --bg-elevated: #181f38;

  /* Borders */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(86, 224, 163, 0.35);

  /* Text */
  --text: #e7ecf5;
  --text-muted: #8390a8;
  --text-dim: #525e76;
  --text-bright: #ffffff;

  /* Accents */
  --accent: #56e0a3;
  --accent-soft: #56e0a31a;
  --accent-glow: rgba(86, 224, 163, 0.45);
  --secondary: #5fb3ff;
  --secondary-soft: #5fb3ff1a;
  --warning: #ffb84d;
  --magenta: #ff7ad9;
  --purple: #a78bff;
  --danger: #ff6b7a;

  /* Typography */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* Layout */
  --container: 1200px;
  --pad-x: clamp(1rem, 4vw, 2.25rem);
  --section-y: clamp(4rem, 10vh, 7rem);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 160ms var(--ease);
  --t-mid:  280ms var(--ease);
  --t-slow: 600ms var(--ease);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, pre, blockquote {
  margin: 0;
}
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea { font: inherit; color: inherit; }

/* ---------- Base ---------- */
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(95, 179, 255, 0.07), transparent 70%),
    radial-gradient(900px 500px at -10% 30%, rgba(86, 224, 163, 0.05), transparent 70%);
}

::selection { background: var(--accent); color: var(--bg-0); }

.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: var(--bg-0);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
.mono { font-family: var(--font-mono); font-feature-settings: "calt" 1, "ss01" 1; }
.dim { color: var(--text-muted); }
.bright { color: var(--text-bright); font-weight: 600; }
.small { font-size: 0.86rem; }
.accent-text {
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
}
kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  padding: 0.18em 0.45em;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text);
}

/* ---------- Status bar ---------- */
.statusbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 8, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
}
.statusbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.55rem var(--pad-x);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-muted);
}
.statusbar .ok  { color: var(--accent); }
.statusbar .sep { color: var(--text-dim); }
.statusbar .grow { flex: 1; }
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 31px; z-index: 90;
  background: rgba(5, 8, 17, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color var(--t-fast);
}
.logo:hover { color: var(--accent); }
.logo-mark { color: var(--text); }
.logo-text { display: inline-flex; gap: 0.05em; }
.logo-satellite {
  transform-origin: 16px 16px;
  animation: orbit 9s linear infinite;
}
@keyframes orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.nav {
  display: flex;
  gap: 1.7rem;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 450;
}
.nav a {
  color: var(--text-muted);
  position: relative;
  padding: 0.2em 0;
  transition: color var(--t-fast);
}
.nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-mid);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.kbd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-1);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.kbd-trigger:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg-2);
}
.kbd-trigger kbd {
  background: var(--bg-3);
  border-color: rgba(255,255,255,0.18);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 95px);
  padding: clamp(2.5rem, 8vh, 5rem) 0 clamp(3rem, 10vh, 6rem);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
#stars {
  position: absolute; inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
  opacity: 0.55;
}
.hero-grid {
  position: absolute; inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent 80%);
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.6rem;
  width: 100%;
}

.terminal {
  width: 100%;
  max-width: 720px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(86,224,163,0.04);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--text-dim);
}
.dot-r { background: #ff5f57; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #28c941; }
.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}
.terminal-body {
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text);
  min-height: 5.5rem;
}
.terminal-body.small { font-size: 0.78rem; line-height: 1.7; white-space: pre; }
.terminal-body .line { white-space: pre-wrap; word-break: break-word; }
.terminal-body .out { color: var(--text-muted); margin-top: 0.4rem; min-height: 1.6em; }

.prompt-user { color: var(--accent); }
.prompt-host { color: var(--secondary); }
.prompt-path { color: var(--warning); }
.prompt-sep  { color: var(--text-dim); }

.cursor {
  display: inline-block;
  width: 0.55em;
  margin-left: 1px;
  color: var(--accent);
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink {
  to { visibility: hidden; }
}

.hero-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2.4rem, 7.5vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 18ch;
}
.hero-title .muted-line {
  display: block;
  color: var(--text-muted);
  font-weight: 300;
  font-size: 0.55em;
  letter-spacing: -0.02em;
  margin-bottom: 0.3em;
}
.hero-title .big { display: block; color: var(--text-bright); }

.hero-lead {
  max-width: 60ch;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  color: var(--text-muted);
  line-height: 1.65;
}
.hero-lead .bright {
  color: var(--text);
  background: linear-gradient(transparent 70%, var(--accent-soft) 70%);
  padding: 0 0.15em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.4rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all var(--t-mid);
  position: relative;
  overflow: hidden;
}
.btn .arrow { transition: transform var(--t-fast); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--accent);
  color: var(--bg-0);
  box-shadow: 0 8px 30px -10px var(--accent-glow);
}
.btn-primary:hover {
  background: #6df0b3;
  box-shadow: 0 14px 40px -10px var(--accent-glow), 0 0 0 1px var(--accent);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--border-strong);
  width: 100%;
  max-width: 720px;
}
.hero-meta .sep { color: var(--text-dim); }
.hero-meta .badge {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.4em;
  vertical-align: middle;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.55;
}
.scroll-line {
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-drop 2.2s ease-in-out infinite;
}
@keyframes scroll-drop {
  0%   { transform: scaleY(0); transform-origin: top; }
  40%  { transform: scaleY(1); transform-origin: top; }
  60%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Sections base ---------- */
.section {
  padding: var(--section-y) 0;
  position: relative;
}
.section-alt {
  background:
    linear-gradient(180deg, transparent, var(--bg-1) 12%, var(--bg-1) 88%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head {
  max-width: 70ch;
  margin-bottom: clamp(2.2rem, 5vh, 3.2rem);
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding: 0.25rem 0.65rem;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
}
.section h2 {
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.9rem;
  color: var(--text-bright);
}
.section-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 60ch;
}
.section-head.center .section-sub { margin-left: auto; margin-right: auto; }

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .logo-satellite, .status-dot, .cursor, .scroll-line { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Thesis ---------- */
.thesis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.thesis-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.8rem 1.6rem 1.4rem;
  position: relative;
  overflow: hidden;
  transition: all var(--t-mid);
}
.thesis-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.3;
  transition: opacity var(--t-mid);
}
.thesis-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-2);
  transform: translateY(-3px);
}
.thesis-card:hover::before { opacity: 1; }
.thesis-num {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}
.thesis-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.9rem;
  color: var(--text-bright);
}
.thesis-card p {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.65;
}
.thesis-card .mono { color: var(--accent); }
.card-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.company {
  --co: var(--accent);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: all var(--t-mid);
  isolation: isolate;
}
.company::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--co) 14%, transparent), transparent 55%);
  opacity: 0;
  transition: opacity var(--t-mid);
  z-index: -1;
}
.company:hover {
  border-color: color-mix(in srgb, var(--co) 60%, var(--border));
  transform: translateY(-3px);
  box-shadow: 0 22px 50px -25px rgba(0,0,0,0.7);
}
.company:hover::before { opacity: 1; }
.company-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
}
.company-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--co);
  background: color-mix(in srgb, var(--co) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--co) 35%, transparent);
  border-radius: 10px;
}
.company h3 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-bright);
  margin-bottom: 0.15rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent);
}
.status-pill.is-soon {
  background: rgba(255, 184, 77, 0.10);
  border-color: rgba(255, 184, 77, 0.35);
  color: var(--warning);
}
.status-pill.is-soon .status-dot {
  background: var(--warning);
  animation-name: pulse-soon;
}
@keyframes pulse-soon {
  0%   { box-shadow: 0 0 0 0 rgba(255, 184, 77, 0.55); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.company-pitch {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tags li {
  padding: 0.2rem 0.55rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}
.company-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--co);
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
  transition: all var(--t-fast);
}
.company-link .arrow { transition: transform var(--t-fast); }
.company-link:hover .arrow { transform: translate(3px, -3px); }

/* Empty slot card */
.company-empty {
  background:
    repeating-linear-gradient(135deg,
      var(--bg-1),
      var(--bg-1) 10px,
      var(--bg-2) 10px,
      var(--bg-2) 11px);
  border-style: dashed;
  border-color: var(--border-strong);
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 260px;
}
.empty-content { display: grid; gap: 0.6rem; place-items: center; max-width: 24ch; }
.empty-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  color: var(--accent);
  border: 1px dashed var(--border-accent);
  border-radius: 10px;
  margin-bottom: 0.4rem;
}
.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.25;
}

/* ---------- Approach ---------- */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin-bottom: 3rem;
}
.approach-item {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: all var(--t-mid);
}
.approach-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-2);
}
.approach-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}
.approach-item h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-bright);
}
.approach-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Code quote */
.codequote {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  position: relative;
}
.codequote::before {
  content: "python";
  position: absolute;
  top: 0; right: 1.2rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  color: var(--text-muted);
}
.codequote .cm  { color: var(--text-dim); font-style: italic; }
.codequote .kw  { color: var(--magenta); }
.codequote .fn  { color: var(--secondary); }
.codequote .var { color: var(--text); }
.codequote .str { color: var(--accent); }

/* ---------- Stats / Numbers ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat {
  padding: 1.4rem 1rem;
  border-left: 1px solid var(--border);
  position: relative;
}
.stat:first-child { border-left: 0; }
.stat-value {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 30px var(--accent-glow);
  letter-spacing: -0.03em;
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.92rem;
  letter-spacing: -0.005em;
}

/* ---------- Manifesto ---------- */
.manifesto {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  position: relative;
}
.manifesto::before {
  content: "manifesto.md";
  position: absolute;
  top: 0; right: 1.4rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  color: var(--text-muted);
}
.manifesto .cm { color: var(--text-dim); }
.manifesto .h  { color: var(--accent); font-weight: 600; }

/* ---------- Contact ---------- */
.section-contact {
  background:
    linear-gradient(180deg, transparent, var(--bg-1));
}
.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}
.contact-copy h2 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-bright);
  margin: 0.3rem 0 1rem;
}
.contact-list {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.85rem;
}
.contact-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--border);
}
.contact-list a {
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: all var(--t-fast);
}
.contact-list a:hover { color: var(--accent); border-color: var(--accent); }
.contact-terminal .terminal { width: 100%; max-width: none; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 4rem 0 0;
  margin-top: 3rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.foot-h {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.foot-list { display: grid; gap: 0.6rem; font-size: 0.92rem; }
.foot-list a { color: var(--text); transition: color var(--t-fast); }
.foot-list a:hover { color: var(--accent); }
.logo.small { font-size: 0.85rem; gap: 0.55rem; }
.logo.small + p { margin-top: 0.9rem; max-width: 35ch; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.2rem 0;
  background: var(--bg-0);
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ---------- Command Palette / Modal ---------- */
.cmdk-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.cmdk-modal[hidden] { display: none; }
.cmdk-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 8, 17, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cmdk-panel {
  position: relative;
  width: min(560px, 92vw);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.85), 0 0 0 1px var(--border-accent);
  animation: pop var(--t-mid);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.cmdk-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-wrap input {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
}
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 0.5rem; }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background var(--t-fast);
}
.cmdk-item .cmdk-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}
.cmdk-item.is-active, .cmdk-item:hover {
  background: var(--bg-3);
}
.cmdk-item .cmdk-hint {
  margin-left: auto;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.cmdk-foot {
  display: flex;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.cmdk-panel-help { padding: 1.6rem; }
.help-title { color: var(--accent); margin-bottom: 1rem; font-size: 0.95rem; }
.help-list {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ---------- Product · BPCodex CMS ---------- */
.section-product {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.product-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(700px 380px at 80% 0%, rgba(86,224,163,0.08), transparent 70%),
    radial-gradient(600px 320px at 10% 90%, rgba(95,179,255,0.06), transparent 70%);
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 2.4rem;
  align-items: stretch;
  margin-bottom: 4rem;
}
.product-info { display: flex; flex-direction: column; gap: 1.2rem; }
.product-brand {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}
.product-mark {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
}
.product-name {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-bright);
  line-height: 1.1;
  margin-bottom: 0.2rem;
}
.product-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 52ch;
}

/* package.json card */
.pkg-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 70px -28px rgba(0,0,0,0.85), 0 0 0 1px rgba(86,224,163,0.05);
  display: flex;
  flex-direction: column;
}
.pkg-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.95rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.pkg-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--text-dim); }
.pkg-title {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pkg-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.5rem;
  margin-left: 0.7rem;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent);
}
.pkg-body {
  margin: 0;
  padding: 1.2rem 1.4rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  flex: 1;
}
.pkg-body code { white-space: pre; display: block; }
.pjk { color: var(--secondary); }   /* json key */
.pjs { color: var(--accent); }      /* json string value */
.pjp { color: var(--text-dim); }    /* punctuation */

/* Modules grid */
.modules-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.4rem;
  scroll-margin-top: 110px;
}
.modules-title .small { font-size: 0.78rem; }
.modules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 3.5rem;
}
.module {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all var(--t-mid);
  position: relative;
  overflow: hidden;
}
.module::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--t-mid);
}
.module:hover {
  background: var(--bg-2);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.module:hover::before { width: 100%; }
.module-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  border-radius: 7px;
}
.module h4 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  line-height: 1.2;
}
.module p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Integrations marquee */
.integrations-block {
  border-top: 1px dashed var(--border-strong);
  padding-top: 1.6rem;
}
.integrations-head {
  margin-bottom: 0.9rem;
  letter-spacing: 0.02em;
}
.integrations-marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
}
.integrations-track {
  display: flex;
  gap: 0.7rem;
  width: max-content;
  animation: marquee 42s linear infinite;
  padding-block: 0.3rem;
}
.integrations-marquee:hover .integrations-track { animation-play-state: paused; }
@keyframes marquee {
  to { transform: translateX(calc(-50% - 0.35rem)); }
}
.int-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.int-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (prefers-reduced-motion: reduce) {
  .integrations-track { animation: none; }
}

/* ---------- Easter eggs ---------- */
body.matrix-mode {
  --accent: #00ff88;
  --accent-glow: rgba(0, 255, 136, 0.7);
  --secondary: #00d2ff;
}
body.matrix-mode .hero-title .big {
  text-shadow: 0 0 30px var(--accent-glow);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .thesis-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
  .approach-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 0; }
  .stat { border-left: 0; border-top: 1px solid var(--border); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .product-hero { grid-template-columns: 1fr; gap: 1.6rem; margin-bottom: 3rem; }
  .modules-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .kbd-trigger { display: none; }
  .header-inner { gap: 1rem; }
  .statusbar-inner > span:nth-child(n+5):not(.grow) { display: none; }
  .hero { min-height: auto; padding-top: 2rem; padding-bottom: 4rem; }
  .scroll-hint { display: none; }
  .terminal { font-size: 0.78rem; }
  .terminal-title { display: none; }
  .thesis-grid, .portfolio-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .contact-list li { grid-template-columns: 1fr; gap: 0.2rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.8rem; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
  .manifesto { padding: 1.4rem 1.1rem; font-size: 0.85rem; line-height: 1.75; }
  .codequote { font-size: 0.82rem; padding: 1.2rem 1rem; }
  .modules-grid { grid-template-columns: 1fr 1fr; }
  .pkg-body { font-size: 0.74rem; padding: 1rem 1rem; }
  .product-mark { width: 44px; height: 44px; font-size: 1.05rem; }
  .product-brand { grid-template-columns: auto 1fr; gap: 0.7rem; }
  .product-brand .status-pill { grid-column: 1 / -1; justify-self: start; }
  .integrations-track { animation-duration: 30s; }
}
