/* =========================================================
   BEDROCK — a descent in nine strata
   Built on Editorial Signal (Dark Horse Works DS).
   The darkening IS the meaning: the stage theme is driven
   by --stage-* custom props set in JS from each layer's depth.
   ========================================================= */

:root {
  /* live stage theme — JS interpolates these from layer depth */
  --stage-bg:    #F2F0EB;
  --stage-fg:    #0A0A0A;
  --stage-fg2:   #6B6862;
  --stage-rule:  #0A0A0A;
  --stage-soft:  #C8C4BB;
  --stage-card:  color-mix(in srgb, var(--stage-fg) 3.5%, transparent);
  --stage-signal:#D64A1F;
  --stage-shift: 1; /* 0 at surface, 1 at bedrock — used for subtle effects */
  --tex: 0.5; /* texture opacity helper */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--stage-bg);
  color: var(--stage-fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background var(--dur-slow) var(--ease), color var(--dur-slow) var(--ease);
  overflow: hidden;
}

#root { height: 100vh; height: 100dvh; }

/* Soft "depth" grain — a barely-there fixed dot texture that the DS tolerates
   as tactile paper, deepens slightly with descent. No gradients. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--stage-fg) 0.6px, transparent 0.6px);
  background-size: 22px 22px;
  opacity: calc(0.025 + 0.02 * var(--stage-shift));
  transition: opacity var(--dur-slow) var(--ease);
}

::selection { background: var(--stage-signal); color: var(--stage-bg); }

/* ----------------------------------------------------------
   STAGE LAYOUT
   ---------------------------------------------------------- */
.stage {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: clamp(82px, 9vw, 132px) 1fr;
}

/* top masthead rule — the DS signature, recolored to stage fg */
.masthead-rule {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--stage-fg); z-index: 40;
  transition: background var(--dur-slow) var(--ease);
}

/* ----------------------------------------------------------
   STRATA RAIL — the cartographic gauge (left)
   ---------------------------------------------------------- */
.rail {
  position: relative;
  border-right: 1px solid var(--stage-soft);
  display: flex; flex-direction: column;
  padding: 26px 0 18px;
  transition: border-color var(--dur-slow) var(--ease);
  user-select: none;
}
.rail-head {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--stage-fg2);
  writing-mode: vertical-rl; transform: rotate(180deg);
  margin: 0 auto 18px; white-space: nowrap;
}
.rail-strata { flex: 1; display: flex; flex-direction: column; }
.rail-stratum {
  position: relative; flex: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 0 clamp(12px, 1.6vw, 22px);
  background: none; border: 0; cursor: pointer; text-align: left;
  color: var(--stage-fg2);
  border-top: 1px solid var(--stage-soft);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur-slow) var(--ease);
}
.rail-stratum:last-child { border-bottom: 1px solid var(--stage-soft); }
.rail-stratum:hover { background: var(--stage-card); color: var(--stage-fg); }
.rail-stratum.is-active { color: var(--stage-fg); }
.rail-stratum.is-active::before {
  content: ""; position: absolute; left: -1px; top: 0; bottom: 0;
  width: 3px; background: var(--stage-signal);
}
.rail-num {
  font-family: var(--font-mono); font-size: clamp(11px, 1vw, 13px);
  font-weight: 500; min-width: 1.6em;
}
.rail-tick {
  width: clamp(8px, 1vw, 14px); height: 1px; background: currentColor; opacity: 0.5;
}
.rail-name {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateX(-4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.rail:hover .rail-name, .rail-stratum.is-active .rail-name { opacity: 1; transform: none; }
.rail-foot {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--stage-fg2);
  writing-mode: vertical-rl; transform: rotate(180deg);
  margin: 18px auto 0; white-space: nowrap; opacity: 0.7;
}

/* ----------------------------------------------------------
   STRATUM (a layer screen)
   ---------------------------------------------------------- */
.field {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.field-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--stage-soft) transparent;
}
.field-scroll::-webkit-scrollbar { width: 8px; }
.field-scroll::-webkit-scrollbar-thumb { background: var(--stage-soft); }

.stratum {
  min-height: 100%;
  padding: clamp(40px, 6vh, 80px) clamp(28px, 6vw, 120px) clamp(120px, 16vh, 180px);
  max-width: 1180px;
}

/* per-stratum header */
.stratum-coord {
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--stage-fg2);
  margin-bottom: clamp(20px, 4vh, 44px);
}
.stratum-coord .sig { color: var(--stage-signal); }
.stratum-coord b { color: var(--stage-fg); font-weight: 500; }

.stratum-q {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: clamp(22px, 3.4vw, 38px); line-height: 1.12; letter-spacing: 0;
  color: var(--stage-fg2); max-width: 22ch; margin: 0 0 clamp(10px, 1.6vh, 18px);
}
.stratum-title {
  font-family: var(--font-sans); font-weight: 900;
  font-size: clamp(40px, 7vw, 92px); line-height: 0.96; letter-spacing: -0.035em;
  margin: 0 0 clamp(22px, 4vh, 48px); text-wrap: balance;
}
.stratum-lede {
  font-size: clamp(17px, 1.5vw, 21px); line-height: 1.55; color: var(--stage-fg2);
  max-width: 58ch; text-wrap: pretty;
}
.stratum-lede strong { color: var(--stage-fg); font-weight: 700; }

/* generic prose block */
.prose { max-width: 62ch; }
.prose p { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.6; margin: 0 0 1.1em; text-wrap: pretty; }
.prose .ash { color: var(--stage-fg2); }
.prose strong { font-weight: 700; }

/* sentence-per-line stanza (Reference 2 rhythm) */
.stanza { margin: clamp(18px,3vh,30px) 0; }
.stanza .line { font-size: clamp(18px, 1.7vw, 26px); line-height: 1.5; color: var(--stage-fg2); margin: 0 0 6px; }
.stanza .line.turn { color: var(--stage-fg); font-weight: 700; }

/* eyebrow */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--stage-fg2); line-height: 1;
}
.eyebrow .sig { color: var(--stage-signal); }

/* pull-quote — left rule */
.pull {
  border-left: 3px solid var(--stage-fg); padding: 4px 0 4px 24px;
  margin: clamp(20px,3vh,34px) 0; max-width: 56ch;
}
.pull .q { font-family: var(--font-serif); font-style: italic; font-size: clamp(20px,2.2vw,30px); line-height: 1.35; }
.pull.sig { border-left-color: var(--stage-signal); }

/* divider rule */
.hr { border: 0; border-top: 1px solid var(--stage-soft); margin: clamp(28px,5vh,56px) 0; }
.hr-ink { border-top-color: var(--stage-fg); }

/* ----------------------------------------------------------
   REVEAL — content discovered, not read
   ---------------------------------------------------------- */
.reveal { position: relative; }
.reveal-stub {
  border: 1px solid var(--stage-soft); background: var(--stage-card);
  padding: clamp(18px,2.4vw,26px) clamp(20px,2.6vw,30px);
  display: flex; align-items: center; gap: 18px; cursor: pointer; width: 100%;
  text-align: left; color: var(--stage-fg);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.reveal-stub:hover { background: var(--stage-card); border-color: var(--stage-fg); }
.reveal-stub .mono {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stage-fg2);
}
.reveal-stub .stub-label { font-size: clamp(15px,1.3vw,18px); font-weight: 500; }
.reveal-stub .stub-mark {
  margin-left: auto; font-family: var(--font-mono); font-size: 13px;
  border: 1px solid var(--stage-soft); width: 30px; height: 30px;
  display: grid; place-items: center; flex: none;
}
.reveal-body {
  overflow: hidden;
  animation: reveal-in var(--dur-slow) var(--ease);
}
@keyframes reveal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* generic enter animation for beats */
.beat-in { animation: beat-rise var(--dur-slow) var(--ease); }
@keyframes beat-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal-body, .beat-in { animation: none; }
  * { transition-duration: 1ms !important; }
}

/* ----------------------------------------------------------
   GRID OF CARDS
   ---------------------------------------------------------- */
.cards { display: grid; gap: 1px; background: var(--stage-soft); border: 1px solid var(--stage-soft); margin: clamp(16px,2.5vh,28px) 0; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--stage-bg); padding: clamp(18px,2vw,26px);
  display: flex; flex-direction: column; gap: 8px;
}
.card .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stage-fg2); }
.card .t { font-size: clamp(15px,1.3vw,18px); font-weight: 600; line-height: 1.3; }
.card .d { font-size: clamp(13px,1.05vw,15px); line-height: 1.5; color: var(--stage-fg2); }

@media (max-width: 820px) {
  .cards.three { grid-template-columns: 1fr; }
  .cards.two { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   PROMPT CARDS (facilitator)
   ---------------------------------------------------------- */
.prompts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: clamp(16px,2.5vh,26px) 0; }
.prompt {
  border: 1px solid var(--stage-soft); background: var(--stage-card);
  padding: clamp(16px,1.8vw,22px); min-height: 130px;
  display: flex; flex-direction: column; gap: 10px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.prompt:hover { border-color: var(--stage-fg); }
.prompt .kind { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--stage-signal); }
.prompt .ask { font-family: var(--font-serif); font-style: italic; font-size: clamp(16px,1.5vw,21px); line-height: 1.3; }
.prompt .hint { margin-top: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stage-fg2); opacity: 0.7; }
@media (max-width: 820px) { .prompts { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------
   RANK LIST (drag to weigh)
   ---------------------------------------------------------- */
.rank { margin: clamp(16px,2.5vh,26px) 0; max-width: 760px; }
.rank-row {
  display: flex; align-items: stretch; gap: 0; border: 1px solid var(--stage-soft);
  background: var(--stage-bg); margin-bottom: -1px; cursor: grab;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.rank-row:hover { border-color: var(--stage-fg); position: relative; z-index: 2; }
.rank-row.dragging { opacity: 0.5; cursor: grabbing; }
.rank-row.over { border-color: var(--stage-signal); position: relative; z-index: 3; }
.rank-rank {
  flex: none; width: clamp(44px,5vw,62px); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: clamp(15px,1.5vw,20px); font-weight: 500;
  border-right: 1px solid var(--stage-soft); color: var(--stage-fg2);
}
.rank-row:first-child .rank-rank { color: var(--stage-signal); }
.rank-main { padding: clamp(12px,1.4vw,18px); flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rank-main .t { font-size: clamp(15px,1.3vw,18px); font-weight: 600; line-height: 1.25; }
.rank-main .d { font-size: clamp(12px,1vw,14px); color: var(--stage-fg2); line-height: 1.45; }
.rank-grip { flex: none; width: 40px; display: grid; place-items: center; color: var(--stage-fg2); border-left: 1px solid var(--stage-soft); }
.rank-grip svg { width: 14px; height: 14px; }
.rank-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stage-fg2); margin-top: 12px; }

/* score chips variant */
.score-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--stage-soft); }
.score-row:last-child { border-bottom: 1px solid var(--stage-soft); }
.score-row .lbl { flex: 1; font-size: clamp(14px,1.2vw,17px); font-weight: 500; }
.score-dots { display: flex; gap: 6px; }
.score-dot { width: 16px; height: 16px; border: 1px solid var(--stage-fg2); cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.score-dot.on { background: var(--stage-signal); border-color: var(--stage-signal); }

/* ----------------------------------------------------------
   CAPTURE — the room's answer, persisted
   ---------------------------------------------------------- */
.capture { margin: clamp(20px,3vh,34px) 0 0; max-width: 720px; }
.capture-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stage-fg2); margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.capture-label .dot { width: 7px; height: 7px; background: var(--stage-signal); }
.capture textarea {
  width: 100%; background: var(--stage-card); border: 1px solid var(--stage-soft);
  border-radius: 0; color: var(--stage-fg); font-family: var(--font-serif); font-style: italic;
  font-size: clamp(17px,1.6vw,22px); line-height: 1.4; padding: 18px 20px; resize: vertical; min-height: 92px;
  transition: border-color var(--dur) var(--ease);
}
.capture textarea::placeholder { color: var(--stage-fg2); opacity: 0.6; font-style: italic; }
.capture textarea:focus { outline: none; border-color: var(--stage-fg); }
.capture .saved { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stage-signal); margin-top: 8px; height: 12px; opacity: 0; transition: opacity var(--dur) var(--ease); }
.capture .saved.show { opacity: 1; }

/* ----------------------------------------------------------
   NAV CONTROLS (outside scroll, always usable)
   ---------------------------------------------------------- */
.nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(28px,6vw,120px); 
  border-top: 1px solid var(--stage-soft);
  background: var(--stage-bg);
  transition: background var(--dur-slow) var(--ease), border-color var(--dur-slow) var(--ease);
}
.nav-progress { flex: 1; height: 2px; background: var(--stage-soft); position: relative; }
.nav-progress .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--stage-signal); transition: width var(--dur) var(--ease); }
.nav-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stage-fg2); white-space: nowrap; }
.nav-btn {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  background: none; border: 1px solid var(--stage-fg); color: var(--stage-fg);
  padding: 11px 18px; cursor: pointer; border-radius: 0; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 9px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav-btn:hover { background: var(--stage-fg); color: var(--stage-bg); }
.nav-btn:active { transform: translateY(1px); }
.nav-btn.primary { background: var(--stage-fg); color: var(--stage-bg); }
.nav-btn.primary:hover { background: var(--stage-signal); border-color: var(--stage-signal); color: #fff; }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.nav-btn.ghost { border-color: var(--stage-soft); color: var(--stage-fg2); }
.nav-btn.ghost:hover { border-color: var(--stage-fg); background: transparent; color: var(--stage-fg); }

/* ----------------------------------------------------------
   TRANSITIONS between layers
   (base state is VISIBLE; animation only plays the fade-in,
    never holds a hidden state — safe for capture/print)
   ---------------------------------------------------------- */
.field-anim { animation: field-enter var(--dur-slow) var(--ease); }
@keyframes field-enter { from { opacity: 0; } to { opacity: 1; } }

/* ----------------------------------------------------------
   ENTRANCE / COVER
   ---------------------------------------------------------- */
.cover {
  position: fixed; inset: 0; z-index: 60; background: var(--paper); color: var(--ink);
  display: flex; flex-direction: column; padding: clamp(28px,5vw,72px);
}
.cover-top { display: flex; justify-content: space-between; align-items: flex-start; }
.cover-wordmark { height: 18px; }
.cover-wordmark svg, .cover-wordmark img { height: 100%; }
.cover-stamp {
  border: 1px solid var(--ink); padding: 12px 16px; max-width: 240px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; line-height: 1.5; color: var(--ash);
}
.cover-stamp b { color: var(--ink); }
.cover-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 1100px; }
.cover-eyebrow { font-family: var(--font-mono); font-size: clamp(11px,1vw,13px); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ash); margin-bottom: clamp(18px,3vh,30px); }
.cover-eyebrow .sig { color: var(--signal); }
.cover-title { font-weight: 900; font-size: clamp(72px,16vw,220px); line-height: 0.86; letter-spacing: -0.04em; margin: 0; }
.cover-sub { font-family: var(--font-serif); font-style: italic; font-size: clamp(20px,2.6vw,36px); line-height: 1.2; color: var(--ash); margin: clamp(20px,3vh,32px) 0 0; max-width: 24ch; }
.cover-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cover-desc { max-width: 52ch; font-size: clamp(15px,1.3vw,18px); line-height: 1.55; color: var(--ash); }
.cover-desc b { color: var(--ink); font-weight: 700; }
.cover-enter {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); padding: 18px 30px; cursor: pointer; border-radius: 0;
  display: inline-flex; align-items: center; gap: 14px; transition: background var(--dur-fast) var(--ease);
}
.cover-enter:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.cover-enter:active { transform: translateY(1px); }
.cover.exit { animation: cover-out var(--dur-slow) var(--ease) forwards; }
@keyframes cover-out { to { opacity: 0; transform: translateY(-12px); pointer-events: none; } }

/* fine column lines on cover, cartographic */
.cover-grid { position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image: repeating-linear-gradient(90deg, transparent, transparent calc(20% - 1px), var(--fog) calc(20% - 1px), var(--fog) 20%);
  opacity: 0.25; }

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 720px) {
  .stage { grid-template-columns: 54px 1fr; }
  .rail-head, .rail-foot { display: none; }
  .stratum { padding: 32px 22px 140px; }
  .nav { gap: 12px; padding: 12px 22px; }
  .nav-meta.hide-sm { display: none; }
}

/* ----------------------------------------------------------
   MICRO BUTTONS (rank up/down)
   ---------------------------------------------------------- */
.micro-btn {
  font-size: 9px; line-height: 1; width: 22px; height: 16px;
  background: none; border: 1px solid var(--stage-soft); color: var(--stage-fg2);
  cursor: pointer; border-radius: 0; padding: 0; display: grid; place-items: center;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.micro-btn:hover { border-color: var(--stage-fg); color: var(--stage-fg); }

/* ----------------------------------------------------------
   SENSORY LOOP — feel through the machine
   ---------------------------------------------------------- */
.loop {
  border: 1px solid var(--stage-fg); background: var(--stage-card);
  padding: clamp(22px,3vw,38px); margin: clamp(18px,3vh,30px) 0; max-width: 860px;
}
.loop-track { display: flex; align-items: center; margin-bottom: clamp(22px,3vh,34px); }
.loop-node { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: none; }
.loop-dot {
  width: 16px; height: 16px; border: 1.5px solid var(--stage-fg2); border-radius: 50%;
  background: var(--stage-bg); transition: all var(--dur-fast) var(--ease);
}
.loop-node.end .loop-dot { border-radius: 0; }
.loop-node.on .loop-dot { background: var(--stage-signal); border-color: var(--stage-signal); box-shadow: 0 0 0 5px color-mix(in srgb, var(--stage-signal) 22%, transparent); }
.loop-name { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--stage-fg2); white-space: nowrap; }
.loop-node.on .loop-name { color: var(--stage-fg); }
.loop-link { flex: 1; height: 1.5px; background: var(--stage-soft); margin: 0 4px; margin-bottom: 22px; transition: background var(--dur-fast) var(--ease); min-width: 14px; }
.loop-link.lit { background: var(--stage-signal); }

.loop-controls { display: flex; gap: clamp(20px,3vw,40px); flex-wrap: wrap; align-items: flex-start; }
.loop-fire {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--stage-fg); color: var(--stage-bg); border: 1px solid var(--stage-fg);
  padding: 14px 20px; cursor: pointer; border-radius: 0; display: inline-flex; align-items: center; gap: 12px; flex: none;
  transition: background var(--dur-fast) var(--ease);
}
.loop-fire:hover { background: var(--stage-signal); border-color: var(--stage-signal); color: #fff; }
.loop-fire:active { transform: translateY(1px); }
.loop-press { font-size: 18px; }
.loop-lat { flex: 1; min-width: 240px; }
.loop-lat label { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stage-fg2); margin-bottom: 8px; }
.loop-lat label b { color: var(--stage-fg); font-weight: 500; }
.loop-lat input[type=range] { width: 100%; accent-color: var(--stage-signal); }
.loop-thresh { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--stage-fg2); margin-top: 8px; line-height: 1.4; }
.loop-thresh.ok { color: var(--stage-signal); }

.loop-feel { display: flex; align-items: center; gap: 14px; margin-top: clamp(20px,3vh,30px); padding-top: clamp(16px,2.5vh,24px); border-top: 1px solid var(--stage-soft); min-height: 40px; }
.loop-feel-mark { width: 12px; height: 12px; background: var(--stage-soft); border-radius: 50%; transition: all var(--dur) var(--ease); flex: none; }
.loop-feel.felt .loop-feel-mark { background: var(--stage-signal); box-shadow: 0 0 0 6px color-mix(in srgb, var(--stage-signal) 20%, transparent); }
.loop-feel-text { font-family: var(--font-serif); font-style: italic; font-size: clamp(18px,2vw,26px); color: var(--stage-fg2); transition: color var(--dur) var(--ease); }
.loop-feel.felt .loop-feel-text { color: var(--stage-fg); }

/* ----------------------------------------------------------
   THE STONE — the climax
   ---------------------------------------------------------- */
.stone-scene {
  position: relative; margin: clamp(20px,4vh,44px) 0; padding: clamp(40px,8vh,90px) 0 clamp(24px,4vh,40px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(28px,5vh,52px);
  min-height: 46vh; overflow: hidden;
}
.stone-city {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  opacity: 0; transition: opacity 1.2s var(--ease); pointer-events: none;
}
.stone-scene.lit .stone-city { opacity: 0.5; }
.stone-buildEl {
  width: clamp(8px,1.4vw,18px); background: var(--stage-fg2); flex: none;
  transform: scaleY(0); transform-origin: bottom;
}
.stone-scene.lit .stone-buildEl { animation: build-up 0.7s var(--ease) both; }
@keyframes build-up { to { transform: scaleY(1); } }

.stone-core {
  position: relative; z-index: 2; width: clamp(120px,16vw,200px); height: clamp(120px,16vw,200px);
  background: none; border: 0; cursor: pointer; display: grid; place-items: center;
}
.stone-glow {
  position: absolute; inset: -40%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--stage-signal) 50%, transparent) 0%, transparent 62%);
  opacity: 0; transition: opacity 1s var(--ease);
}
.stone-scene.lit .stone-glow { opacity: 1; animation: glow-pulse 3.4s var(--ease) infinite; }
@keyframes glow-pulse { 0%,100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.08); opacity: 1; } }
.stone-rock {
  position: relative; z-index: 3; width: clamp(40px,5vw,64px); height: clamp(34px,4.4vw,56px);
  background: var(--stage-fg2);
  clip-path: polygon(20% 8%, 62% 4%, 92% 34%, 84% 78%, 50% 96%, 14% 74%, 4% 38%);
  transition: background 1s var(--ease);
}
.stone-scene.lit .stone-rock { background: var(--stage-signal); }
.stone-caption { position: relative; z-index: 4; text-align: center; }
.stone-caption p { margin: 0; font-size: clamp(18px,2.2vw,30px); line-height: 1.3; color: var(--stage-fg); }
.stone-caption .mono { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--stage-fg2); }

/* ----------------------------------------------------------
   CHAIN (reference-frame integrated graph)
   ---------------------------------------------------------- */
.chain { display: flex; flex-direction: column; align-items: flex-start; gap: 0; max-width: 560px; }
.chain-node {
  display: flex; align-items: center; gap: 16px; border: 1px solid var(--stage-soft);
  background: var(--stage-bg); padding: 13px 20px; width: 100%;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.chain-node:hover { border-color: var(--stage-fg); }
.chain-node.first { border-color: var(--stage-fg); }
.chain-node.last { border-color: var(--stage-signal); }
.chain-node.last .chain-t { color: var(--stage-signal); }
.chain-i { font-family: var(--font-mono); font-size: 12px; color: var(--stage-fg2); min-width: 2em; }
.chain-t { font-size: clamp(16px,1.5vw,21px); font-weight: 600; letter-spacing: -0.01em; }
.chain-link { font-family: var(--font-mono); color: var(--stage-fg2); margin: 3px 0 3px 30px; font-size: 14px; opacity: 0.6; }

/* ----------------------------------------------------------
   VERDICT (crux scoring)
   ---------------------------------------------------------- */
.verdict { border-top: 1px solid var(--stage-soft); max-width: 760px; }
.verdict-row {
  position: relative; display: flex; align-items: center; gap: 18px;
  padding: 15px 18px; border-bottom: 1px solid var(--stage-soft); overflow: hidden;
}
.verdict-bar { position: absolute; inset: 0; pointer-events: none; }
.verdict-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--stage-card); display: block; }
.verdict-row.win .verdict-bar span { background: color-mix(in srgb, var(--stage-signal) 14%, transparent); }
.verdict-t { position: relative; flex: 1; font-size: clamp(15px,1.4vw,20px); font-weight: 600; }
.verdict-row.win .verdict-t { color: var(--stage-signal); }
.verdict-s { position: relative; font-family: var(--font-mono); font-size: clamp(13px,1.2vw,16px); color: var(--stage-fg2); }
.verdict-row.win .verdict-s { color: var(--stage-signal); font-weight: 500; }

/* ----------------------------------------------------------
   ONE-WORD PITCH
   ---------------------------------------------------------- */
.oneword {
  font-weight: 900; font-size: clamp(52px,11vw,150px); line-height: 0.9;
  letter-spacing: -0.04em; margin: clamp(10px,2vh,18px) 0 clamp(16px,2.5vh,24px);
  color: var(--stage-signal); text-wrap: nowrap;
}

/* ----------------------------------------------------------
   FIELD NOTEBOOK REVIEW
   ---------------------------------------------------------- */
.notebook { border-top: 1px solid var(--stage-soft); max-width: 820px; }
.nb-row { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--stage-soft); }
.nb-k { display: flex; flex-direction: column; gap: 6px; }
.nb-k .mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stage-fg); }
.nb-q { font-size: 12px; color: var(--stage-fg2); line-height: 1.4; }
.nb-v { font-size: clamp(18px,1.8vw,24px); line-height: 1.4; color: var(--stage-fg); }
@media (max-width: 720px) { .nb-row { grid-template-columns: 1fr; gap: 8px; } }

/* ----------------------------------------------------------
   COVER — void variant (begin in the dark)
   ---------------------------------------------------------- */
.cover--void { background: #0A0A0A; color: #F2F0EB; }
.cover--void .cover-eyebrow { color: #8F8C85; }
.cover--void .cover-stamp { border-color: #3A3A38; color: #8F8C85; }
.cover--void .cover-stamp b { color: #F2F0EB; }
.cover--void .cover-sub, .cover--void .cover-desc { color: #8F8C85; }
.cover--void .cover-desc b { color: #F2F0EB; }
.cover--void .cover-enter { background: #F2F0EB; color: #0A0A0A; border-color: #F2F0EB; }
.cover--void .cover-enter:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.cover--void .cover-grid { opacity: 0.1; }
.cover--void .cover-wordmark .mono { color: #8F8C85 !important; }

/* ----------------------------------------------------------
   STONE TREATMENTS (tweakable climax)
   ---------------------------------------------------------- */
:root[data-stone="bare"] .stone-city,
:root[data-stone="bare"] .stone-glow { display: none; }
:root[data-stone="bare"] .stone-scene { min-height: 34vh; }

:root[data-stone="ember"] .stone-glow { inset: -65%; }
:root[data-stone="ember"] .stone-scene.lit .stone-glow { animation-duration: 4.6s; }
:root[data-stone="ember"] .stone-scene.lit .stone-city { opacity: 0.28; }
:root[data-stone="ember"] .stone-rock { width: clamp(46px,5.6vw,72px); }

/* ----------------------------------------------------------
   CARTOGRAPHIC MODE — surveyed grid behind the field
   ---------------------------------------------------------- */
:root[data-carto="1"] .field-scroll {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 47px, var(--stage-soft) 47px, var(--stage-soft) 48px);
  background-attachment: local;
}
:root[data-carto="1"] .stratum-coord { letter-spacing: 0.18em; }
:root[data-carto="1"] .rail { border-right-width: 1px; }

/* ----------------------------------------------------------
   TWEAK PANEL HINT
   ---------------------------------------------------------- */
.tweak-hint {
  font-size: 11px; line-height: 1.5; color: var(--ash, #6B6862);
  margin: 8px 0 4px; opacity: 0.85; font-family: var(--font-sans);
}

/* utility */
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); font-style: italic; }
.sig { color: var(--stage-signal); }
.ash { color: var(--stage-fg2); }
.nowrap { white-space: nowrap; }
.spacer-s { height: 16px; } .spacer-m { height: 32px; } .spacer-l { height: 64px; }
