/* ─────────────────────────────────────────────────────────────
   TEMPUS UNIVERSE — v2
   real cover art · audio system · radio-dial orbits · manifesto + contact
   ───────────────────────────────────────────────────────────── */

:root {
  --space:   #060812;
  --space-2: #0c0f1c;
  --bone:    #ded6c4;
  --bone-2:  #8c8678;
  --accent:  #e54a3a;
  --accent-soft: rgba(229, 74, 58, 0.35);
  --rule:    rgba(222, 214, 196, 0.22);
  --bg-texture-opacity: 0.18;
}

* { box-sizing: border-box; }
/* Immediate, reliable taps on touch devices: removes the 300ms double-tap-zoom
   delay and the gesture-disambiguation that can otherwise drop a tap on a small
   or slowly-drifting target (e.g. the orbital satellites). */
button { touch-action: manipulation; }
html, body {
  margin: 0; padding: 0;
  background: var(--space);
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  overflow: hidden;
  height: 100vh;
}
.serif { font-family: 'Cormorant Garamond', serif; font-weight: 500; }
.mono  { font-family: 'IBM Plex Mono', monospace; }
.dim   { color: var(--bone-2); }

/* ─── STAGE ─────────────────────────────────────────────────── */
#root, .stage {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(229,74,58,0.06), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(82,107,200,0.05), transparent 55%),
    var(--space);
}

/* Embedded eye-motif background — the book's symbol bled into the deep-space
   background as a faint composition. Sits BEHIND stars + orbits + everything. */
.bg-eye {
  position: absolute;
  top: 50%; left: 50%;
  width: min(1300px, 105vw);
  height: auto;
  transform: translate(-50%, -50%);
  opacity: var(--bg-texture-opacity);
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(circle at center, black 28%, transparent 68%);
          mask-image: radial-gradient(circle at center, black 28%, transparent 68%);
  mix-blend-mode: screen;
  filter: brightness(1.15) contrast(0.95);
}
.stage.tex-off .bg-eye { display: none; }

/* legacy hook — kept so existing JSX doesn't crash if it still renders .bg-texture */
.bg-texture { display: none; }

/* starfield */
.stars { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.stars span {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* ─── HUD ──────────────────────────────────────────────────── */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hud > * { pointer-events: auto; }

.hud-tl, .hud-tr, .hud-bl, .hud-br {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--bone-2);
}
.hud-tl { top: 22px; left: 26px; }
.hud-tr { top: 22px; right: 26px; text-align: right; align-items: flex-end; }
.hud-bl { bottom: 22px; left: 26px; }
.hud-br { bottom: 22px; right: 26px; text-align: right; align-items: flex-end; }

.hud-link {
  background: transparent; border: 0;
  color: var(--bone-2);
  font: inherit;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 10px;
  padding: 0;
  margin-top: 4px;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}
.hud-link:hover { color: var(--accent); }

.hud-bag {
  background: transparent;
  border: 1px solid var(--bone-2);
  color: var(--bone);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hud-bag:hover { border-color: var(--accent); color: var(--accent); }
.hud-bag.has {
  background: rgba(229,74,58,0.12);
  border-color: var(--accent);
  color: var(--accent);
  animation: bag-pulse 1.8s ease-in-out infinite;
}
@keyframes bag-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}

.brand {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.32em;
  color: var(--bone);
  line-height: 1;
}
.brand .accent { color: var(--accent); }
.hud b { color: var(--bone); font-weight: 500; }

.hud .crosshair {
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--bone-2);
  opacity: 0.4;
}
.hud .crosshair.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.hud .crosshair.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.hud .crosshair.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.hud .crosshair.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

.hud-scenelabel {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--bone-2);
}
.hud-scenelabel b { color: var(--bone); font-weight: 500; }
.hud-scenelabel .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
.hud-scenelabel .tick {
  color: var(--bone-2);
  font-size: 10px;
  letter-spacing: 0.3em;
  animation: tickIn 0.45s ease-out;
  min-width: 180px;
  text-align: left;
}
@keyframes tickIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* TEMPUS wordmark doubles as the back-to-dial control on every sub-scene,
   so the chrome stays in one place and never overlaps the scene header */
.brand-home {
  appearance: none; background: transparent; border: 0; padding: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.36em;
  letter-spacing: 0;
}
/* keep the wordmark identical to the home-page TEMPUS (.brand): same Cormorant
   font, weight and letter-spacing inherited from .brand — we only add the arrow.
   (do NOT use `font: inherit` here — it knocks the button off the brand font) */
.brand-home .brand-word { letter-spacing: 0.32em; }
.brand-back {
  font-size: 0.72em; line-height: 1; color: var(--bone-2);
  transition: transform 0.2s ease, color 0.2s ease;
}
.brand-home:hover .brand-word { color: #fff; }
.brand-home:hover .brand-back { color: var(--accent); transform: translateX(-3px); }

/* back btn — anchored to left edge so it never collides with brand or scene label */
.back-btn {
  position: absolute;
  top: 72px; left: 26px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--bone-2);
  background: rgba(6,8,18,0.75);
  border: 1px solid var(--bone-2);
  padding: 6px 12px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.back-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ─── SCENE WRAP ────────────────────────────────────────────── */
.scene {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 600ms ease, transform 900ms cubic-bezier(.4,0,.2,1), filter 700ms ease;
  pointer-events: none;
  will-change: opacity, transform;
  filter: blur(4px);
  z-index: 2;
}
.scene.active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  pointer-events: auto;
}
.scene.warp-out {
  opacity: 0;
  transform: scale(1.55);
  filter: blur(6px);
  pointer-events: none;
}
.scene.warp-pull {
  opacity: 0;
  transform: scale(0.7);
  filter: blur(6px);
  pointer-events: none;
}
/* Every scene stays mounted and stacked at inset:0, so a hidden scene is painted
   on top of whatever scene is active. pointer-events:none on .scene alone isn't
   enough — a few decorative layers (.at-dock > *, .dial > *, .detail-crawl)
   re-enable pointer-events on their own children, so those invisible bands kept
   swallowing taps and touch-scroll on the live scene below. Force the entire
   inactive subtree inert so only the active scene can ever receive a touch. */
.scene:not(.active),
.scene:not(.active) * { pointer-events: none !important; }

/* ─── COVER ART (real images + placeholders) ────────────────── */
.cover-img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 1px solid rgba(222,214,196,0.18);
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.7),
    inset 0 0 60px rgba(229,74,58,0.05);
  user-select: none;
}
.cover-img.cover-eye {
  object-fit: contain;
  border: none;
  box-shadow: none;
  background: transparent;
  /* the source PNG has noisy grain baked into its "black" bg — fade the
     rectangular edges into the starfield with a radial mask so only the
     central eye+orbits composition reads */
  -webkit-mask-image: radial-gradient(circle at center, black 38%, transparent 72%);
          mask-image: radial-gradient(circle at center, black 38%, transparent 72%);
  mix-blend-mode: screen;
  filter: brightness(1.2) contrast(1.05);
}
.cover-img.cover-audio {
  /* square audiobook covers */
  aspect-ratio: 1 / 1;
}

.cover-placeholder {
  position: relative;
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #1d1f2c 0%, #0a0c14 100%);
  border: 1px solid rgba(222,214,196,0.18);
  color: var(--bone);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12% 9%;
  text-align: center;
  user-select: none;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  overflow: hidden;
}
.cover-placeholder::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,
      rgba(222,214,196,0.03) 0,
      rgba(222,214,196,0.03) 1px,
      transparent 1px,
      transparent 6px);
  pointer-events: none;
}
.cover-placeholder::after {
  content: "";
  position: absolute;
  inset: 6%;
  border: 1px solid rgba(222,214,196,0.12);
  pointer-events: none;
}
.cover-placeholder .ph-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--accent);
  position: relative; z-index: 1;
}
.cover-placeholder .ph-title {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--accent);
  position: relative; z-index: 1;
}
.cover-placeholder .ph-emblem {
  display: flex; justify-content: center; align-items: center;
  flex: 1;
  color: var(--bone);
  position: relative; z-index: 1;
}
.cover-placeholder .ph-emblem svg { width: 50%; height: 50%; }
.cover-placeholder .ph-author {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--bone);
  position: relative; z-index: 1;
}

/* ─── AUDIO GLYPH (corner badge) ─────────────────────────────── */
.audio-glyph {
  position: absolute;
  top: 6px; right: 6px;
  z-index: 3;
  display: inline-block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}
.audio-glyph svg { width: 100%; height: 100%; display: block; }

/* ─── HOME · CORE + DIAL ─────────────────────────────────────── */
.home-stage {
  position: relative;
  width: 100%; height: 100%;
}

/* ── The eye system — one coherent centred orbital field.
   The cleaned eye sits at the heart; the satellites ride orbit rings
   that line up exactly with the eye's own drawn arcs. ── */
.eye-system {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(380px, 62vmin, 600px);
  height: clamp(380px, 62vmin, 600px);
  z-index: 2;
}

/* soft, clean centre glow — pure CSS, no grain, no hard edge */
.eye-glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 88%; height: 88%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at center,
    var(--accent-soft) 0%, rgba(229,74,58,0.05) 36%, transparent 68%);
  filter: blur(28px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  animation: glow-breathe 9s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.4;  transform: translate(-50%, -50%) scale(0.97); }
  50%      { opacity: 0.6;  transform: translate(-50%, -50%) scale(1.04); }
}

/* the eye line-art fills the field so its orbit arcs sit exactly under
   the rings the satellites ride; kept perfectly still for alignment.
   Decorative only — clicks pass through to the hit-target below. */
.eye-core-img {
  position: absolute;
  left: 50%; top: 50%;
  width: 100%; height: 100%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  filter: brightness(1.4) contrast(1.05);
  transition: filter 400ms ease;
}

/* if the centre is swapped to a book cover instead of the eye */
.eye-core-cover {
  position: absolute;
  left: 50%; top: 50%;
  width: 30%; height: 42%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}
.eye-core-cover .cover-img {
  width: 100%; height: 100%;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7), 0 0 70px rgba(229,74,58,0.12);
}

/* invisible circular hit-target over the eye itself */
.eye-hit {
  position: absolute;
  left: 50%; top: 50%;
  width: 46%; height: 46%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: none; border: 0; padding: 0;
  cursor: pointer;
  z-index: 3;
}
.eye-system:has(.eye-hit:hover) .eye-core-img { filter: brightness(1.75) contrast(1.1); }
.eye-system:has(.eye-hit:hover) .eye-glow { opacity: 0.8; }

/* caption sits below the whole system */
.system-caption {
  position: absolute;
  left: 50%; bottom: 7%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 5;
}
.system-caption .kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--bone-2);
  text-transform: uppercase;
}
.system-caption .t {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  color: var(--bone);
  margin-top: 4px;
}
.system-caption .sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.35em;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 6px;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

/* The orbital dial — SVG ellipses + JS-positioned satellites */
.dial {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: filter 600ms ease;
  z-index: 2;
}
/* Only the satellites catch taps. The ring-groups are structural containers, and
   because each one has a transform it forms its own stacking layer — so the inner
   ring's big transparent box paints on TOP of the outer ring's satellites. When
   that box caught pointer events it stole the inner half of BOOK/ATLAS at the
   diagonal positions (e.g. ~4–5 o'clock); the label, sitting further out, still
   worked. Leaving the boxes inert fixes it without changing anything visual. */
.dial .sat { pointer-events: auto; }

/* each ring-group is centred on the dial (= centred on the eye); the inline
   transform adds translate(-50%,-50%) + the live rotation */
.ring-group {
  position: absolute;
  left: 50%; top: 50%;
}
.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;   /* purely decorative — never intercept a satellite tap */
}

.dial-orbits {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.dial-orbits .orbit {
  fill: none;
  stroke: rgba(222,214,196,0.22);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  transition: stroke 400ms ease, stroke-width 400ms ease;
}
.dial-orbits .orbit.tuning {
  stroke: rgba(229,74,58,0.85);
  stroke-width: 1.5;
  stroke-dasharray: none;
}

/* satellites — positioned absolutely via JS-computed top/left, ALWAYS upright */
.sat {
  position: absolute;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 4;
  background: none; border: 0; padding: 0;
  color: inherit;
  font: inherit;
  transform: translate(-50%, -50%);
  /* Smooth tuning snap. During idle drift we update top/left every frame so
     transition wouldn't engage; during tuning we set once and transition runs. */
  transition: top 720ms cubic-bezier(.7,.05,.2,1),
              left 720ms cubic-bezier(.7,.05,.2,1),
              opacity 400ms ease;
}
.sat.drifting {
  /* no transition during drift — each frame's update should be instant */
  transition: opacity 400ms ease;
}
.sat:hover .node { border-color: var(--accent); color: var(--accent); }
.sat .node {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--bone);
  background: var(--space);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  color: var(--bone);
  transition: all 200ms ease;
}
.sat .node::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px dashed var(--rule);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;   /* decorative only — must never catch a tap */
}
.sat:hover .node::after { opacity: 1; }
.sat .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #f6f2ea;
  text-shadow: 0 1px 7px var(--space), 0 0 3px rgba(6,8,18,0.95);
  text-align: center;
  white-space: nowrap;
  transition: color 200ms ease;
}
.sat .sub {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #b6b0a0;
  text-shadow: 0 1px 6px var(--space), 0 0 3px rgba(6,8,18,0.95);
  white-space: nowrap;
}
.sat:hover .label { color: var(--accent); }

.sat.primary .node {
  width: 84px; height: 84px;
  border-color: var(--accent);
  color: var(--accent);
  background: var(--space);
  font-size: 24px;
  box-shadow:
    0 0 0 1px rgba(229,74,58,0.3),
    0 0 30px rgba(229,74,58,0.4);
}
/* Soft pulsing halo marks BOOK/ATLAS as the primary signals. Purely decorative —
   pointer-events:none, so it can never affect taps. (The earlier tap trouble was
   the orbit-ring boxes catching touches, since fixed; this ring was innocent.) */
.sat.primary .node::before {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(229,74,58,0.4);
  border-radius: 50%;
  animation: pulse-ring 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
.sat.primary .label { color: var(--accent); }

.sat.tuned .node {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(229,74,58,0.4),
    0 0 40px rgba(229,74,58,0.7);
}
.sat.tuned .label { color: var(--accent); }
.sat.dimmed { opacity: 0.18; }

/* ─── SHOP SCENE ────────────────────────────────────────────── */
.shop-stage { position: relative; width: 100%; height: 100%; }

.shop-rings {
  position: absolute; inset: 0;
  pointer-events: none;
}

.ring-labels {
  position: absolute; inset: 0;
  pointer-events: none;
}
.ring-labels .ring-label {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  background: var(--space);
  padding: 2px 8px;
  white-space: nowrap;
}
.ring-labels .l-novels { color: rgba(229,74,58,0.85); }
.ring-labels .l-audio  { color: rgba(222,214,196,0.7); }
.ring-labels .l-forth  { color: rgba(222,214,196,0.45); }

/* book in shop scene (clickable mini-book) */
.shop-book {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 280ms ease, filter 280ms ease;
  z-index: 4;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.shop-book:hover {
  transform: translate(-50%, -50%) scale(1.12);
  filter: drop-shadow(0 0 22px var(--accent-soft));
}
.shop-book .cover-wrap {
  position: relative;
  width: 96px; height: 134px;
}
.shop-book.audio .cover-wrap {
  width: 96px; height: 96px; /* square */
}
.shop-book.ghost .cover-wrap {
  width: 96px; height: 134px;
}
.shop-book.ghost .cover-placeholder {
  background: transparent;
  border-style: dashed;
}
.shop-book.ghost .ph-title, .shop-book.ghost .ph-kicker { color: var(--bone-2); }

.shop-book .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--bone-2);
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}
.shop-book .meta b { color: var(--bone); font-weight: 500; }
.shop-book .meta .audio-tag { color: var(--accent); }

/* ─── DETAIL SCENE ──────────────────────────────────────────── */
.detail-stage {
  position: relative;
  width: 100%; height: 100%;
}

.detail-book {
  position: absolute;
  top: 47%; left: 50%;
  transform: translate(-50%, -50%);
  width: 260px; height: 388px;
  z-index: 5;
  animation: bob 8s ease-in-out infinite;
}
.detail-book .book-3d {
  width: 100%; height: 100%;
  animation: float-rotate 24s ease-in-out infinite;
  transform-style: preserve-3d;
  perspective: 1200px;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, calc(-50% - 6px)); }
  50%      { transform: translate(-50%, calc(-50% + 6px)); }
}
/* flow-safe vertical float for the mobile book (no translate(-50%) baked in,
   so it works on a normally-positioned/static element) */
@keyframes bob-float {
  0%, 100% { transform: translateY(-5px); }
  50%      { transform: translateY(5px); }
}
.detail-book .glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 60%);
  z-index: -1;
  filter: blur(20px);
  opacity: 0.4;
}
.detail-book .detail-audio-badge {
  position: absolute;
  top: -16px; right: -16px;
  z-index: 2;
}
.detail-book .detail-audio-badge .audio-glyph {
  position: static;
}

/* callouts */
.callouts {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 4;
}
.callouts .tag {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  text-align: left;
  white-space: nowrap;
}
.callouts .tag .k {
  display: block;
  font-size: 9px;
  color: var(--bone-2);
  letter-spacing: 0.25em;
}
.callouts .tag .v {
  display: block;
  font-size: 13px;
  letter-spacing: 0.16em;
}

/* AUDIO PANEL — waveform sample player */
.audio-panel {
  position: absolute;
  left: 50%;
  bottom: 152px;
  transform: translateX(-50%);
  width: 460px;
  z-index: 6;
  background: rgba(6,8,18,0.78);
  border: 1px solid var(--rule);
  padding: 10px 14px;
  backdrop-filter: blur(6px);
}
.audio-panel.prominent {
  width: 540px;
  border-color: var(--accent);
  background: rgba(20,6,8,0.85);
  box-shadow: 0 0 30px rgba(229,74,58,0.25);
}

.audio-panel-head {
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.wave-player {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wave-play {
  width: 36px; height: 36px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}
.wave-play:hover { background: var(--accent); color: #fff; }
.wave-play.on    { background: var(--accent); color: #fff; }
.wave-play svg   { width: 14px; height: 14px; }

.wave-strip {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  position: relative;
}
.wave-strip .bar {
  flex: 1;
  background: rgba(222,214,196,0.18);
  min-width: 1px;
  transition: background 100ms ease;
}
.wave-strip .bar.on  { background: var(--accent); }
.wave-strip .bar.now {
  background: #fff;
  box-shadow: 0 0 8px var(--accent);
}

.wave-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  text-align: right;
  min-width: 50px;
}
.wave-meta .dim { font-size: 7px; }

/* buy panel */
.buy-panel {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 6;
}
.buy-btn {
  padding: 12px 22px;
  border: 1px solid var(--bone);
  background: rgba(6,8,18,0.94);   /* opaque so the book behind never bleeds through the text */
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(2px);
}
.buy-btn:hover { background: var(--bone); color: var(--space); }
.buy-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 30px rgba(229,74,58,0.5);
}
.buy-btn.primary:hover { background: #ff5a48; }

.detail-title {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 3;
}
.detail-title .kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--bone-2);
}
.detail-title .detail-h {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--bone);
  margin: 6px 0 2px;
  line-height: 1.08;
}
.detail-title .detail-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
}

/* book description — rises up through the channel behind the book, readable
   in the band between the top panel and the book ("transmission crawl"). */
.detail-crawl {
  position: absolute;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  width: 560px;
  max-width: calc(100% - 48px);
  height: 42%;                 /* upper channel, reaching down behind the book */
  overflow: hidden;
  z-index: 2;                  /* BEHIND the book (z5) and callouts (z4) */
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 64%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 64%, transparent 100%);
}
.detail-crawl .crawl-track {
  position: absolute;
  left: 0; right: 0; top: 0;
  animation: crawl 34s linear infinite;
}
.detail-crawl p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  line-height: 1.72;
  color: var(--bone);
  text-align: center;
  margin: 0;
  padding: 0 8px;
}
@keyframes crawl {
  0%   { transform: translateY(105%); }
  100% { transform: translateY(-105%); }
}
@media (prefers-reduced-motion: reduce) {
  .detail-crawl .crawl-track { animation: none; top: 0; }
}

/* ─── MANIFESTO SCENE ────────────────────────────────────────── */
.manifesto-stage {
  position: relative;
  width: 100%; height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bone-2) transparent;
}
.manifesto-stage::-webkit-scrollbar { width: 6px; }
.manifesto-stage::-webkit-scrollbar-thumb { background: var(--bone-2); }

.manifesto-scroll {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px 24px 120px;
}
.manifesto-scroll .m-header {
  text-align: center;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 36px;
}
.manifesto-scroll .m-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.manifesto-scroll h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin: 0;
}
.manifesto-scroll h1 em {
  font-style: italic;
  color: var(--accent);
}
.manifesto-scroll .m-meta {
  margin-top: 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--bone-2);
  text-transform: uppercase;
}

.manifesto-scroll .m-body {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.65;
  color: var(--bone);
  text-wrap: pretty;
}
.manifesto-scroll .m-body p {
  margin: 0 0 22px;
}
.manifesto-scroll .m-body .lead {
  font-size: 24px;
  line-height: 1.5;
  font-style: italic;
  color: var(--bone);
  margin-bottom: 40px;
}
.manifesto-scroll .m-body h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 48px 0 18px;
  font-weight: 500;
}
.manifesto-scroll .m-body .sig {
  margin-top: 48px;
  font-style: italic;
  color: var(--bone-2);
  text-align: right;
}

/* ─── CONTACT SCENE ──────────────────────────────────────────── */
.contact-stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px;
}
.terminal {
  width: 100%;
  max-width: 540px;
  background: rgba(6,8,18,0.85);
  border: 1px solid var(--rule);
  backdrop-filter: blur(6px);
}
.term-head {
  display: flex; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.term-head .dim { color: var(--bone-2); }

.term-body, .term-sent {
  padding: 24px 28px 28px;
  font-family: 'IBM Plex Mono', monospace;
}
.prompt {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 22px;
}
.prompt .dim { color: var(--accent); margin-right: 8px; }
.prompt .accent { color: var(--accent); margin-right: 8px; }

.term-body label {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.term-body .lbl {
  font-size: 9px;
  letter-spacing: 0.35em;
  color: var(--bone-2);
  text-transform: uppercase;
}
.term-body input, .term-body textarea {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--bone-2);
  border-bottom-color: var(--bone);
  color: var(--bone);
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  resize: vertical;
  letter-spacing: 0.04em;
}
.term-body input:focus, .term-body textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.term-body textarea { line-height: 1.5; min-height: 100px; }

.term-actions {
  display: flex; justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.transmit {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.transmit:hover { background: #ff5a48; }
.transmit.ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--bone-2);
}
.transmit.ghost:hover { border-color: var(--accent); color: var(--accent); }
.term-actions .dim { font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase; }

.term-sent pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--bone);
  line-height: 1.6;
  margin: 0 0 22px;
  white-space: pre-wrap;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ─── TWEAKS DOCK ───────────────────────────────────────────── */
.tweaks {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 200;
  background: rgba(6,8,18,0.92);
  border: 1px solid var(--rule);
  backdrop-filter: blur(8px);
  padding: 14px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: none;
  flex-direction: column;
  gap: 10px;
  color: var(--bone);
  min-width: 260px;
  max-width: 300px;
}
.tweaks.open { display: flex; }
.tweaks .row { display: flex; align-items: center; gap: 10px; }
.tweaks .k { color: var(--bone-2); width: 86px; flex-shrink: 0; font-size: 10px; }
.tweaks .v { display: flex; gap: 4px; flex-wrap: wrap; }
.tweaks .swatch {
  width: 18px; height: 18px;
  border: 1px solid var(--bone-2);
  cursor: pointer;
}
.tweaks .swatch.on { outline: 1px solid var(--bone); outline-offset: 2px; }
.tweaks .seg {
  display: flex; border: 1px solid var(--bone-2);
}
.tweaks .seg button {
  appearance: none; background: transparent; border: 0;
  color: var(--bone-2);
  font: inherit; padding: 4px 8px;
  cursor: pointer;
  border-right: 1px solid var(--bone-2);
}
.tweaks .seg button:last-child { border-right: 0; }
.tweaks .seg button.on { background: var(--accent); color: #fff; }
.tweaks .close {
  position: absolute; top: 6px; right: 8px;
  background: none; border: 0; color: var(--bone-2);
  cursor: pointer; font: inherit; font-size: 14px;
}
.tweaks-toggle {
  position: fixed; right: 18px; bottom: 18px;
  z-index: 199;
  background: rgba(6,8,18,0.92);
  border: 1px solid var(--rule);
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

/* subtle sound toggle, lives in the HUD bottom-right next to the version */
.hud-sound {
  background: none; border: 0; padding: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-2);
  opacity: 0.65;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.hud-sound:hover { color: var(--accent); opacity: 1; }
.hud-sound.on { color: var(--bone-2); }

/* ════════════════════════════════════════════════════════════════
   SHOP — title cards with format pills
   ════════════════════════════════════════════════════════════════ */
.shop-grid {
  position: absolute; inset: 0;
}
.title-card {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  z-index: 4;
  transition: transform 280ms ease, filter 280ms ease;
}
.title-card:hover { filter: drop-shadow(0 0 24px var(--accent-soft)); }

.title-card.large .tc-cover { width: 132px; height: 184px; }
.title-card.small .tc-cover { width: 100px; height: 140px; }
.title-card .tc-cover { position: relative; transition: transform 280ms ease; }
.title-card:hover .tc-cover { transform: translateY(-4px); }

.title-card .tc-meta { text-align: center; max-width: 200px; }
.title-card .tc-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.4em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.title-card .tc-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  color: var(--bone);
  line-height: 1.1;
}
.title-card.large .tc-title { font-size: 19px; }
.title-card .tc-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 4px;
}

.title-card .tc-formats {
  display: flex; gap: 6px;
  flex-direction: row;
}
.fmt-pill {
  background: rgba(6,8,18,0.85);
  border: 1px solid var(--bone-2);
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex; flex-direction: column;
  align-items: center; gap: 1px;
  line-height: 1.2;
  min-width: 72px;
}
.fmt-pill .fmt-tag { font-size: 9px; }
.fmt-pill .fmt-price { color: var(--bone); font-weight: 600; font-size: 11px; }
.fmt-pill .fmt-rt { font-size: 7px; letter-spacing: 0.16em; }
.fmt-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(229,74,58,0.08);
}
.fmt-pill.audio { border-style: dashed; }
.fmt-pill.audio .fmt-tag { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   DETAIL — 3D book + vinyl mockups
   ════════════════════════════════════════════════════════════════ */
.detail-mockup {
  position: absolute;
  top: 57%; left: 50%;          /* lowered to open a reading channel above for the crawl */
  transform: translate(-50%, -50%);
  width: 360px; height: 460px;
  z-index: 5;
  perspective: 2200px;
  display: flex; align-items: center; justify-content: center;
  animation: bob 8s ease-in-out infinite;
}
.detail-cover-flat { display: none; }   /* flat cover — only shown on small screens */
.detail-mockup .glow {
  position: absolute;
  inset: -25%;
  background: radial-gradient(ellipse at center, var(--accent-soft) 0%, transparent 60%);
  z-index: -1;
  filter: blur(20px);
  opacity: 0.4;
  pointer-events: none;
}

/* ─── 3D BOOK MOCKUP ─────────────────────────────────────── */
.bm-stage {
  width: 260px; height: 376px;
  perspective: 2200px;
}
.bm-book {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: bookSpin 18s ease-in-out infinite;
  will-change: transform;   /* keep the spin a clean compositor animation */
  /* slight tilt so we always see the spine */
  transform: rotateX(-6deg) rotateY(-22deg);
}
@keyframes bookSpin {
  0%, 100% { transform: rotateX(-6deg) rotateY(-28deg); }
  50%      { transform: rotateX(-6deg) rotateY(-12deg); }
}

.bm-face {
  position: absolute;
  inset: 0;
}
.bm-front {
  background: #0a0c14;
  transform: translateZ(12px);
  box-shadow: inset 0 0 60px rgba(229,74,58,0.05);
}
.bm-front img {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(222,214,196,0.18);
}
.bm-back {
  background: linear-gradient(180deg, #0a0c14 0%, #060812 100%);
  border: 1px solid rgba(222,214,196,0.1);
  transform: translateZ(-12px) rotateY(180deg);
}

.bm-spine {
  width: 24px;
  left: 0; top: 0; bottom: 0;
  height: 100%;
  background: linear-gradient(90deg, #1a0e0c 0%, #0a0508 50%, #1a0e0c 100%);
  transform-origin: left center;
  transform: rotateY(-90deg) translateX(-12px);
  border-top: 1px solid rgba(222,214,196,0.12);
  border-bottom: 1px solid rgba(222,214,196,0.12);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bm-spine-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 9px;
  color: var(--bone);
  letter-spacing: 0.08em;
  white-space: nowrap;
  transform: rotate(-90deg);
  width: 376px;
  text-align: center;
}

.bm-right {
  width: 24px;
  right: 0; top: 0; bottom: 0;
  height: 100%;
  left: auto;
  background: repeating-linear-gradient(
    to right,
    #d8d0bc 0px, #d8d0bc 1px,
    #c2bba6 1px, #c2bba6 2px
  );
  transform-origin: right center;
  transform: rotateY(90deg) translateX(12px);
  border-top: 1px solid rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(0,0,0,0.3);
}

.bm-top {
  height: 24px;
  top: 0; left: 0; right: 0;
  background: repeating-linear-gradient(
    to right,
    #d8d0bc 0px, #d8d0bc 1px,
    #c2bba6 1px, #c2bba6 2px
  );
  transform-origin: top center;
  transform: rotateX(90deg) translateY(-12px);
}
.bm-bottom {
  height: 24px;
  bottom: 0; left: 0; right: 0;
  top: auto;
  background: repeating-linear-gradient(
    to right,
    #c2bba6 0px, #c2bba6 1px,
    #aaa492 1px, #aaa492 2px
  );
  transform-origin: bottom center;
  transform: rotateX(-90deg) translateY(12px);
}

/* ─── VINYL MOCKUP ───────────────────────────────────────── */
.vinyl-stage {
  position: relative;
  width: 400px; height: 360px;
  perspective: 1800px;
}
.vinyl-sleeve {
  position: absolute;
  top: 0; left: 0;
  width: 280px; height: 280px;
  background: #0a0c14;
  border: 1px solid rgba(222,214,196,0.2);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7);
  transform: rotateY(-4deg);
  z-index: 1;
}
.vinyl-sleeve img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.vinyl-disc {
  position: absolute;
  top: 28px; right: 0;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, #0a0a0e 0%, #050507 100%);
  z-index: 2;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 18px 40px -12px rgba(0,0,0,0.8);
  animation: vinyl-spin 6s linear infinite;
  display: flex; align-items: center; justify-content: center;
}
@keyframes vinyl-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.vinyl-grooves {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at center,
      rgba(40, 40, 50, 0.6) 0px,
      rgba(40, 40, 50, 0.6) 1px,
      rgba(10, 10, 14, 1) 1px,
      rgba(10, 10, 14, 1) 3px
    );
  opacity: 0.55;
}
.vinyl-label {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  z-index: 1;
}
.vl-side { font-size: 9px; opacity: 0.85; }
.vl-title { font-size: 8px; margin-top: 2px; }
.vl-dot {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--space);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.vinyl-tonearm {
  position: absolute;
  top: -14px; right: -10px;
  width: 200px; height: 160px;
  z-index: 3;
  pointer-events: none;
  transform-origin: top right;
  animation: tonearm-sway 6s ease-in-out infinite;
}
@keyframes tonearm-sway {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(4deg); }
}
.tonearm-pivot {
  position: absolute;
  top: 0; right: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8b0a0, #6b6757);
  border: 1px solid #4a4636;
}
.tonearm-rod {
  position: absolute;
  top: 9px; right: 9px;
  width: 2px;
  height: 170px;
  background: linear-gradient(180deg, #b8b0a0 0%, #888070 100%);
  transform-origin: top right;
  transform: rotate(38deg);
}
.tonearm-head {
  position: absolute;
  width: 16px; height: 8px;
  background: var(--accent);
  transform-origin: top right;
  /* place at tip of rod */
  top: 168px; right: 0;
  transform: rotate(38deg) translateX(-2px);
  box-shadow: 0 0 8px var(--accent-soft);
}

/* ════════════════════════════════════════════════════════════════
   CART SCENE
   ════════════════════════════════════════════════════════════════ */
.cart-stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px;
  overflow-y: auto;
}
.cart-term { max-width: 720px; width: 100%; }
.cart-body { padding: 22px 26px 26px; font-family: 'IBM Plex Mono', monospace; }

.cart-empty { color: var(--bone); }
.cart-empty p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--bone-2);
  line-height: 1.5;
  margin-bottom: 24px;
}

.cart-list {
  border: 1px solid var(--rule);
  margin-bottom: 22px;
}
.cart-list-head, .cart-row {
  display: grid;
  grid-template-columns: 56px 1fr 100px 80px 30px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.cart-list-head {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--rule);
  color: var(--bone-2);
  font-size: 9px;
  letter-spacing: 0.3em;
}
.cart-row {
  border-bottom: 1px solid rgba(222,214,196,0.08);
  color: var(--bone);
}
.cart-row:last-child { border-bottom: 0; }
.cart-row .c-no { color: var(--accent); }
.cart-row .c-title b { font-weight: 500; }
.cart-row .c-fmt { color: var(--bone-2); font-size: 10px; }
.cart-row .c-price { text-align: right; color: var(--bone); }
.cart-row .c-rm {
  background: transparent; border: 1px solid var(--bone-2);
  color: var(--bone-2);
  cursor: pointer; padding: 2px 6px;
  font: inherit; line-height: 1;
}
.cart-row .c-rm:hover { color: var(--accent); border-color: var(--accent); }

.cart-totals {
  display: flex; flex-direction: column;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.cart-totals > div {
  display: flex; justify-content: space-between;
  padding: 4px 14px;
}
.cart-grand {
  font-size: 14px;
  color: var(--bone);
  border-top: 1px solid var(--rule);
  margin-top: 6px;
  padding-top: 10px !important;
}
.cart-grand span:last-child { color: var(--accent); }

.cart-channel { margin-bottom: 20px; }
.cart-channel-row {
  display: flex; align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.cart-channel-row .lbl {
  font-size: 9px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--bone-2);
  min-width: 110px;
}
.cart-channel-row input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--bone-2);
  color: var(--bone);
  font: inherit; font-size: 12px;
  padding: 7px 10px;
  outline: none;
  letter-spacing: 0.04em;
}
.cart-channel-row input:focus { border-color: var(--accent); }

.cart-actions {
  display: flex; justify-content: space-between;
  gap: 14px;
}
.cart-actions .transmit { padding: 12px 22px; }
.transmit.sending {
  animation: txp 0.8s ease-in-out infinite;
}
@keyframes txp {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.cart-term.sent .term-body pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  color: var(--bone);
  font-size: 11px;
  line-height: 1.7;
}
.dot-on { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   MANIFEST (library) SCENE
   ════════════════════════════════════════════════════════════════ */
.manifest-stage {
  position: relative;
  width: 100%; height: 100%;
  overflow-y: auto;
  padding: 100px 32px 80px;
}
.manifest-stage::-webkit-scrollbar { width: 6px; }
.manifest-stage::-webkit-scrollbar-thumb { background: var(--bone-2); }

.manifest-head {
  max-width: 820px;
  margin: 0 auto 44px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 28px;
}
.manifest-head .m-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.manifest-head h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 48px;
  margin: 0 0 8px;
  color: var(--bone);
  line-height: 1;
}
.manifest-head h1 em { font-style: italic; color: var(--accent); }
.manifest-head .m-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--bone-2);
  text-transform: uppercase;
}

.manifest-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: 14px;
}

.mf-item {
  border: 1px solid var(--rule);
  background: rgba(6,8,18,0.7);
  transition: border-color 0.2s ease;
}
.mf-item.open { border-color: var(--accent); }

.mf-row {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  gap: 18px;
  padding: 14px;
  align-items: center;
  cursor: pointer;
}
.mf-cover {
  width: 80px; height: 80px;
  position: relative;
  background: #0a0c14;
  overflow: hidden;
}
.mf-cover img { width: 100%; height: 100%; object-fit: cover; }
.mf-audio-glyph {
  position: absolute;
  top: 4px; right: 4px;
  color: var(--accent);
  font-size: 14px;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}
.mf-fmt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.4em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.mf-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--bone);
  line-height: 1;
  margin-bottom: 6px;
}
.mf-state {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--bone-2);
  text-transform: uppercase;
}
.mf-action { text-align: right; }
.mf-toggle {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
  font-size: 14px;
}

.mf-body {
  padding: 4px 14px 18px;
  border-top: 1px solid var(--rule);
  background: rgba(0,0,0,0.25);
}

.mf-reader-preview {
  display: flex; gap: 18px;
  align-items: stretch;
  padding: 14px 0 4px;
}
.mf-rp-page {
  flex: 1;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--bone);
  background: rgba(255,255,255,0.02);
  border-left: 2px solid var(--accent);
  padding: 14px 18px;
}
.mf-rp-page p { margin: 0 0 8px; }

.mf-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--bone);
}
.mf-empty p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--bone-2);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════
   AUDIOBOOK CHAPTER PLAYER (inside manifest)
   ════════════════════════════════════════════════════════════════ */
.abp {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  padding-top: 16px;
}

.abp-now {
  background: rgba(20,6,8,0.65);
  border: 1px solid var(--accent);
  padding: 14px;
}
.abp-now-meta {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.abp-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.4em;
  color: var(--accent);
}
.abp-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--bone);
  line-height: 1.1;
}
.abp-dur {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
}

.abp-wave {
  height: 60px;
  display: flex; align-items: center;
  gap: 2px;
  cursor: pointer;
  margin-bottom: 14px;
}
.abp-bar {
  flex: 1;
  background: rgba(222,214,196,0.16);
  min-width: 1px;
}
.abp-bar.on  { background: var(--accent); }
.abp-bar.now { background: #fff; box-shadow: 0 0 6px var(--accent); }

.abp-controls {
  display: flex; align-items: center;
  justify-content: center;
  gap: 10px;
}
.abp-skip {
  background: transparent;
  border: 1px solid var(--bone-2);
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 6px 10px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}
.abp-skip:hover { border-color: var(--accent); color: var(--accent); }
.abp-play {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.abp-play svg { width: 16px; height: 16px; }
.abp-play.on  { background: #fff; color: var(--accent); }

.abp-list {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--rule);
  padding: 8px;
  max-height: 360px;
  overflow-y: auto;
}
.abp-list::-webkit-scrollbar { width: 4px; }
.abp-list::-webkit-scrollbar-thumb { background: var(--bone-2); }

.abp-list-head {
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.35em;
  color: var(--bone-2);
  text-transform: uppercase;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}

.abp-row {
  display: grid;
  grid-template-columns: 28px 1fr 56px 18px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  border-bottom: 1px solid rgba(222,214,196,0.05);
  transition: background 0.15s ease;
}
.abp-row:hover { background: rgba(229,74,58,0.06); }
.abp-row.on    { background: rgba(229,74,58,0.12); }
.abp-row-no    { color: var(--accent); font-size: 10px; letter-spacing: 0.2em; }
.abp-row-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--bone);
}
.abp-row-dur   { font-size: 9px; text-align: right; letter-spacing: 0.18em; }
.abp-row-state { color: var(--accent); font-size: 12px; text-align: center; }

/* ════════════════════════════════════════════════════════════════
   MOBILE / PORTRAIT — vertical tuning column
   ════════════════════════════════════════════════════════════════ */
.home-mobile { display: none; }

@media (max-width: 720px), (orientation: portrait) {
  /* keep the orbital dial on mobile too — space-like, not a menu.
     The whole dial scales with .eye-system, so we size that for small
     screens and enlarge tap-targets; the vertical card list stays hidden. */
  .home-mobile { display: none; }

  .eye-system { width: clamp(270px, 84vmin, 520px); height: clamp(270px, 84vmin, 520px); }
  .sat .node { width: 46px; height: 46px; font-size: 15px; }
  .sat.primary .node { width: 68px; height: 68px; font-size: 20px; }
  .sat .label { font-size: 9px; letter-spacing: 0.16em; }
  .sat .sub { display: none; }
  .system-caption { bottom: 9%; }
  .system-caption .t { font-size: 20px; }
  .hm-core {
    display: flex; flex-direction: column;
    align-items: center; gap: 14px;
    cursor: pointer;
    padding: 16px;
    border: 1px solid var(--rule);
    background: rgba(6,8,18,0.5);
  }
  .hm-core-art {
    width: 70%;
    aspect-ratio: 5/6;
    max-width: 240px;
  }
  .hm-core-art .cover-img { width: 100%; height: 100%; }
  .hm-core-art .cover-eye {
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 72%);
            mask-image: radial-gradient(circle at center, black 40%, transparent 72%);
  }
  .hm-core-cap { text-align: center; }
  .hm-core-cap .kicker {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px; letter-spacing: 0.35em;
    color: var(--bone-2); text-transform: uppercase;
  }
  .hm-core-cap .t {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 22px;
    color: var(--bone);
    margin-top: 4px;
  }

  .hm-sats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .hm-sat {
    background: rgba(6,8,18,0.6);
    border: 1px solid var(--bone-2);
    color: var(--bone);
    font: inherit;
    padding: 18px 14px;
    display: flex; flex-direction: column;
    gap: 4px; align-items: flex-start;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
  }
  .hm-sat.primary {
    border-color: var(--accent);
    background: rgba(229,74,58,0.08);
    grid-column: 1 / -1;
  }
  .hm-glyph {
    color: var(--accent);
    font-size: 24px;
    line-height: 1;
  }
  .hm-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--bone);
    margin-top: 6px;
  }
  .hm-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  /* shop reflows to single column */
  .shop-grid { position: static; padding: 90px 18px 100px; height: 100%; overflow-y: auto; }
  .shop-rings, .ring-labels { display: none; }
  .title-card {
    position: static !important;
    transform: none !important;
    display: grid !important;
    grid-template-columns: 92px 1fr;
    grid-template-rows: auto auto;
    gap: 12px 14px;
    padding: 14px;
    border: 1px solid var(--rule);
    margin-bottom: 12px;
    align-items: center;
  }
  .title-card .tc-cover { width: 92px; height: 130px !important; grid-row: 1 / span 2; }
  .title-card .tc-meta { text-align: left; }
  .title-card .tc-formats { grid-column: 2; }

  /* detail page reflows — small book, clear room at top and bottom */
  .detail-mockup { transform: translate(-50%, -50%) scale(0.42); top: 59%; }
  .detail-title { top: 11%; }
  .detail-title .kicker { display: none; }          /* redundant — collided with the TEMPUS brand */
  .detail-title .detail-h { font-size: 20px; }
  .detail-title .detail-sub { font-size: 9px; }
  .detail-crawl { top: 27%; height: 24%; width: calc(100% - 36px); }
  .detail-crawl p { font-size: 14px; line-height: 1.58; }
  .buy-panel { flex-direction: column; align-items: stretch; gap: 8px; bottom: 50px; width: calc(100% - 40px); }
  .buy-btn { text-align: center; padding: 11px 16px; }

  /* HUD compact — declutter so chrome never crowds content */
  .hud-tl .brand { font-size: 19px; }
  .hud-tl .dim { display: none; }
  .hud-tr { display: none; }
  .hud-bl { display: none; }              /* COORD readout */
  .hud-br .dim { display: none; }         /* version text — keep only the sound toggle */
  .hud-scenelabel { display: none; }
  .back-btn { top: 56px; }

  /* contact terminal — top-aligned + scrollable so titles never clip */
  .contact-stage { align-items: flex-start; overflow-y: auto; padding: 84px 18px 40px; }
  .term-body textarea { min-height: 84px; }
  .term-actions { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* manifesto — smaller heading, clears the HUD */
  .manifesto-scroll { padding: 92px 22px 90px; }
  .manifesto-scroll h1 { font-size: 40px; }
  .manifesto-scroll .m-body { font-size: 17px; }
  .manifesto-scroll .m-body .lead { font-size: 20px; }

  /* manifest list reflows */
  .abp { grid-template-columns: 1fr; }
  .manifest-head h1 { font-size: 36px; }
  .mf-row { grid-template-columns: 64px 1fr 30px; gap: 12px; }
  .mf-cover { width: 64px; height: 64px; }
  .mf-title { font-size: 18px; }

  /* cart reflows */
  .cart-list-head, .cart-row {
    grid-template-columns: 36px 1fr 60px 20px;
    gap: 8px;
  }
  .cart-row .c-fmt { display: none; }
  .cart-actions { flex-direction: column; }

  /* tweaks toggle compact */
  .tweaks-toggle { left: 18px; right: auto; }
  .tweaks { left: 18px; right: auto; bottom: 56px; max-width: calc(100vw - 36px); }
}

/* ── shorter phones (e.g. S21) — even smaller book so the crawl has room to read ── */
@media (orientation: portrait) and (max-height: 800px) {
  .detail-title { top: 9%; }
}

/* ════════════════════════════════════════════════════════════════
   BOOK (detail) page — mobile / portrait override.
   The desktop "poster" layers the 3D cover, blurb crawl, corner facts and
   buy buttons as absolutely-positioned elements; on a phone or any portrait
   screen (incl. tablets) they collide — the cover sits on the blurb, the crawl
   runs under the side facts, and the buttons stretch the full width. On small
   screens we drop the overlay for a plain vertical column with a FLAT cover
   (the fixed-size 3D book can't be reflowed cleanly) and width-capped blocks.
   Placed last so it wins over the older detail rules earlier in this file.
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 720px), (orientation: portrait) {
  .detail-stage {
    overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
    padding: 64px 18px 40px;
  }
  /* un-absolute every layer so they stack in normal reading order
     (except the 3D book, which keeps its own positioning + float transform) */
  .detail-stage > *:not(.detail-mockup) { position: static !important; transform: none !important; inset: auto; }

  .detail-title { width: 100%; text-align: center; margin-bottom: 2px; }
  .detail-title .kicker { display: block; margin-bottom: 6px; }
  .detail-title .detail-h { font-size: 25px; }
  .detail-title .detail-sub { font-size: 9px; margin-top: 6px; }

  /* keep the 3D floating book on mobile too — scaled to the old flat-cover
     footprint (~175px wide) and centred in normal flow, so it hovers + spins
     exactly like desktop. bm-book keeps its desktop bookSpin; the mockup gets a
     flow-safe vertical float (the desktop `bob` bakes in translate(-50%) which
     a static element can't use). */
  .detail-mockup {
    position: static; margin: 8px auto 20px;
    width: min(240px, 74vw); height: 326px;
    display: flex; align-items: center; justify-content: center;
    perspective: 2200px;
    transform: none;   /* drop desktop's translate(-50%,-50%); float anim overrides while running */
    animation: bob-float 8s ease-in-out infinite;
  }
  .detail-mockup .bm-stage { display: block; transform: scale(0.86); }  /* 260*.86 ≈ 224px wide cover */
  .detail-mockup .glow { display: none; }   /* skip the blur glow on phones for perf */
  .detail-cover-flat { display: none; }

  /* meta facts as a tidy 2×2 grid instead of corner pins */
  .callouts {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px 10px; width: 100%; max-width: 320px; margin: 0 auto 18px;
  }
  .callouts .tag { position: static; transform: none; white-space: normal; }
  .callouts .tag .v { font-size: 17px; }

  /* blurb as a normal, fully-readable paragraph (no marquee, no clipping) */
  .detail-crawl {
    width: 100%; max-width: 460px; height: auto;
    overflow: visible; margin: 0 auto 20px; pointer-events: auto;
    -webkit-mask-image: none; mask-image: none;
  }
  .detail-crawl .crawl-track { position: static; animation: none; }
  .detail-crawl p { font-size: 14px; line-height: 1.62; }

  /* buttons: stacked, comfortable, width-capped (no ~800px-wide buttons) */
  .buy-panel {
    flex-direction: column; align-items: stretch;
    gap: 9px; width: 100%; max-width: 360px; margin: 0 auto;
  }
  .buy-btn { text-align: center; padding: 12px 16px; }
}

