:root {
  --ink: #080B12;
  --surface: #0F1420;
  --surface2: #151B2B;
  --line: #232B3D;
  --copper: #E8A54B;
  --copper-dim: #8A6530;
  --indigo: #6C7CFF;
  --mist: #8B93A7;
  --paper: #EDEFF4;
  --good: #4ADE80;
}

* { scroll-behavior: smooth; }

body { background-color: var(--ink); }

/* ---------- Backdrop ---------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 40%, transparent 90%);
}

.bg-vignette {
  background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(232,165,75,0.10), transparent 60%),
              radial-gradient(ellipse 60% 40% at 100% 100%, rgba(108,124,255,0.08), transparent 60%);
}

/* ---------- Pipeline rail (signature element) ---------- */
.pipeline-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  height: 220px;
  width: 2px;
  background: var(--line);
  z-index: 30;
  display: none;
}
@media (min-width: 1024px) { .pipeline-rail { display: block; } }

.pipeline-fill {
  position: absolute;
  top: 0; left: 0; width: 100%;
  height: 2%;
  background: linear-gradient(to bottom, var(--copper), var(--indigo));
  transition: height 0.25s ease-out;
}

.pipeline-node {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1.5px solid var(--line);
  transition: all 0.25s ease;
}
.pipeline-node.active {
  background: var(--copper);
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(232,165,75,0.15);
}
.pipeline-node span {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--mist);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pipeline-node:hover span,
.pipeline-node.active span { opacity: 1; color: var(--paper); }

/* ---------- Nav ---------- */
.nav-link { position: relative; transition: color 0.2s ease; }
.nav-link:hover { color: var(--paper); }
.nav-link.active { color: var(--copper); }
.mobile-link { padding: 4px 0; }

.pulse-dot { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.55); }
  70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* ---------- Typed line / cursor ---------- */
.typed-line { white-space: nowrap; overflow: hidden; }
.cursor-blink { animation: blink 1s step-end infinite; color: var(--copper); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--copper);
  color: #14100A;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 12px 20px;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 0 0 0 rgba(232,165,75,0);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(232,165,75,0.55); }
.btn-primary:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 11px 20px;
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-ghost:hover { border-color: var(--copper); background: rgba(232,165,75,0.06); }
.btn-ghost:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--mist);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--copper); border-color: var(--copper-dim); }

/* ---------- Status card ---------- */
.status-card {
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
}

/* ---------- Section chrome ---------- */
.section-eyebrow {
  display: flex; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: -0.01em;
  color: var(--paper);
}
.section-sub {
  color: var(--mist);
  max-width: 42rem;
  margin-top: 10px;
  line-height: 1.6;
}

/* ---------- Stack cells ---------- */
.stack-cell {
  background: var(--surface);
  padding: 26px 24px;
  transition: background 0.2s ease;
}
.stack-cell:hover { background: var(--surface2); }
.stack-cell h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--paper);
  margin-bottom: 8px;
}
.stack-cell p { color: var(--mist); font-size: 13.5px; line-height: 1.6; }

/* ---------- Project cards ---------- */
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 28px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover { border-color: var(--copper-dim); }

.project-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.project-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--paper);
  margin-top: 8px;
}
.project-tagline { color: var(--mist); font-size: 14px; margin-top: 2px; }
.project-desc { color: var(--mist); font-size: 14.5px; line-height: 1.65; margin-top: 14px; max-width: 44rem; }

.build-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(74,222,128,0.35);
  color: var(--good);
  background: rgba(74,222,128,0.08);
}

.link-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.link-chip:hover { border-color: var(--copper); color: var(--copper); }

.project-bullets { margin-top: 16px; display: grid; gap: 9px; }
.project-bullets li {
  position: relative;
  padding-left: 18px;
  color: #C4CADB;
  font-size: 13.75px;
  line-height: 1.6;
}
.project-bullets li::before {
  content: '';
  position: absolute; left: 0; top: 8px;
  width: 6px; height: 1.5px;
  background: var(--copper);
}
.project-bullets b { color: var(--paper); font-weight: 600; }

.project-stack {
  margin-top: 18px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.project-stack span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mist);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
}

/* ---------- Stats ---------- */
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--paper);
}
.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  margin-top: 4px;
}

/* ---------- Terminal ---------- */
.log-terminal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  height: fit-content;
}
.log-terminal-head {
  display: flex; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface2);
}
.log-terminal-head .dot { width: 9px; height: 9px; border-radius: 999px; margin-right: 6px; }
.log-terminal-body { padding: 20px 20px 24px; color: #C4CADB; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--copper-dim); }

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 4px; }