:root {
  --bg: #05070d;
  --bg-2: #0a0f1c;
  --panel: rgba(14, 20, 36, 0.72);
  --line: rgba(120, 160, 255, 0.14);
  --text: #e6edf7;
  --muted: #7d8aa5;
  --cyan: #22d3ee;
  --green: #4ade80;
  --purple: #a78bfa;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before { /* faint blueprint grid */
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  opacity: .5;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.ok { color: var(--green); }
.acc { color: var(--cyan); }
.grad {
  background: linear-gradient(90deg, var(--cyan), var(--purple) 60%, var(--green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.section { padding: 120px 0 40px; }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 36px; }
.kicker { color: var(--cyan); font-size: .85rem; margin-bottom: 12px; letter-spacing: .02em; }

/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: flex-end; padding: 32px;
  transition: opacity .6s ease, visibility .6s;
}
#boot.done { opacity: 0; visibility: hidden; }
#boot-log { font-family: var(--mono); font-size: .85rem; color: var(--muted); white-space: pre-wrap; }
#boot-log .ok { color: var(--green); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px clamp(16px, 4vw, 40px);
  background: linear-gradient(var(--bg), transparent);
  backdrop-filter: blur(6px);
}
.brand { font-family: var(--mono); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.nav nav { display: flex; gap: clamp(10px, 2vw, 28px); font-family: var(--mono); font-size: .82rem; }
.nav nav a { color: var(--muted); transition: color .2s; }
.nav nav a:hover { color: var(--cyan); }
@media (max-width: 760px) { .nav nav { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; }
#cluster-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-copy {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  width: min(1180px, 100% - 32px); margin-inline: auto; pointer-events: none;
}
.hero-copy > * { max-width: 620px; }
.hero-copy a { pointer-events: auto; }
.hero h1 { font-size: clamp(3rem, 9vw, 7rem); line-height: .92; letter-spacing: -0.04em; margin: 12px 0 18px; }
.role { font-size: clamp(1rem, 2.2vw, 1.35rem); color: var(--cyan); min-height: 1.6em; }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lede { color: #b6c2d8; font-size: 1.08rem; margin: 18px 0 28px; text-shadow: 0 2px 20px var(--bg); }
.pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: pulse 2s infinite; vertical-align: middle; margin-right: 4px;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: .9rem; padding: 12px 20px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text);
  cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--cyan); }
.btn.primary { background: var(--cyan); color: #00151b; border-color: var(--cyan); font-weight: 700; box-shadow: 0 0 30px rgba(34, 211, 238, .35); }
.hud {
  position: absolute; z-index: 2; right: clamp(16px, 4vw, 40px); bottom: 40px;
  display: grid; gap: 6px; font-size: .78rem; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(8px);
}
.hud b { color: var(--green); }
.scroll-hint { position: absolute; z-index: 2; bottom: 40px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: .75rem; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translate(-50%, 6px); } }
@media (max-width: 760px) {
  .hud { display: none; }
  .hero-copy { justify-content: flex-end; padding-bottom: 110px; }
}

/* ---------- panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px); position: relative; overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.lights { display: flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }

/* tilt + glare */
.tilt { transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.tilt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(34, 211, 238, .16), transparent 45%);
}
.tilt:hover::after { opacity: 1; }
.tilt:hover { box-shadow: 0 30px 60px -20px rgba(34, 211, 238, .25); border-color: rgba(34, 211, 238, .35); }

/* ---------- whoami ---------- */
.whoami { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 120px 0 60px; }
.yaml { padding: 20px; font-size: .84rem; line-height: 1.75; overflow-x: auto; color: #c9d4e8; }
.yaml .k { color: var(--cyan); }
.yaml .s { color: var(--green); }
.yaml .n { color: var(--amber); }
.yaml .c { color: var(--muted); }
.whoami-text p { color: #b6c2d8; font-size: 1.05rem; }
.whoami-text s { color: var(--muted); }
.stats { display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap; }
.stats b { display: block; font-family: var(--mono); font-size: 2.4rem; color: var(--cyan); line-height: 1; }
.stats span { color: var(--muted); font-size: .85rem; }
@media (max-width: 860px) { .whoami { grid-template-columns: 1fr; } }

/* ---------- pipeline ---------- */
.pipeline { position: relative; height: 420vh; }
.pipeline-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
#pipeline-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pipeline-copy { position: relative; z-index: 2; padding-top: 100px; pointer-events: none; }
.stage-card { max-width: 420px; padding: 22px 24px; pointer-events: auto; }
.stage-meta { font-size: .78rem; color: var(--muted); }
.stage-card h3 { font-size: 1.9rem; margin: 6px 0 8px; font-family: var(--mono); color: var(--cyan); }
.stage-card p { color: #b6c2d8; font-size: .96rem; min-height: 4.8em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { font-family: var(--mono); font-size: .72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--cyan); background: rgba(34, 211, 238, .06); }
.progress { margin-top: 18px; width: min(420px, 100%); height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--green)); }
@media (max-width: 760px) {
  .pipeline-copy { padding-top: auto; position: absolute; bottom: 24px; left: 0; right: 0; }
  .stage-card p { min-height: 0; }
}

/* ---------- timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--cyan), var(--purple), transparent); }
.rev { position: relative; margin-bottom: 26px; }
.rev::before {
  content: ""; position: absolute; left: -31px; top: 22px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 14px var(--cyan);
}
.rev.current::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 16px var(--green); }
.rev .panel { padding: 20px 24px; }
.rev-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.rev h3 { font-size: 1.3rem; }
.rev .at { color: var(--cyan); }
.rev .meta { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.rev ul { margin: 12px 0 0 18px; color: #b6c2d8; }
.rev li::marker { color: var(--cyan); }
.badge { font-family: var(--mono); font-size: .7rem; padding: 2px 8px; border-radius: 6px; margin-left: 8px; vertical-align: middle; }
.badge.live { background: rgba(74, 222, 128, .12); color: var(--green); border: 1px solid rgba(74, 222, 128, .3); }
.badge.todo { background: rgba(251, 191, 36, .12); color: var(--amber); border: 1px solid rgba(251, 191, 36, .3); }

/* ---------- services grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; perspective: 1200px; }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }
.svc { padding: 22px; display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.svc-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: .74rem; }
.svc-status { display: flex; align-items: center; gap: 6px; color: var(--green); }
.svc-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.svc h3 { font-size: 1.3rem; transform: translateZ(40px); }
.svc p { color: #b6c2d8; font-size: .94rem; flex: 1; transform: translateZ(20px); }
.svc .kind { color: var(--purple); }
.svc-links { display: flex; gap: 14px; font-family: var(--mono); font-size: .8rem; transform: translateZ(30px); }
.svc-links a { color: var(--cyan); }
.svc-links a:hover { text-decoration: underline; }
.svc.featured { border-color: rgba(34, 211, 238, .35); }

/* ---------- stack ---------- */
.stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.stack .panel { padding: 20px; }
.stack h3 { font-family: var(--mono); font-size: .86rem; color: var(--purple); margin-bottom: 12px; display: flex; justify-content: space-between; }
.stack h3 span { color: var(--green); font-weight: 400; }
.stack ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.stack li { font-family: var(--mono); font-size: .8rem; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: border-color .2s, color .2s; }
.stack li:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- terminal ---------- */
.term { max-width: 920px; }
.term-body { padding: 18px; height: 420px; overflow-y: auto; font-size: .86rem; cursor: text; }
.term-body .line { white-space: pre-wrap; word-break: break-word; }
.term-body .cmd { color: var(--text); }
.term-body .err { color: var(--red); }
.term-body .dim { color: var(--muted); }
.term-line { display: flex; gap: 8px; align-items: center; }
.term-line label { white-space: nowrap; }
.term-line input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; caret-color: var(--cyan); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: 920px; }
.chips button { font: inherit; font-size: .76rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--muted); cursor: pointer; }
.chips button:hover { color: var(--cyan); border-color: var(--cyan); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.contact-form { padding-bottom: 20px; }
.contact-form label { display: block; padding: 14px 20px 0; font-size: .8rem; color: var(--cyan); }
.contact-form input, .contact-form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 8px;
  background: rgba(0,0,0,.3); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: .9rem; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--cyan); }
.contact-form button { margin: 18px 20px 0; }
.contact-links { display: grid; gap: 12px; }
.link-card { padding: 14px 18px; display: flex; flex-direction: column; font-size: 1rem; word-break: break-all; }
.link-card span { font-size: .72rem; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 60px clamp(16px, 4vw, 40px) 30px; font-size: .78rem; color: var(--muted); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret, .pulse, .scroll-hint { animation: none; }
}
