/* Team Dub Labs — retro-futuristic lab, executed with restraint */
:root {
  --carbon: #16181c;       /* page background, dark gray */
  --carbon-2: #1b1e23;     /* panels */
  --line: #2a2f37;         /* hairlines */
  --line-soft: #23272e;
  --smoke: #9aa2ad;        /* body text, light gray */
  --smoke-dim: #6b727c;    /* captions */
  --fog: #edeff2;          /* headings, bright */
  --ember: #ff6a1f;        /* the orange — signal color only */
  --ember-dim: #c2541a;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --pad-x: clamp(1.25rem, 5vw, 5rem);
  --max: 70rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--carbon);
  color: var(--smoke);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* faint instrument grid — low contrast, sits well behind content */
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: -1px -1px;
}

a { color: var(--fog); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}
::selection { background: var(--ember); color: var(--carbon); }

/* CRT scanline veil — very light, fixed, non-interactive */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
}

/* a soft vignette so the grid recedes at the edges */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 30%,
    transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

/* ---------- status bar ---------- */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--pad-x);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke-dim);
}
.sb-id { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--fog); font-weight: 500; }
.sb-meta { display: inline-flex; align-items: center; gap: 0.7rem; }
.sb-meta a { color: var(--smoke-dim); transition: color 150ms ease; }
.sb-meta a:hover { color: var(--ember); }
.sb-dot { opacity: 0.4; }

.led {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember);
  animation: blink 3s steps(1) infinite;
}
@keyframes blink { 0%, 92% { opacity: 1; } 93%, 100% { opacity: 0.25; } }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) var(--pad-x) clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 1.4rem;
}
.eyebrow-rule { width: 2.2rem; height: 1px; background: var(--ember-dim); opacity: 0.6; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 8vw, 5.6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--fog);
  margin: 0 0 1.6rem;
}
.caret-static {
  color: var(--ember);
  font-weight: 400;
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.lede {
  max-width: 34rem;
  color: var(--smoke);
  margin: 0 0 2.2rem;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember);
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--ember-dim);
  border-radius: 3px;
  background: transparent;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.btn:hover {
  color: var(--carbon);
  background: var(--ember);
  box-shadow: 0 0 24px rgba(255, 106, 31, 0.35);
}

/* ---------- terminal panel (the signature) ---------- */
.terminal {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #191c21, #141619);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8),
              inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.term-lights { display: inline-flex; gap: 0.4rem; }
.term-lights i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line);
  display: inline-block;
}
.term-lights i:first-child { background: var(--ember-dim); }
.term-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--smoke-dim);
}
.term-body {
  margin: 0;
  padding: 1.15rem 1.2rem 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--smoke);
  white-space: pre-wrap;
  min-height: 10.5rem;
}
.term-body .p { color: var(--ember); }
.term-body .ok { color: var(--fog); }
.term-body .dim { color: var(--smoke-dim); }
.term-body .cur {
  color: var(--ember);
  animation: caret 1.1s steps(1) infinite;
}
/* fallback line for no-JS / reduced motion; JS hides it */
.term-fallback {
  margin: 0;
  padding: 0 1.2rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--smoke-dim);
  display: none;
}

/* ---------- experiment registry ---------- */
.registry {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad-x) clamp(3.5rem, 7vw, 5.5rem);
}
.section-label {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--smoke-dim);
  margin: 0 0 1.6rem;
}
.section-label span { white-space: nowrap; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.reg-table {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--carbon-2);
}
.reg-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 9rem 7.5rem;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.3rem;
  border-bottom: 1px solid var(--line-soft);
}
.reg-row:last-child { border-bottom: 0; }
.reg-head {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--smoke-dim);
  background: rgba(255, 255, 255, 0.015);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.reg-row:not(.reg-head) { transition: background 150ms ease; }
.reg-row:not(.reg-head):hover { background: rgba(255, 106, 31, 0.04); }

.reg-id { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ember); letter-spacing: 0.04em; }
.reg-name { font-size: 1.08rem; font-weight: 600; color: var(--fog); letter-spacing: -0.01em; }
.reg-domain { font-family: var(--font-mono); font-size: 0.8rem; color: var(--smoke-dim); }
.reg-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--smoke-dim);
}
.reg-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--smoke-dim); }
.reg-status.is-active { color: var(--fog); }
.reg-status.is-active .dot {
  background: var(--ember);
  box-shadow: 0 0 0 0 rgba(255, 106, 31, 0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 106, 31, 0.5); }
  70%, 100% { box-shadow: 0 0 0 6px rgba(255, 106, 31, 0); }
}

.reg-foot {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--smoke-dim);
  margin: 1rem 0 0;
  text-align: right;
}

/* ---------- footer ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--pad-x) 2.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--smoke-dim);
}
.foot-id { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--smoke); }
.foot-meta { display: inline-flex; align-items: center; gap: 1.3rem; }
.foot-meta a { color: var(--smoke-dim); border-bottom: 1px solid var(--line); transition: color 150ms ease, border-color 150ms ease; }
.foot-meta a:hover { color: var(--ember); border-color: var(--ember); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .terminal { order: 2; }
  .reg-row { grid-template-columns: 5rem 1fr auto; row-gap: 0.35rem; }
  .reg-domain { display: none; }
  .reg-head { display: none; }
  .reg-name { font-size: 1rem; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .led, .caret-static, .reg-status.is-active .dot, .term-body .cur { animation: none; }
  .btn, .reg-row { transition: none; }
}
