/* ===== Tokens ===== */
:root {
  --ink: #0B0F17;
  --panel: #0F172A;
  --cyan: #06B6D4;
  --lime: #84CC16;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(15, 23, 42, 0.55);
}

html { scroll-padding-top: 5rem; }
body { background: var(--ink); }

/* ===== Scrollbar ===== */
* { scrollbar-width: thin; scrollbar-color: #1e293b transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 99px; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ===== Focus ===== */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* ===== Header ===== */
#site-header.is-scrolled {
  background: rgba(11, 15, 23, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-link { color: #94a3b8; transition: color .2s; }
.nav-link:hover, .nav-link.is-current { color: #fff; }
.mobile-link { display: block; padding: .75rem .5rem; border-radius: .5rem; color: #cbd5e1; }
.mobile-link:hover { background: rgba(255,255,255,.05); color: #fff; }

/* ===== Layout helpers ===== */
.section { padding-block: 5.5rem; }
@media (min-width: 1024px) { .section { padding-block: 7.5rem; } }
.h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; color: #fff; }

/* ===== Glass ===== */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

/* ===== Buttons ===== */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 500; font-size: .95rem;
  transition: transform .15s ease, background .2s, border-color .2s, box-shadow .2s;
}
.btn-primary { background: var(--cyan); color: #04141a; box-shadow: 0 0 0 0 rgba(6,182,212,.5); }
.btn-primary:hover { box-shadow: 0 0 28px -4px rgba(6,182,212,.7); transform: translateY(-1px); }
.btn-ghost { border: 1px solid rgba(255,255,255,.18); color: #fff; background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }

/* ===== Hero background ===== */
.grid-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 65% 35%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 65% 35%, #000 20%, transparent 75%);
}
.hero-glow {
  background:
    radial-gradient(500px 360px at 78% 28%, rgba(6,182,212,.16), transparent 70%),
    radial-gradient(420px 300px at 90% 70%, rgba(132,204,22,.08), transparent 70%);
}

/* ===== Live dot ===== */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--lime); position: relative; display: inline-block;
}
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--lime);
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%,100% { transform: scale(3); opacity: 0; } }

/* ===== Readouts ===== */
.readout {
  display: flex; flex-direction: column; gap: .15rem; padding: .55rem .5rem;
  border: 1px solid var(--line); border-radius: .6rem; background: rgba(0,0,0,.25);
}
.readout b { font-weight: 500; font-size: 1rem; }
.readout.lg { padding: .9rem 1rem; text-align: left; }
.readout.lg span { font-size: .75rem; color: #64748b; }
.readout.lg b { font-family: "Geist Mono", ui-monospace, monospace; font-size: 1.5rem; }

/* ===== Tech badges ===== */
.badge {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem;
  border: 1px solid var(--line); border-radius: .75rem; background: rgba(255,255,255,.02);
  transition: border-color .2s, background .2s;
}
.badge:hover { border-color: rgba(6,182,212,.5); background: rgba(6,182,212,.05); }
.badge svg { flex: none; color: var(--cyan); }
.badge span { font-size: .875rem; color: #e2e8f0; line-height: 1.25; }

/* ===== Pipeline steps ===== */
.step-btn {
  display: flex; align-items: center; gap: .85rem; width: 100%; min-width: 230px;
  padding: .9rem 1rem; text-align: left; border-radius: .8rem;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); color: #94a3b8;
  transition: border-color .2s, background .2s, color .2s;
}
.step-btn:hover { color: #fff; border-color: rgba(255,255,255,.2); }
.step-btn .step-num {
  display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 1px solid currentColor; font-family: "Geist Mono", monospace; font-size: .8rem;
}
.step-btn.is-active { color: #fff; border-color: var(--cyan); background: rgba(6,182,212,.08); }
.step-btn.is-active .step-num { background: var(--cyan); border-color: var(--cyan); color: #04141a; }
@media (min-width: 1024px) { .step-btn { min-width: 0; } }

.detail-in { animation: detailIn .4s ease both; }
@keyframes detailIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.flow-line {
  height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), var(--lime), transparent);
  background-size: 200% 100%; animation: flow 2.4s linear infinite; border-radius: 2px;
}
@keyframes flow { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ===== Tabs & chips ===== */
.tab {
  padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  color: #94a3b8; font-size: .9rem; transition: all .2s;
}
.tab:hover { color: #fff; }
.tab.is-active { background: var(--cyan); border-color: var(--cyan); color: #04141a; font-weight: 500; }
.chip {
  padding: .35rem .8rem; border-radius: .5rem; border: 1px solid var(--line);
  color: #94a3b8; font-size: .8rem; transition: all .2s;
}
.chip:hover { color: #fff; border-color: rgba(255,255,255,.25); }
.chip.is-active { border-color: var(--lime); color: var(--lime); background: rgba(132,204,22,.08); }

.tab-panel:not(.hidden) { animation: detailIn .35s ease both; }

/* ===== Rep bars ===== */
.rep-bar {
  position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%;
  border-radius: .5rem; cursor: pointer;
}
.rep-bar .fill {
  width: 100%; border-radius: .5rem .5rem .2rem .2rem; transition: height .6s cubic-bezier(.2,.8,.2,1), outline-color .2s;
  outline: 2px solid transparent; outline-offset: 2px;
}
.rep-bar.is-active .fill { outline-color: #fff; }
.rep-bar .lbl { position: absolute; bottom: -1.5rem; font-family: "Geist Mono", monospace; font-size: .7rem; color: #64748b; }

/* ===== Stats ===== */
.stat { transition: border-color .25s, transform .25s; }
.stat:hover { border-color: rgba(6,182,212,.45); }

/* ===== Form ===== */
.field {
  width: 100%; padding: .75rem .9rem; border-radius: .6rem; color: #fff;
  background: rgba(0,0,0,.3); border: 1px solid var(--line); transition: border-color .2s;
}
.field:hover { border-color: rgba(255,255,255,.2); }
.field:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(6,182,212,.18); }
.field.is-invalid { border-color: #f87171; }

/* ===== Reveal (single, restrained) ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Contact cards ===== */
.contact-card {
  display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.25rem;
  border: 1px solid var(--line); border-radius: 1rem; background: var(--glass); color: var(--cyan);
  transition: border-color .2s, transform .2s;
}
.contact-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.contact-card.is-primary { border-color: rgba(6,182,212,.5); background: rgba(6,182,212,.08); }
.contact-card svg { margin-bottom: .5rem; }

/* ===== Hero canvas sizing (independent of Tailwind) ===== */
#hero-canvas { display: block; width: 100%; aspect-ratio: 4 / 5; height: auto; }
