/* ═══════════════════════════════════════════════════════════════════════
   Gestu — COMPONENTS
   Forged-metal primitives: inlaid hairline borders, drawn halos, bevels,
   magnetic buttons, chips, tabs, readouts, seals.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── THE INLAY PRIMITIVE ────────────────────────────────────────────────
   A dual-tone hairline (gold→frost) drawn inside a card edge, with an
   obsidian inner face. Implemented with a mask so the border is genuinely
   hairline at any radius.                                                */
.inlaid { position: relative; }
.inlaid::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--inlay);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── BRAND MARK — 12-tick carved rim of Gestu Well ───────────────────── */
.brandmark { display: inline-grid; place-items: center; flex: none; }
.brandmark .rim { width: 34px; height: 34px; overflow: visible; }
.brandmark--lg .rim { width: 56px; height: 56px; }

.rim__ticks line { stroke: var(--gold-a40); stroke-width: 1; stroke-linecap: round; }
.rim__ticks--12 line:nth-child(3n + 1) { stroke: var(--frost-a32); }
.rim__ring {
  fill: none;
  stroke: var(--gold-a24);
  stroke-width: 1.1;
}
.rim__head {
  fill: var(--gold);
  filter: drop-shadow(0 0 6px var(--gold-a40));
}
.rim__reflect {
  fill: none;
  stroke: var(--frost);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.85;
  filter: drop-shadow(0 0 5px var(--frost-a32));
}

/* ── NAVBAR — THE WELL RIM ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  padding: clamp(0.6rem, 1.6vw, 1.05rem) var(--gutter);
  pointer-events: none;
}
.nav__pill {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.15vw, 1.05rem);
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0.5rem 0.5rem 0.5rem 0.95rem;
  border-radius: var(--r-pill);
  /* Near-opaque obsidian: the island reads as carved metal, and no page
     content bleeds through the backdrop-filter compositor. */
  background: linear-gradient(168deg,
    color-mix(in srgb, #1B2233 92%, var(--obsidian)) 0%,
    var(--obsidian) 44%,
    #070A0F 100%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: var(--bevel),
              0 20px 50px -28px color-mix(in srgb, #000 95%, transparent),
              0 0 0 1px color-mix(in srgb, #000 40%, transparent);
  transition: box-shadow var(--dur-mid) var(--ease-forge);
}
.nav__pill::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--inlay-soft);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.nav.is-docked .nav__pill {
  background: linear-gradient(168deg, #0E131E 0%, var(--obsidian-void) 100%);
  box-shadow: var(--bevel),
              0 26px 60px -30px color-mix(in srgb, #000 100%, transparent),
              0 0 0 1px color-mix(in srgb, var(--gold) 7%, transparent);
}

.nav__brand { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.nav__wordmark {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav__brand:hover .rim__head { fill: var(--gold-bright); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
}
.nav__links a {
  position: relative;
  padding: 0.42rem 0.66rem;
  border-radius: var(--r-pill);
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0.16rem;
  width: 0; height: 1px;
  translate: -50% 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transition: width var(--dur-mid) var(--ease-forge);
}
.nav__links a:hover { color: var(--ink); background: color-mix(in srgb, #fff 4%, transparent); }
.nav__links a:hover::after { width: 62%; }

.nav__status {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: var(--shell);
  margin: 0 auto 0.45rem;
  padding-inline: 0.25rem;
}
.nav__actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }

/* ── STATUS CHIPS ───────────────────────────────────────────────────── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.62rem 0.3rem 0.5rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  border: 1px solid var(--hairline);
  font-size: var(--t-micro);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-chip__k { color: var(--ink-3); }
.status-chip__v { font-weight: 600; letter-spacing: 0.02em; }
.status-chip[data-tone="frost"] .status-chip__v { color: var(--frost); }
.status-chip[data-tone="sage"]  .status-chip__v { color: var(--sage); }
.status-chip[data-tone="gold"]  .status-chip__v { color: var(--gold); }

.status-chip__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-a16);
  animation: chipPulse 2.6s ease-in-out infinite;
}
.status-chip[data-tone="frost"] .status-chip__dot {
  background: var(--frost);
  box-shadow: 0 0 0 3px var(--frost-a16), 0 0 10px var(--frost-a32);
}
.status-chip[data-tone="gold"] .status-chip__dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-a14), 0 0 10px var(--gold-a24);
}
@keyframes chipPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.42; }
}

.pulse-dot {
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 0.42rem;
  border-radius: 50%;
  background: var(--frost);
  box-shadow: 0 0 8px var(--frost);
  animation: chipPulse 2s ease-in-out infinite;
  vertical-align: middle;
}

/* ── BURGER + DRAWER ────────────────────────────────────────────────── */
.nav__burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  place-items: center;
  gap: 4px;
  flex-direction: column;
}
.nav__burger span {
  display: block;
  width: 15px; height: 1.5px;
  background: var(--ink-2);
  border-radius: 2px;
  transition: transform var(--dur-mid) var(--ease-forge);
}
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(2.75px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child  { transform: translateY(-2.75px) rotate(-45deg); }

.nav__drawer {
  pointer-events: auto;
  display: grid;
  gap: 0.15rem;
  max-width: var(--shell);
  margin: 0.55rem auto 0;
  padding: 0.9rem;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--obsidian) 96%, transparent);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border: 1px solid var(--hairline);
}
.nav__drawer[hidden] { display: none; }
.nav__drawer > a {
  padding: 0.75rem 0.9rem;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  color: var(--ink-2);
}
.nav__drawer > a:hover { background: color-mix(in srgb, #fff 4%, transparent); color: var(--ink); }
.nav__drawer .btn { margin-top: 0.5rem; }

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS — weighted, deliberate, forged
   ═══════════════════════════════════════════════════════════════════════ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.78rem 1.4rem;
  border-radius: var(--r-pill);
  font-size: var(--t-small);
  font-weight: 650;
  letter-spacing: 0.012em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease-forge),
              box-shadow var(--dur-mid) var(--ease-forge),
              background var(--dur-mid), color var(--dur-mid), border-color var(--dur-mid);
}
.btn .ico { width: 17px; height: 17px; flex: none; }
.btn .ico path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn .ico path[d^="M6 4.5l9"] { fill: currentColor; stroke: none; }
.btn .ico path[d^="M4 10h11"] { fill: none; }

.btn--sm { padding: 0.55rem 1rem; font-size: var(--t-micro); letter-spacing: 0.05em; }
.btn--lg { padding: 1.02rem 1.85rem; font-size: 0.95rem; }
.btn--block { width: 100%; }

/* Gold — focal action */
.btn--gold {
  background: linear-gradient(172deg, var(--gold-bright) 0%, var(--gold) 42%, var(--gold-deep) 100%);
  color: var(--gold-ink);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent),
    inset 0 -2px 6px color-mix(in srgb, #6b4f16 45%, transparent),
    0 14px 34px -14px color-mix(in srgb, var(--gold) 60%, transparent);
}
.btn--gold:hover {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 65%, transparent),
    inset 0 -2px 6px color-mix(in srgb, #6b4f16 45%, transparent),
    0 20px 46px -14px color-mix(in srgb, var(--gold) 78%, transparent);
}
.btn--gold .btn__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 34%, color-mix(in srgb, #fff 46%, transparent) 50%, transparent 66%);
  translate: -120% 0;
  z-index: -1;
}
.btn--gold:hover .btn__sheen { animation: sheen 900ms var(--ease-deep); }
@keyframes sheen { to { translate: 120% 0; } }

/* Outline — secondary, frost-edged */
.btn--outline {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid var(--hairline);
}
.btn--outline::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--inlay-soft);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.btn--outline:hover {
  color: var(--gold-bright);
  background: color-mix(in srgb, var(--surface-2) 100%, transparent);
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--gold) 45%, transparent);
}

/* Ghost */
.btn--ghost {
  color: var(--ink-2);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--surface-1) 60%, transparent);
}
.btn--ghost:hover { color: var(--frost); border-color: var(--frost-a16); background: var(--frost-a08); }

/* Bare — text-with-hint */
.btn--bare {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.7rem 1rem;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-weight: 600;
}
.btn--bare:hover { color: var(--frost); background: var(--frost-a08); }
.btn__hint {
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-4);
}
.btn--bare:hover .btn__hint { color: var(--frost-deep); }

/* ── BADGE / SEAL ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.42rem 1rem 0.42rem 0.5rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface-1) 78%, transparent);
  border: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: var(--t-micro);
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  color: var(--ink-2);
}
.badge__seal {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gold-a08);
  border: 1px solid var(--gold-a24);
  color: var(--gold);
  font-size: 0.78rem;
  line-height: 1;
}

/* ── TABS — workflow selector ───────────────────────────────────────── */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.42rem;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface-1) 80%, transparent);
  border: 1px solid var(--hairline);
}
.tabs__ink {
  position: absolute;
  top: 0.42rem;
  left: 0.42rem;
  height: calc(100% - 0.84rem);
  width: calc((100% - 0.84rem - 0.8rem) / 3);
  border-radius: calc(var(--r-lg) - 0.3rem);
  background: linear-gradient(160deg, var(--gold-a14), color-mix(in srgb, var(--surface-2) 90%, transparent));
  border: 1px solid var(--gold-a24);
  box-shadow: 0 12px 26px -18px color-mix(in srgb, var(--gold) 60%, transparent);
  transition: transform var(--dur-mid) var(--ease-forge);
  pointer-events: none;
}
.tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.9rem;
  border-radius: calc(var(--r-lg) - 0.3rem);
  text-align: left;
  transition: color var(--dur-mid);
  color: var(--ink-3);
}
.tab__no {
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  color: var(--ink-4);
  transition: color var(--dur-mid);
}
.tab__body { display: grid; gap: 0.08rem; min-width: 0; }
.tab__body b { font-size: 0.88rem; font-weight: 650; letter-spacing: -0.005em; }
.tab__body i {
  font-style: normal;
  font-size: var(--t-micro);
  letter-spacing: 0.02em;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab.is-active { color: var(--gold-bright); }
.tab.is-active .tab__no { color: var(--gold); }
.tab.is-active .tab__body i { color: var(--ink-3); }
.tab:hover:not(.is-active) { color: var(--ink); }
.tab:hover:not(.is-active) .tab__body i { color: var(--ink-3); }

/* ── SEGMENTED CONTROL ──────────────────────────────────────────────── */
.seg {
  display: inline-flex;
  padding: 0.24rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--obsidian-void) 60%, transparent);
  border: 1px solid var(--hairline);
  gap: 0.15rem;
}
.seg__btn {
  padding: 0.42rem 0.95rem;
  border-radius: var(--r-pill);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  transition: all var(--dur-mid) var(--ease-forge);
}
.seg__btn.is-active {
  background: var(--frost-a08);
  color: var(--frost);
  box-shadow: inset 0 0 0 1px var(--frost-a16);
}
.seg__btn:hover:not(.is-active) { color: var(--ink-2); }

/* ── READOUT (telemetry rows) ───────────────────────────────────────── */
.readout {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border-top: 1px solid var(--hairline);
  margin: 0;
}
.readout__row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.42fr) 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 1.1rem;
  background: color-mix(in srgb, var(--surface-1) 92%, transparent);
}
.readout dt {
  font-size: var(--t-micro);
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  color: var(--ink-4);
}
.readout dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
}
.readout dd b {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.readout__row[data-tone="gold"]  dd b { color: var(--gold); }
.readout__row[data-tone="frost"] dd b { color: var(--frost); }
.readout__row[data-tone="sage"]  dd b { color: var(--sage); }
.readout__note { font-size: var(--t-micro); color: var(--ink-4); letter-spacing: 0.01em; }

/* ── BULLET LIST ────────────────────────────────────────────────────── */
.bullets { display: grid; gap: 0.7rem; margin-top: 1.5rem; }
.bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 7px; height: 7px;
  rotate: 45deg;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 0 8px var(--gold-a40);
}
.bullets b { color: var(--ink); font-weight: 650; }

/* ── RIG CHROME (artifact window bars) ──────────────────────────────── */
.rig__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 1.1rem;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--obsidian-void) 55%, transparent);
}
.rig__id {
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rig__lamp { display: inline-flex; gap: 5px; flex: none; }
.rig__lamp i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--hairline);
}
.rig__lamp i:nth-child(1) { background: color-mix(in srgb, var(--trap) 70%, transparent); }
.rig__lamp i:nth-child(2) { background: color-mix(in srgb, var(--gold) 55%, transparent); }
.rig__lamp i:nth-child(3) { background: color-mix(in srgb, var(--sage) 70%, transparent); }
.rig__clock {
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  color: var(--frost);
}

/* ── FEED (heartbeat triage) ────────────────────────────────────────── */
.feed {
  display: grid;
  gap: 1px;
  background: var(--hairline);
}
.feed__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: start;
  padding: 0.95rem 1.1rem;
  background: color-mix(in srgb, var(--surface-1) 94%, transparent);
  transition: background var(--dur-mid);
}
.feed__item:hover { background: var(--surface-2); }
.feed__t {
  font-size: var(--t-micro);
  color: var(--ink-4);
  padding-top: 0.18rem;
  flex: none;
}
.feed__body { display: grid; gap: 0.2rem; min-width: 0; }
.feed__body b { font-size: 0.9rem; font-weight: 620; color: var(--ink); line-height: 1.4; }
.feed__body i { font-style: normal; font-size: var(--t-small); color: var(--ink-3); line-height: 1.5; }
.feed__tag {
  flex: none;
  align-self: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-xs);
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  border: 1px solid currentColor;
  opacity: 0.85;
}
.feed__tag[data-tone="sage"]  { color: var(--sage); }
.feed__tag[data-tone="gold"]  { color: var(--gold); }
.feed__tag[data-tone="frost"] { color: var(--frost); }

/* ── EQUALISER (briefing playback) ──────────────────────────────────── */
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; margin-left: 0.35rem; }
.eq i {
  width: 2.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--frost));
  height: 20%;
  transition: height 180ms var(--ease-forge);
}
.eq.is-live i { animation: eqBounce 900ms ease-in-out infinite; }
.eq.is-live i:nth-child(2) { animation-delay: 120ms; }
.eq.is-live i:nth-child(3) { animation-delay: 240ms; }
.eq.is-live i:nth-child(4) { animation-delay: 360ms; }
.eq.is-live i:nth-child(5) { animation-delay: 480ms; }
@keyframes eqBounce {
  0%, 100% { height: 18%; }
  50%      { height: 100%; }
}

/* ── PTY TERMINAL ───────────────────────────────────────────────────── */
.pty {
  position: relative;
  /* FIXED height, not min-height. The typewriter keeps appending output;
     with only a min-height and a mask instead of a scroll clip, the terminal
     grew continuously (253 → 519px and rising) and pushed the entire page
     down as it typed. The mask fades the edges; the box must not grow. */
  height: 15.5rem;
  padding: 1rem 1.15rem 2.4rem;
  background:
    radial-gradient(90% 60% at 12% 0%, color-mix(in srgb, var(--frost) 5%, transparent), transparent 70%),
    var(--obsidian-void);
  font-size: 0.79rem;
  line-height: 1.75;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 1.6rem, #000 calc(100% - 1.5rem), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 1.6rem, #000 calc(100% - 1.5rem), transparent 100%);
}
.pty__out { white-space: pre-wrap; word-break: break-word; }
.pty__out .l-cmd  { color: var(--ink); }
.pty__out .l-ps1  { color: var(--gold); }
.pty__out .l-path { color: var(--ink-3); }
.pty__out .l-ok   { color: var(--sage); }
.pty__out .l-info { color: var(--frost); }
.pty__out .l-dim  { color: var(--ink-4); }
.pty__out .l-warn { color: var(--gold); }
.pty__line { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.pty__ps1 { color: var(--gold); }
.pty__path { color: var(--ink-3); }
.pty__caret {
  display: inline-block;
  width: 0.5em; height: 1.05em;
  translate: 0 0.22em;
  background: var(--frost);
  box-shadow: 0 0 10px var(--frost-a32);
  animation: blink 1.05s steps(2) infinite;
}
.pty__hint {
  position: absolute;
  right: 1rem; bottom: 0.6rem;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  opacity: 0.6;
  transition: opacity var(--dur-mid);
}
.pty:hover .pty__hint { opacity: 1; color: var(--gold); }

/* ── SHUFFLER (document vault) ──────────────────────────────────────── */
.shuffler {
  position: relative;
  min-height: 15.5rem;
  padding: 1.4rem 1.15rem;
  background:
    radial-gradient(80% 60% at 85% 8%, color-mix(in srgb, var(--gold) 6%, transparent), transparent 70%),
    var(--obsidian-void);
  overflow: hidden;
  perspective: 1200px;
}
.shuffler__stack { position: relative; min-height: 12.4rem; }
.doc {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.05rem 1.15rem;
  border-radius: var(--r-md);
  background: linear-gradient(165deg, var(--surface-2), var(--surface-1) 70%, #0D121C);
  border: 1px solid var(--hairline);
  box-shadow: 0 22px 44px -30px #000, var(--bevel);
  opacity: 0;
  transform: translateY(14px) rotateX(-6deg) scale(0.97);
}
.doc.is-front {
  opacity: 1;
  transform: translateY(0) rotateX(0) scale(1);
  border-color: var(--gold-a24);
  box-shadow: 0 26px 60px -34px color-mix(in srgb, var(--gold) 40%, transparent), var(--bevel);
}
.doc.is-behind { opacity: 0.34; transform: translateY(-9px) scale(0.965); }
.doc.is-out { opacity: 0; transform: translateY(-26px) scale(0.94); }

.doc__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.doc__kind {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--gold-a24);
  border-radius: var(--r-xs);
}
.doc__sealed {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--sage);
}
.doc__sealed::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 8px var(--sage);
}
.doc__title {
  font-family: var(--f-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.doc__meta { display: grid; gap: 0.28rem; }
.doc__meta span {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  color: var(--ink-4);
  letter-spacing: 0.03em;
}
.doc__meta b { color: var(--ink-2); font-weight: 600; }
.doc__scan {
  position: relative;
  height: 3px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
}
.doc__scan::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--frost), transparent);
  animation: scanSweep 1.5s var(--ease-deep) infinite;
}
@keyframes scanSweep { from { translate: -50% 0; } to { translate: 250% 0; } }
.doc__lines { display: grid; gap: 0.3rem; }
.doc__lines i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.doc__lines i:nth-child(1) { width: 92%; }
.doc__lines i:nth-child(2) { width: 78%; }
.doc__lines i:nth-child(3) { width: 84%; }
.doc__lines i:nth-child(4) { width: 46%; background: var(--gold-a14); }

/* ── MISC ───────────────────────────────────────────────────────────── */
.lock {
  width: 9px; height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  position: relative;
  flex: none;
}
.lock::before {
  content: "";
  position: absolute;
  left: 50%; top: -5px;
  translate: -50% 0;
  width: 7px; height: 6px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.btn[data-toggle-egress][aria-pressed="true"] { color: var(--sage); border-color: color-mix(in srgb, var(--sage) 32%, transparent); }
.btn[data-toggle-egress][aria-pressed="false"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 34%, transparent); }

/* The control states what it actually does, in both positions. */
.egress { display: grid; gap: 0.55rem; justify-items: start; }
.egress__note {
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--ink-4);
  max-width: 30rem;
  transition: color var(--dur-mid);
}
.egress__note.is-open { color: color-mix(in srgb, var(--warn) 80%, var(--ink-2)); }
