/* Spaceship Void — pure #000000 zero-chrome vector steering & belief instrument */

:root {
  --bg: #000000;
  --ink: #ffffff;
  --ink-2: rgb(255 255 255 / 0.64);
  --ink-3: rgb(255 255 255 / 0.40);
  --ink-4: rgb(255 255 255 / 0.22);
  --ink-5: rgb(255 255 255 / 0.10);
  --hot: #ff5a1f;
  --hot-wash: rgb(255 90 31 / 0.32);
  --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', ui-monospace, monospace;
  --font-sz: 13px;
  --line-h: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--font-sz);
  line-height: var(--line-h);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  user-select: none;
}

::selection {
  background: var(--hot-wash);
  color: var(--ink);
}

#void-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: calc(100dvh - 18px);
  padding-top: clamp(42px, 9.5vh, 96px);
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: clip;
}

#void-stage.is-cuibono {
  --line-h: 20px;
  padding-top: clamp(20px, 3vh, 32px);
  padding-bottom: 36px;
}

#void-stage.is-cuibono #column {
  width: clamp(30ch, calc(100vw - 230px), 66ch);
}

#void-stage.is-cuibono .belief-para + .belief-para {
  margin-top: 14px;
}

#void-stage.is-cuibono #complexity-bar {
  margin-top: 12px;
}

#void-stage.is-cuibono #verdict-bar {
  margin-top: 0;
}

/* Full-stage SVG overlay for end-of-word dotted link & dashed realization curves */
#links {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
  overflow: hidden;
}

/* Top-Left Unmistakable Void HUD (`#score-hud`) — pure typography & geometric bars in #000 void */
#score-hud {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: clamp(160px, calc(50vw - 380px), 276px);
  pointer-events: none;
}

.hud-brand-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

#brand-mark {
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  text-transform: lowercase;
}

.hud-main-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud-streak-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud-streak-headline {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

#hud-streak-value {
  font-size: 42px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color 140ms ease;
}

#score-hud.is-advancing #hud-streak-value,
#score-hud.is-complete #hud-streak-value {
  color: var(--hot);
}

.hud-streak-label {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

#hud-streak-bars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}

.hud-streak-bar {
  width: 14px;
  height: 5px;
  background: var(--ink-5);
  transition: background-color 140ms ease, box-shadow 180ms ease;
}

.hud-streak-bar.is-filled {
  background: var(--ink);
}

.hud-streak-bar.is-flash,
.hud-streak-bar.is-complete {
  background: var(--hot);
  box-shadow: 0 0 8px rgb(255 90 31 / 0.44);
}

#hud-guesses-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

.hud-guesses-label {
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

#hud-guesses-value {
  font-size: 12px;
  line-height: 14px;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: color 120ms ease;
}

#score-hud.has-guesses #hud-guesses-value {
  color: var(--ink);
}

#hud-whisper {
  margin-top: 8px;
  min-height: 14px;
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 650ms ease;
}

#hud-whisper.is-visible {
  opacity: 0.74;
}

#hud-whisper.is-fresh {
  opacity: 1;
  transition: opacity 110ms ease;
}

.whisper-ink {
  color: var(--ink);
}

.whisper-hot {
  color: var(--hot);
}

.whisper-mid {
  color: var(--ink-2);
}

.whisper-dim {
  color: var(--ink-3);
}

/* Centered single monospace column */
#column {
  position: relative;
  width: clamp(28ch, calc(100vw - 260px), 58ch);
  margin: 0 auto;
  z-index: 5;
}

#cuibono-eyebrow {
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

#cuibono-eyebrow .eyebrow-streak {
  color: var(--hot);
}

#belief-wrap {
  position: relative;
  width: 100%;
}

/* Left-gutter salience rail aligned line-for-line with #belief-text */
#rail {
  position: absolute;
  top: 0;
  right: calc(100% + 26px);
  width: 58px;
  pointer-events: none;
}

.rail-row {
  position: absolute;
  right: 0;
  height: var(--line-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.rail-idx {
  font-size: 9px;
  line-height: 1;
  color: var(--ink-4);
}

.rail-meter {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 1px;
}

.rail-seg {
  width: 2px;
  height: 6px;
  background: var(--ink-5);
  transition: background-color 110ms linear;
}

.rail-seg.is-lit {
  background: var(--ink-3);
}

.rail-row.is-hot .rail-seg.is-lit {
  background: var(--hot);
}

.rail-row.is-hot .rail-idx {
  color: var(--hot);
}

/* Centered revealed belief & Cui Bono prose */
#belief-text {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: var(--font-sz);
  line-height: var(--line-h);
  letter-spacing: -0.005em;
  min-height: calc(var(--line-h) * 2);
  word-break: normal;
  overflow-wrap: break-word;
}

.belief-para {
  margin: 0;
  padding: 0;
}

.belief-para + .belief-para {
  margin-top: var(--line-h);
}

/* Clickable / draggable word attention spans (zero layout-shift contour boxes) */
.word {
  position: relative;
  cursor: pointer;
  border-radius: 1px;
  transition: color 180ms ease, background-color 120ms ease;
}

.word:hover {
  background: rgb(255 255 255 / 0.08);
}

.word.is-realized {
  border-bottom: 1px dashed rgb(255 255 255 / 0.34);
}

.word.is-realized-hot {
  border-bottom: 1px dashed var(--hot);
}

.word.is-selecting {
  background: var(--hot-wash);
  box-shadow: 0 0 0 1px var(--hot);
}

/* Pinned phrase wrapper (`lockedPhrases`) */
.phrase-box {
  position: relative;
  background: rgb(255 255 255 / 0.14);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.44);
  border-radius: 1px;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.phrase-box:hover,
.phrase-box.is-hot {
  background: var(--hot-wash);
  box-shadow: 0 0 0 1px var(--hot);
}

@keyframes settleWord {
  from {
    opacity: 0.42;
  }
  to {
    opacity: 1;
  }
}

.word.is-settling {
  animation: settleWord 160ms ease-out both;
}

@keyframes pulseHotWord {
  0% {
    color: var(--hot);
  }
  100% {
    color: var(--ink);
  }
}

.word.is-morphed {
  animation: pulseHotWord 420ms ease-out;
}

/* Element 2 — Single horizontal dotted complexity slider */
#complexity-bar {
  position: relative;
  width: 100%;
  height: 28px;
  margin-top: 20px;
  cursor: ew-resize;
  touch-action: none;
  outline: none;
}

#complexity-bar:focus-visible #pointer {
  box-shadow: 0 0 0 3px var(--hot-wash);
}

.complexity-track-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 28px;
  display: block;
  pointer-events: none;
}

#pointer {
  position: absolute;
  top: 7px;
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #000000;
  border: 1.5px solid #ffffff;
  cursor: grab;
  transition: background-color 90ms ease, border-color 90ms ease, box-shadow 90ms ease;
  z-index: 6;
}

/* Generous 42x42 touch target without visual chrome */
#pointer::before {
  content: '';
  position: absolute;
  inset: -14px;
}

#pointer:hover {
  border-color: var(--hot);
}

#complexity-bar.is-dragging #pointer {
  cursor: grabbing;
  background: var(--hot);
  border-color: var(--hot);
  box-shadow: 0 0 0 4px rgb(255 90 31 / 0.22);
}

#complexity-readout {
  position: absolute;
  top: 23px;
  transform: translateX(-50%);
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
  color: var(--ink-3);
  pointer-events: none;
}

#complexity-bar.is-dragging #complexity-readout {
  color: var(--ink-2);
}

#complexity-readout .readout-pct {
  color: var(--ink-2);
}

#complexity-bar.is-dragging #complexity-readout .readout-pct {
  color: var(--hot);
}

/* Element 3 — Spaceship Radial Vector Ring & Curved SVG Arc Fan */
#future-hud {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 15;
  touch-action: none;
}

.radial-hud-svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.spoke-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: -0.01em;
  pointer-events: none;
  paint-order: stroke;
  stroke: #000000;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.fan-pole-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink-3);
  pointer-events: none;
  paint-order: stroke;
  stroke: #000000;
  stroke-width: 3.5px;
  stroke-linejoin: round;
}

.fan-pole-label.is-hot {
  fill: var(--ink);
}

.fan-live-readout {
  font-family: var(--mono);
  font-size: 11px;
  pointer-events: none;
  paint-order: stroke;
  stroke: #000000;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chooser-sector {
  cursor: pointer;
}

.chooser-sector:hover path {
  stroke: var(--hot);
  fill: rgb(255 90 31 / 0.14);
}

.chooser-label {
  font-family: var(--mono);
  font-size: 9px;
  pointer-events: none;
}

.ring-center-plus {
  cursor: pointer;
}

.ring-center-plus:hover line {
  stroke: var(--hot);
}

/* Element 4 — Verdict bar (`[ accept ] [ flip ] [ new ]`, or `[ already knew ] [ continue ]` at 5/5) */
#verdict-bar {
  position: relative;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 10;
}

#tuned-whisper {
  font-size: 10px;
  line-height: 14px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.void-action {
  appearance: none;
  background: transparent;
  border: none;
  margin: 0;
  padding: 0 12px;
  min-height: 44px;
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 100ms ease;
}

.void-action .action-bracket {
  color: var(--ink-4);
  transition: color 100ms ease;
}

.void-action:hover,
.void-action:focus-visible {
  color: var(--ink);
  outline: none;
}

.void-action:hover .action-bracket,
.void-action:focus-visible .action-bracket {
  color: var(--hot);
}

.void-action:active {
  color: var(--hot);
}

.void-action:disabled {
  opacity: 0.38;
  cursor: default;
}

/* Hairline 18px bottom tray */
#tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  padding: 0 14px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 18px;
  color: var(--ink-3);
  z-index: 30;
}

#tray-right {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

#tray-status {
  color: var(--hot);
  font-size: 10px;
  letter-spacing: 0.01em;
}

.tray-btn {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0 2px;
  margin: 0;
  height: 18px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 18px;
  color: var(--ink-3);
  cursor: pointer;
}

.tray-btn:hover,
.tray-btn:focus-visible {
  color: var(--ink);
  outline: none;
}

.tray-btn.is-hot {
  color: var(--hot);
}

.tray-sep {
  color: var(--ink-5);
}

/* Below 1080px: horizontal top HUD band above #column so it NEVER overlaps #rail or #belief-text */
@media (max-width: 1079px) {
  #void-stage {
    padding-top: clamp(18px, 3vh, 28px);
  }

  #score-hud {
    position: relative;
    top: auto;
    left: auto;
    width: clamp(28ch, calc(100vw - 260px), 58ch);
    max-width: calc(100vw - 44px);
    margin: 0 auto clamp(18px, 3vh, 26px);
    padding-bottom: 10px;
    border-bottom: 1px dotted var(--ink-5);
  }

  #void-stage.is-cuibono #score-hud {
    width: clamp(30ch, calc(100vw - 230px), 66ch);
    max-width: calc(100vw - 44px);
    margin-bottom: 14px;
  }

  .hud-brand-row {
    margin-bottom: 6px;
  }

  .hud-main-row {
    width: 100%;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
  }

  #hud-streak-value {
    font-size: 26px;
  }

  #hud-streak-bars {
    margin-top: 6px;
  }

  #hud-guesses-row {
    margin-top: 0;
  }

  #hud-whisper {
    margin-top: 6px;
  }
}

/* Responsive mobile rules (390x844 zero horizontal overflow) */
@media (max-width: 639px) {
  :root {
    --font-sz: 12px;
    --line-h: 20px;
  }

  #void-stage {
    padding-top: clamp(16px, 2.6vh, 24px);
    padding-bottom: 40px;
  }

  #score-hud,
  #void-stage.is-cuibono #score-hud,
  #column,
  #void-stage.is-cuibono #column {
    width: min(calc(100vw - 44px), 46ch);
  }

  .action-row {
    gap: 16px;
  }

  .void-action {
    min-width: 78px;
    padding: 0 10px;
  }
}

@media (max-width: 559px) {
  #rail {
    display: none;
  }

  .spoke-label {
    font-size: 9.5px;
  }
}
