/* ── PAGE TRANSITIONS ──────────────────────────────────────────── */
body { animation: wh-pageIn .4s ease-out both; }
html.warp-exit * { pointer-events: none !important; }
html.warp-exit body { animation: wh-pageOut .35s ease-in forwards !important; }

@keyframes wh-pageIn  { from { opacity:0; } to { opacity:1; } }
@keyframes wh-pageOut { to   { opacity:0; } }

/* ── WARP DISTORTION OVERLAY (injected by wh40k.js) ───────────── */
.wh-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  animation: wh-warpIn .7s ease-out forwards;
}
html.warp-exit .wh-flash-overlay {
  animation: wh-warpOut .35s ease-in forwards !important;
}
@keyframes wh-warpIn {
  0%   { opacity:1; backdrop-filter: hue-rotate(210deg) brightness(4.5) saturate(7) contrast(1.6); }
  45%  { opacity:0.8; backdrop-filter: hue-rotate(120deg) brightness(2.5) saturate(4) contrast(1.3); }
  80%  { opacity:0.4; backdrop-filter: hue-rotate(30deg) brightness(1.4) saturate(1.6); }
  100% { opacity:0; backdrop-filter: none; }
}
@keyframes wh-warpOut {
  0%   { opacity:0; backdrop-filter: none; }
  40%  { opacity:0.5; backdrop-filter: hue-rotate(90deg) brightness(2) saturate(3); }
  100% { opacity:1; backdrop-filter: hue-rotate(210deg) brightness(4.5) saturate(7) contrast(2); }
}

/* ── WARP GLITCH ───────────────────────────────────────────────── */
@keyframes wh-glitch {
  0%,100%   { transform:none; filter:none; }
  8%        { transform:skewX(-4deg) translateX(-3px); filter:hue-rotate(120deg) brightness(2.2); }
  14%       { transform:skewX(3deg) translateX(4px); filter:hue-rotate(-90deg); }
  20%,46%   { transform:none; filter:none; }
  52%       { transform:translateY(-1px) scaleX(.99); filter:hue-rotate(60deg) brightness(1.6); }
  58%       { transform:skewX(-1deg); filter:none; }
}
.wh-glitch { animation: wh-glitch .75s linear forwards; }

/* ── REDACTED REVEAL ───────────────────────────────────────────── */
.redacted {
  position: relative;
  cursor: crosshair;
  transition: background .15s, color .15s;
}
.redacted::before {
  content: "CLASSIFICATION OVERRIDE";
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: .48rem;
  letter-spacing: .26em;
  white-space: nowrap;
  color: #c9a24b;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}
.redacted:hover::before {
  opacity: 1;
  animation: wh-classFlash .9s steps(1) infinite;
}
.redacted:hover {
  background: rgba(148,3,3,.35) !important;
  color: #e8e0cc !important;
  user-select: text !important;
}
@keyframes wh-classFlash {
  0%,49% { opacity:1; }
  50%,100% { opacity:0; }
}

/* ── PARCHMENT TOOLTIPS ────────────────────────────────────────── */
[data-lore] {
  position: relative;
  border-bottom: 1px dotted rgba(201,162,75,.5);
  cursor: help;
}
[data-lore]::after {
  content: attr(data-lore);
  position: absolute;
  bottom: calc(100% + .75rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(260px, 80vw);
  padding: .85rem 1rem;
  background: #120f06;
  border: 1px solid rgba(201,162,75,.55);
  box-shadow: 0 0 28px rgba(0,0,0,.95), 0 0 0 3px rgba(0,0,0,.9),
              inset 0 0 20px rgba(201,162,75,.04);
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  line-height: 1.7;
  color: #e0d8c4;
  letter-spacing: .04em;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  z-index: 500;
}
[data-lore]:hover::after { opacity: 1; }

/* ── LOYALTY BADGE ─────────────────────────────────────────────── */
.loyalty-badge {
  display: none;
  font-family: 'Cinzel', serif;
  font-size: .58rem;
  letter-spacing: .26em;
  color: rgba(201,162,75,.65);
  text-align: center;
  margin: .25rem auto .1rem;
  animation: wh-badgePulse 4s ease-in-out infinite;
}
.loyalty-badge.loyal { display: block; }
.loyalty-badge::before { content: "\2720\0020"; }
.loyalty-badge::after  { content: "\0020\2720"; }
@keyframes wh-badgePulse {
  0%,100% { opacity:.65; }
  50%     { opacity:1; }
}

/* ── OATH MODAL ────────────────────────────────────────────────── */
.oath-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.93);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
}
.oath-modal.visible {
  opacity: 1;
  pointer-events: auto;
}
.oath-box {
  width: min(480px, 92vw);
  padding: 2.5rem 2.2rem;
  background: linear-gradient(160deg, #0e0a05 0%, #070502 100%);
  border: 1px solid rgba(201,162,75,.6);
  box-shadow: 0 0 0 1px rgba(0,0,0,.9), 0 0 0 5px rgba(201,162,75,.08),
              0 0 60px rgba(201,162,75,.1), inset 0 0 40px rgba(0,0,0,.6);
  text-align: center;
}
.oath-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: .32em;
  color: #c9a24b;
  margin: 0 0 .3rem;
}
.oath-divider {
  color: rgba(201,162,75,.3);
  letter-spacing: .5em;
  font-size: .75rem;
  margin: .8rem 0;
}
.oath-sub {
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .1em;
  color: rgba(228,220,200,.6);
  margin: 0 0 1rem;
  line-height: 1.6;
}
.oath-text {
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  letter-spacing: .07em;
  color: #e8e0cc;
  line-height: 1.8;
  margin: .8rem 0 1.4rem;
}
.oath-btn {
  display: inline-block;
  padding: .7rem 2.8rem;
  background: none;
  border: 1px solid rgba(201,162,75,.65);
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  letter-spacing: .28em;
  color: #c9a24b;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, letter-spacing .2s;
}
.oath-btn:hover {
  background: rgba(201,162,75,.1);
  box-shadow: 0 0 20px rgba(201,162,75,.2), inset 0 0 10px rgba(201,162,75,.05);
  letter-spacing: .35em;
}
.oath-small {
  margin-top: 1rem;
  font-size: .55rem;
  letter-spacing: .2em;
  color: rgba(201,162,75,.35);
  font-family: 'Cinzel', serif;
}

/* ── FLANKS (global clip so pillar animation never causes page scroll) ── */
.flank { overflow: hidden; }

/* ── GLOBAL BODY CLEARANCE so voxbar never covers page content ─────── */
body { padding-bottom: 4rem; }

/* ── VOX BAR (shared across all pages) ────────────────────────── */
.voxbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  transform: none;
  width: auto;
  display: flex;
  align-items: center;
  padding: .45rem .9rem;
  background: rgba(5,4,3,.96);
  border-top: 1px solid rgba(201,162,75,.14);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
}
.voxbar .prompt {
  color: rgba(201,162,75,.5);
  font-size: 1rem;
  flex-shrink: 0;
  margin-right: .3rem;
}

/* ── VOX TRANSMISSION FEED ─────────────────────────────────────── */
.vox-feed {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 1rem;
  letter-spacing: .08em;
  color: rgba(201,162,75,.9);
  margin-left: .75rem;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}
/* inner ticker — scrolls the message left so full text is always readable */
.vox-ticker {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}
.vox-feed.typing .vox-ticker {
  animation: wh-voxScroll var(--scroll-dur, 10s) linear forwards;
}
@keyframes wh-voxScroll {
  /* phase 1 — typewriter reveal (stepped) */
  0% {
    transform: translateX(0); clip-path: inset(0 100% 0 0); opacity: 1;
    animation-timing-function: steps(24, end);
  }
  /* phase 2 — pause with full text visible */
  22% {
    transform: translateX(0); clip-path: inset(0 0% 0 0); opacity: 1;
    animation-timing-function: linear;
  }
  30% {
    transform: translateX(0); clip-path: inset(0 0% 0 0); opacity: 1;
    animation-timing-function: linear;
  }
  /* phase 3 — scroll off left */
  87% { transform: translateX(-110%); clip-path: inset(0 0% 0 0); opacity: 1; }
  96% { transform: translateX(-110%); clip-path: inset(0 0% 0 0); opacity: 0; }
  100%{ transform: translateX(-110%); clip-path: inset(0 0% 0 0); opacity: 0; }
}

/* ── THOUGHT DAILY (index page) ────────────────────────────────── */
.thought-daily {
  font-family: 'Cinzel', serif;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  letter-spacing: .08em;
  font-style: italic;
  color: rgba(201,162,75,.75);
  text-align: center;
  margin: .9rem auto .4rem;
  line-height: 1.7;
  min-height: 1.5em;
}
