/* oteldebug.nochaos.io: war-room / fire theme, shared with dojo.nochaos.io.
   Dark ground, ember accents, mono chrome. Depth comes from hairline borders
   and soft ember glow, never from flat shadows. */

:root {
  --bg: #0a0908;
  --bg-2: #120f0d;
  --panel: #151110;
  --line: #2b2320;
  --line-2: #3a2f2a;
  --text: #f2ebe4;
  --dim: #a3958c;
  --mute: #6b5f58;
  /* The call to action rides the brand primary, flat, with a darker line. */
  --cta: #d4763e;
  --cta-line: #8f3e29;
  --cta-hot: #dbab5f;
  --ember: #d4763e;
  --ember-2: #d99457;
  --amber: #dbab5f;
  --ok: #4ade80;
  --bad: #f87171;
  --info: #60a5fa;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Uppercase chrome labels (top nav, section kickers). */
  --label: 'JetBrains Mono', 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Archivo Black', Impact, 'Arial Black', sans-serif;
  --hand: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Square by default: the chrome reads as a terminal, not as a card kit. */
  --radius: 0;
  --fire: linear-gradient(180deg, #e7d296 0%, var(--amber) 30%, var(--ember) 65%, #8f3e29 100%);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(212, 118, 62, 0.22), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size:
    100% 100%,
    32px 32px,
    32px 32px;
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* CRT scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
  pointer-events: none;
  z-index: 1;
}

/* ambient telemetry drifting behind the page (assets/js/backdrop.js) */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(16px, 3vh, 28px) max(20px, env(safe-area-inset-right))
    calc(48px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.page > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--mono);
}

/* ── topbar ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: calc(14px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 14px
    max(24px, env(safe-area-inset-left));
  background: rgba(10, 9, 8, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.5px;
  color: var(--text);
  transform: rotate(-2deg);
  transition: color 0.15s;
}

.brand:hover {
  color: var(--amber);
}

.brand .logo-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(212, 118, 62, 0.45));
}

.brand .logo-mark rect:first-of-type {
  fill: var(--ember);
}

.brand .logo-mark polygon,
.brand .logo-mark rect:last-of-type {
  fill: #0e0905;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--label);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.topbar nav a {
  color: var(--dim);
  position: relative;
  padding-bottom: 3px;
  text-decoration: none;
}

.topbar nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--ember);
  box-shadow: 0 0 8px rgba(212, 118, 62, 0.8);
  transition: width 0.25s var(--ease);
}

.topbar nav a:hover {
  color: var(--text);
}

.topbar nav a.active {
  color: var(--amber);
}

.topbar nav a:hover::after,
.topbar nav a.active::after {
  width: 100%;
}

.details-link {
  font-style: italic;
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

.details-link:hover {
  color: var(--ember-2);
}

@keyframes stat-glow {
  0% {
    text-shadow:
      0 0 0 rgba(219, 171, 95, 0),
      0 0 0 rgba(212, 118, 62, 0);
  }
  30% {
    text-shadow:
      0 0 16px rgba(231, 210, 150, 1),
      0 0 40px rgba(212, 118, 62, 0.9);
  }
}

/* ── panel (war room console) ───────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 2px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(212, 118, 62, 0.06);
  overflow: hidden;
  animation: rise 0.22s ease-out;
}

.panel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
}

.panel-title {
  flex: 1;
  font-family: var(--label);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 700;
}

.panel-status {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--mute);
}

.panel-status.is-paging {
  color: var(--amber);
  animation: pulse 1.6s infinite;
}

.panel-status.is-ack {
  color: var(--ok);
}

.panel-status.is-bad {
  color: var(--bad);
}

/* head: token + timer + actions */
.console-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.token-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 280px;
  min-width: 0;
}

.field-label {
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
}

.token-value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--mute);
  word-break: break-all;
  line-height: 1.3;
}

.token-value.has-token {
  color: var(--amber);
  text-shadow: 0 0 14px rgba(219, 171, 95, 0.35);
}

.console-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ttl {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 9px 12px;
  white-space: nowrap;
}

.ttl b {
  color: var(--text);
  font-size: 0.85rem;
}

.ttl.ttl-low {
  border-style: solid;
  border-color: var(--bad);
  color: var(--bad);
}

.ttl.ttl-low b {
  color: var(--bad);
}

.ttl.ttl-expired {
  border-style: solid;
  border-color: var(--bad);
  background: rgba(248, 113, 113, 0.1);
  color: var(--bad);
}

.ttl.ttl-expired b {
  color: var(--bad);
}

/* buttons */
.btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius);
  padding: 11px 18px;
  cursor: pointer;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    background 0.12s,
    border-color 0.12s;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Flat, not a gradient, with no halo: hover answers with the border. */
.btn-fire {
  background: var(--cta);
  border-color: var(--cta-line);
  color: #0e0905;
}

.btn-fire:not(:disabled):hover {
  border-color: var(--cta-hot);
}

.btn-ghost:not(:disabled):hover {
  border-color: var(--ember-2);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.66rem;
}

.link {
  background: none;
  border: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 0;
}

.link:hover {
  color: var(--text);
}

/* shared-item banner */
.shared-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: rgba(219, 171, 95, 0.08);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* toolbar: tabs + search */
.console-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.tabs {
  display: inline-flex;
  gap: 0.25rem;
  flex: 0 0 auto;
  align-self: stretch;
}

.tab {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: none;
  color: var(--dim);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 16px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--amber);
  border-color: var(--ember);
}

.count {
  font-weight: 700;
  color: var(--amber);
  min-width: 1.2em;
  text-align: center;
  transition: transform 0.2s;
  display: inline-block;
}

.count.bump {
  color: #e7d296;
  transform: scale(1.25);
  animation: stat-glow 0.9s ease-out;
}

.search {
  position: relative;
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search::before {
  content: '$ grep';
  position: absolute;
  left: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--mute);
  pointer-events: none;
}

.search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 7px 32px 7px 68px;
  transition: border-color 0.15s;
  outline: none;
}

.search input::placeholder {
  color: var(--mute);
}

.search input:focus {
  border-color: var(--ember);
  box-shadow: 0 0 0 1px var(--ember);
}

.search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: 0;
  color: var(--mute);
  font-size: 1rem;
  width: 24px;
  height: 24px;
  cursor: pointer;
  line-height: 1;
}

.search-clear:hover {
  color: var(--text);
}

/* ── log window (tail -f) ───────────────────────────────────────────── */
.log {
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.log-window {
  min-height: 320px;
  max-height: clamp(340px, 56vh, 680px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
  padding: 6px 0;
}

.log-muted {
  color: var(--mute);
  padding: 8px 20px;
  line-height: 1.7;
}

.log-muted b {
  color: var(--dim);
  font-weight: 700;
}

.log-muted code {
  color: var(--amber);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.log-entry {
  border-bottom: 1px dashed var(--line);
}

.log-entry:last-of-type {
  border-bottom: 0;
}

.log-entry.is-hidden {
  display: none;
}

.log-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 20px;
  cursor: pointer;
  line-height: 1.5;
  transition: background 0.12s;
}

.log-head:hover {
  background: rgba(255, 255, 255, 0.025);
}

.log-head:focus-visible {
  outline: 1px solid var(--ember);
  outline-offset: -1px;
}

.log-chev {
  color: var(--mute);
  font-size: 0.6rem;
  width: 10px;
  flex: 0 0 auto;
  transition: transform 0.15s;
}

.log-entry.open .log-chev {
  transform: rotate(90deg);
  color: var(--ember);
}

.log-ts {
  color: var(--mute);
  white-space: nowrap;
  flex: 0 0 auto;
}

.log-ack {
  color: var(--ok);
  font-weight: 700;
  letter-spacing: 1px;
  flex: 0 0 auto;
}

.log-name {
  color: var(--amber);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.log-detail {
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.log-actions {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.log-btn {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 3px 8px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.log-btn:hover,
.log-btn.copied,
.btn.copied,
.btn.copied:hover {
  border-color: var(--ok);
  color: var(--ok);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
  animation: copied-in 0.25s ease-out;
}

@keyframes copied-in {
  from {
    opacity: 0.2;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.log-body {
  display: none;
  padding: 0 20px 12px 40px;
}

.log-entry.open .log-body {
  display: block;
}

.log-body pre {
  margin: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ember);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text);
  overflow: auto;
  max-height: 360px;
}

.log-entry.highlighted {
  background: rgba(219, 171, 95, 0.06);
  box-shadow: inset 2px 0 0 var(--amber);
}

/* json tint */
.j-key {
  color: var(--amber);
}

.j-str {
  color: var(--ok);
}

.j-num {
  color: var(--ember-2);
}

.j-lit {
  color: var(--bad);
}

/* empty-state snippet */
.snippet {
  margin: 10px 20px 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
}

.snippet pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--dim);
  white-space: pre-wrap;
  word-break: break-all;
}

.snippet pre b {
  color: var(--amber);
  font-weight: 700;
}

.snippet .log-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 0.95em;
  background: currentColor;
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}

.error {
  margin: 0 0 16px;
  padding: 12px 20px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.08);
  color: var(--bad);
  font-family: var(--mono);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.error .link {
  color: var(--bad);
  padding: 0;
}

/* ── docs page ──────────────────────────────────────────────────────── */
.details {
  padding: 40px 0 40px;
  width: 100%;
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
}

.back {
  font-family: var(--label);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.details-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 18px 0 28px;
  background: var(--fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(212, 118, 62, 0.35));
}

.details-body {
  font-size: 1.02rem;
  font-weight: 300;
  color: var(--text);
}

.details-body p {
  margin: 0 0 18px;
}

.details-body h2 {
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  margin: 34px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.details-body h2 .step-n {
  color: var(--mute);
  font-weight: 400;
}

.details-body ul,
.details-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.details-body li {
  margin-bottom: 6px;
}

.details-body li::marker {
  color: var(--ember);
}

.details-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--amber);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1px 6px;
}

.details-body b {
  font-weight: 600;
  color: var(--amber);
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--ember);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 18px;
  overflow-x: auto;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.code-block pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--text);
}

.code-block pre b {
  color: var(--amber);
  font-weight: 700;
}

.note {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
}

.note b {
  color: var(--amber);
  margin-right: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

table.endpoints-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.78rem;
  margin: 0 0 18px;
}

table.endpoints-table th,
table.endpoints-table td {
  overflow-wrap: anywhere;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px dashed var(--line);
}

table.endpoints-table th {
  color: var(--mute);
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.68rem;
}

table.endpoints-table td:first-child {
  color: var(--amber);
}

/* ── landing ────────────────────────────────────────────────────────── */
/* The home before a token exists. Structure borrowed from a product landing
   (hero with a live scene, then a strip of supported stacks); the palette
   stays the war-room one. */
.landing {
  display: flex;
  flex-direction: column;
}

.hero {
  padding: 0;
  text-align: center;
}

/* Sentence case display, one handwritten line that tilts off the baseline. */
.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, min(6vw, 8vh), 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 auto clamp(14px, 2.4vh, 24px);
  max-width: 12em;
}

.title-hand {
  display: inline-block;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.28em;
  letter-spacing: 0;
  line-height: 0.8;
  padding: 0 0.06em 0.12em;
  transform: rotate(-4deg) translateY(0.1em);
  background: var(--fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(212, 118, 62, 0.35));
}

.phrase {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--text);
  max-width: 36em;
  margin: 0 auto;
}

.phrase b {
  font-weight: 600;
  color: var(--amber);
}

.hero-cta {
  margin-top: clamp(18px, 3vh, 30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* The flat primary slab, same face as .btn-fire, scaled up. */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 34px;
  border: 1px solid var(--cta-line);
  border-radius: var(--radius);
  background: var(--cta);
  color: #0e0905;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.12s,
    border-color 0.12s,
    background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.cta-label {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.cta:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--cta-hot);
}

.cta:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

.cta:disabled {
  cursor: progress;
  opacity: 0.6;
}

.cta-ghost {
  background: transparent;
  border-color: var(--ember);
  color: var(--text);
}

.cta-ghost:hover:not(:disabled) {
  background: rgba(212, 118, 62, 0.1);
}

.cta-notice {
  margin: 4px 0 0;
  padding: 8px 14px;
  border: 1px dashed rgba(219, 171, 95, 0.5);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  max-width: 520px;
}

/* ── hero scene ── */
/* Wider than the text column: breaks out to the viewport, capped. */
.scene {
  --scene-w: min(1000px, calc(100vw - 40px));
  width: var(--scene-w);
  margin: clamp(20px, 4vh, 44px) 0 0 calc(50% - var(--scene-w) / 2);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: center;
  text-align: left;
}

.scene-console {
  position: relative;
  z-index: 1;
}

.scene-mascot {
  position: relative;
  display: flex;
  justify-content: center;
}

.scene-mascot img {
  position: relative;
  width: clamp(120px, 22vh, 240px);
  height: auto;
  filter: drop-shadow(0 0 30px rgba(212, 118, 62, 0.3));
}

/* Light cone from the mascot out to the console. */
.beam {
  position: absolute;
  top: 18%;
  height: 64%;
  width: 70%;
  pointer-events: none;
}

.beam-right {
  left: 58%;
  background: linear-gradient(90deg, rgba(212, 118, 62, 0.45), transparent);
  clip-path: polygon(0 44%, 100% 0, 100% 100%, 0 56%);
}

.scene-console {
  background: var(--bg);
  border: 2px solid var(--line-2);
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(212, 118, 62, 0.1);
  font-family: var(--mono);
  font-size: 0.72rem;
}

/* Terminal with the call to action right under it, centred on its width. */
.scene-side {
  min-width: 0;
}

.scene-cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(12px, 2vh, 18px);
}

.scene-cta .cta {
  position: relative;
  white-space: nowrap;
  padding: 18px 46px;
  box-shadow: 0 0 40px rgba(212, 118, 62, 0.3);
}

/* Same face as the headline, so the call to action reads as part of it. */
.scene-cta .cta-label {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 1px;
}

/* A spark that keeps running around the button's edge: a conic gradient
   spun by a registered angle, masked down to a 2px ring. The blurred copy
   underneath is its glow. */
@property --orbit {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.scene-cta .cta::before,
.scene-cta .cta::after {
  content: '';
  position: absolute;
  inset: -3px;
  padding: 2px;
  background: conic-gradient(
    from var(--orbit),
    transparent 0 62%,
    rgba(219, 171, 95, 0.4) 76%,
    var(--amber) 88%,
    #fff4d6 94%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  pointer-events: none;
  animation: orbit 2.6s linear infinite;
}

.scene-cta .cta::after {
  inset: -5px;
  padding: 4px;
  filter: blur(6px);
}

.scene-cta .cta:disabled::before,
.scene-cta .cta:disabled::after {
  animation-play-state: paused;
}

@keyframes orbit {
  to {
    --orbit: 360deg;
  }
}

.scene-bar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--dim);
}

/* A tail of collector debug output. Fixed height, newest line at the bottom:
   the stream is the one moving thing on the page. */
.scene-lines {
  margin: 0;
  height: clamp(100px, 17vh, 210px);
  padding: 10px 14px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--dim);
  white-space: pre;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%);
  mask-image: linear-gradient(180deg, transparent 0, #000 30%);
}

.scene-lines .k-head {
  color: var(--ember);
  font-weight: 700;
}

.scene-lines .k-str {
  color: var(--amber);
}

.scene-lines .k-num {
  color: var(--ember-2);
}

.scene-lines .k-id {
  color: var(--mute);
}

.scene-lines .k-ok {
  color: var(--ok);
}

.scene-lines .k-bad {
  color: var(--bad);
  font-weight: 700;
}

/* ── stack strip ── */
.stack {
  margin-top: clamp(16px, 3.5vh, 44px);
  text-align: center;
}

.stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.9vw, 1.35rem);
  letter-spacing: -0.02em;
  color: var(--text);
  opacity: 0.8;
}

@media (max-width: 1100px) {
  .scene {
    grid-template-columns: minmax(0, 1fr);
  }

  .scene-mascot {
    display: none;
  }
}

@media (max-width: 760px) {
  .hero {
    padding-top: 12px;
  }

  .scene {
    margin-top: 22px;
  }



  .stack-list {
    gap: 10px 24px;
  }

}

/* ── touch screens ──────────────────────────────────────────────────── */
/* Phones and tablets: 44px targets (Apple HIG), 16px inputs so iOS Safari
   does not zoom on focus, and no hover lift stuck on after a tap. */
@media (pointer: coarse) {
  .topbar nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-bottom: 0;
  }

  .topbar nav a::after {
    bottom: 8px;
  }

  .brand {
    min-height: 44px;
  }

  .btn,
  .tab,
  .cta {
    min-height: 44px;
  }

  .search input {
    font-size: 16px;
    min-height: 44px;
  }

  .search::before {
    font-size: 0.8rem;
  }

  .search-clear {
    width: 44px;
    height: 44px;
    right: 0;
  }

  .log-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 6px 10px;
  }

  .back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-right: 12px;
  }

  .link {
    min-height: 44px;
  }
}

@media (hover: none) {
  .btn:not(:disabled):hover,
  .cta:hover:not(:disabled) {
    transform: none;
  }
}

/* ── animations ─────────────────────────────────────────────────────── */
@keyframes blink {
  to {
    visibility: hidden;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-cta .cta::before,
  .scene-cta .cta::after {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .page {
    padding: 20px 16px 32px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .brand {
    font-size: 1.3rem;
    gap: 0.45rem;
  }

  .brand .logo-mark {
    width: 24px;
    height: 24px;
  }

  .topbar nav {
    letter-spacing: 1px;
    white-space: nowrap;
  }

  .console-head {
    padding: 14px 16px;
  }

  .console-actions {
    width: 100%;
  }

  .console-actions .btn {
    flex: 1 1 0;
  }

  .ttl {
    flex: 1 1 100%;
    text-align: center;
  }

  .console-toolbar {
    padding: 10px 16px;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    justify-content: center;
    padding: 12px 6px 10px;
    letter-spacing: 1px;
  }

  .log-head {
    flex-wrap: wrap;
    padding: 8px 16px;
  }

  .log-detail {
    flex-basis: 100%;
    order: 5;
    padding-left: 20px;
  }

  .log-body {
    padding: 0 16px 12px 16px;
  }

  .log-muted,
  .snippet {
    margin-left: 16px;
    margin-right: 16px;
    padding-left: 0;
    padding-right: 0;
  }

  .snippet {
    padding: 12px 14px;
  }

  .search::before {
    content: '$';
  }

  .search input {
    padding-left: 26px;
  }
}

/* Small phones (iPhone SE, mini): tighter chrome so the brand and the nav
   share one line, and the call to action keeps its label on one line. */
@media (max-width: 400px) {
  .topbar {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .brand {
    font-size: 1.12rem;
    gap: 0.4rem;
  }

  .brand .logo-mark {
    width: 22px;
    height: 22px;
  }

  .topbar nav {
    font-size: 0.68rem;
    letter-spacing: 0.5px;
  }

  .scene-cta .cta {
    padding: 16px 26px;
  }

  .scene-cta .cta-label {
    font-size: 0.95rem;
  }
}
