:root {
  --room-bg: #070504;
  --wood-dark: #19110b;
  --cork-base: #382415;

  --vault-steel-top: #3b3f49;
  --vault-steel-mid: #22252d;
  --vault-steel-dark: #111216;
  --vault-rim: #727a8c;
  --felt-interior: #14100c;

  --gold-brass: #cfa85b;
  --gold-bright: #f0d58e;
  --gold-deep: #7a5823;
  --gold-glow: rgba(207, 168, 91, 0.45);

  --paper-cream: #f4eee1;
  --paper-aged: #e6d7bc;
  --paper-legal: #eae2c5;
  --paper-manila: #d6b278;
  --paper-ledger: #faf6ea;
  --newsprint: #ece4d2;
  --ink-black: #141210;
  --ink-muted: #524738;
  --thread-red: #a82424;

  --font-display: 'Cinzel', serif;
  --font-news: 'Playfair Display', Georgia, serif;
  --font-editorial: 'Libre Baskerville', Georgia, serif;
  --font-typewriter: 'Courier Prime', monospace;
  --font-mono: 'DM Mono', monospace;
  --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }

::selection { background: #cfa85b !important; color: #0c0906 !important; }
::-moz-selection { background: #cfa85b !important; color: #0c0906 !important; }

html { scroll-behavior: smooth; background: var(--room-bg); }
body {
  background: var(--room-bg);
  color: var(--paper-cream);
  font-family: var(--font-ui);
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #090705; border: 1px solid #1a120b; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4b3620, #20150d);
  border: 1px solid var(--gold-brass);
  border-radius: 1px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #745432, #382415); border-color: var(--gold-bright); }

.film-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.room-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background: radial-gradient(circle at 50% 35%, transparent 20%, rgba(4,3,2,0.65) 60%, rgba(2,1,1,0.98) 100%);
}

/* ==========================================================================
   HEADER & STACKED SOVEREIGN LOGO (ENLARGED & CLEAN)
   ========================================================================== */
header.evidence-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 68px; z-index: 9999;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 1.25rem;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.98) 0%, rgba(14, 10, 7, 0.95) 100%);
  border-bottom: 1px solid rgba(207, 168, 91, 0.3);
  backdrop-filter: blur(16px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.85);
}

.brand-cluster {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  flex-shrink: 0;
}

/* Enlarged raw SVG Logo - Flat, No borders, No drop shadows */
.sovereign-logo-raw {
  width: 40px; height: 40px;
  display: block;
  border: none !important;
  outline: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  filter: none !important;
  background: transparent !important;
}

/* Stacked Typography (The / OPEN / RECORDS) - No .COM */
.brand-title-stacked {
  display: flex; flex-direction: column;
  line-height: 0.9; font-family: var(--font-display);
  font-weight: 900; color: var(--paper-cream);
  text-align: left;
}
.brand-title-stacked .word-the {
  font-size: 0.52rem; color: var(--gold-bright); letter-spacing: 0.28em;
}
.brand-title-stacked .word-open {
  font-size: 0.85rem; letter-spacing: 0.16em;
}
.brand-title-stacked .word-records {
  font-size: 0.85rem; letter-spacing: 0.14em;
}

/* ==========================================================================
   45° PERSPECTIVE MECHANICAL DRAWER (IDENTICAL MATCHED WIDTHS)
   ========================================================================== */
.drawer-perspective-rig {
  position: relative;
  width: 380px; /* Rig controls total width */
  perspective: 1100px;
}

/* Header Slot Trigger */
.cabinet-slot-trigger {
  width: 100%; height: 38px;
  background: linear-gradient(180deg, #2b2e35 0%, #15161a 100%);
  border: 1.5px solid #4a5160; border-radius: 3px;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; color: var(--gold-bright);
  box-shadow: inset 0 2px 4px #000, 0 2px 5px rgba(0,0,0,0.8);
  transition: all 0.2s;
}
.cabinet-slot-trigger:hover, .cabinet-slot-trigger.active {
  border-color: var(--gold-brass);
  box-shadow: 0 0 14px var(--gold-glow), inset 0 2px 4px #000;
}

.cabinet-slot-recess {
  width: 34px; height: 16px; background: #07080a; border: 1px solid #282a32;
  border-radius: 2px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.slot-shadow-lip {
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(180deg, rgba(0,0,0,0.9), transparent);
}
.slot-brass-pull {
  width: 18px; height: 3.5px;
  background: linear-gradient(180deg, #f0d58e, #cfa85b);
  border-radius: 1px; box-shadow: 0 1px 2px #000;
}
.slot-trigger-label {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: #d6dbe6;
}

/* Open 45° Perspective Mechanical Drawer Chassis */
.drawer-3d-chassis {
  position: absolute; top: 44px; right: 0;
  width: 100%; height: 285px;
  background: linear-gradient(180deg, #202227 0%, #111215 100%);
  border: 2px solid #4a5160; border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.98), 0 10px 25px rgba(0,0,0,0.95);
  display: none; flex-direction: column;
  z-index: 10000;
  transform-origin: top center;
}
.drawer-3d-chassis.active {
  display: flex;
  animation: drawerSlidePerspective 0.62s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
@keyframes drawerSlidePerspective {
  0% { transform: translateY(-24px) rotateX(15deg) scale(0.92); opacity: 0; }
  100% { transform: translateY(0) rotateX(0deg) scale(1); opacity: 1; }
}

/* GLOBAL FLOATING TOOLTIP: Positioned ABOVE the drawer, upright, zero rotation */
.global-drawer-hint {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) rotate(0deg) !important;
  width: 250px;
  background: #0f0c08 !important;
  border: 1.5px solid var(--gold-brass) !important;
  border-radius: 4px;
  padding: 10px 14px !important;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.98), 0 0 25px rgba(207, 168, 91, 0.4) !important;
  z-index: 100000000 !important;
  text-align: left;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.global-drawer-hint::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border-width: 6px; border-style: solid;
  border-color: var(--gold-brass) transparent transparent transparent;
}
.global-drawer-hint.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.hint-kicker {
  font-family: var(--font-mono); font-size: 0.68rem !important;
  color: var(--gold-bright) !important;
  text-transform: uppercase; font-weight: 700; letter-spacing: 0.1em;
  display: block; margin-bottom: 3px;
}
.hint-body {
  font-family: var(--font-editorial); font-size: 0.82rem !important;
  line-height: 1.45 !important;
  color: #f5eedf !important;
  display: block;
}

/* Bulkhead */
.drawer-rear-bulkhead {
  padding: 6px 12px; display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, #16181d, #0d0e12);
  border-bottom: 2px solid #08090b; flex-shrink: 0;
}
.drawer-bulkhead-stamp {
  font-family: var(--font-mono); font-size: 0.54rem; color: var(--gold-bright);
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
}

.metal-tabs-rail {
  display: flex; gap: 4px; background: #0b0c0e; padding: 2px; border-radius: 3px;
  border: 1px solid #282a32;
}
.metal-tab-pill {
  padding: 2px 10px; font-family: var(--font-mono); font-size: 0.56rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: #878f9f;
  background: transparent; border: none; cursor: pointer; border-radius: 2px;
  transition: all 0.2s;
}
.metal-tab-pill.active {
  background: linear-gradient(180deg, #444a57, #22252c);
  color: var(--gold-bright); font-weight: 700; border: 1px solid #5d6577;
}

/* 3D Cavity Walls & Tracks */
.drawer-3d-cavity {
  flex: 1; position: relative; overflow: visible;
  display: flex;
}
.wall-bevel {
  position: absolute; top: 0; bottom: 0; z-index: 10; pointer-events: none;
}
.wall-left {
  left: 0; width: 14px;
  background: linear-gradient(90deg, #2d313a 0%, #15161b 80%, transparent 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
}
.wall-right {
  right: 0; width: 14px;
  background: linear-gradient(-90deg, #2d313a 0%, #15161b 80%, transparent 100%);
  border-left: 1px solid rgba(255,255,255,0.08);
}

.runner-track {
  position: absolute; top: 0; bottom: 36px; width: 3.5px; z-index: 12;
  background: linear-gradient(180deg, #535864 0%, #1d1e22 100%);
  border: 1px solid #0b0c0d;
}
.runner-left { left: 2px; }
.runner-right { right: 2px; }

.slide-rail {
  position: absolute; top: 0; bottom: 36px; width: 8px; z-index: 11;
  display: flex; flex-direction: column; justify-content: space-around; align-items: center;
}
.rail-left { left: 5px; }
.rail-right { right: 5px; }
.bearing-notch {
  width: 4px; height: 4px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #abb5c7, #262930);
  border: 1px solid #000;
}

.top-lip-shadow {
  position: absolute; top: 0; left: 14px; right: 14px; height: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85), transparent);
  pointer-events: none; z-index: 15;
}

/* Recessed Felt Floor - Strict Physical Containment */
.drawer-felt-floor {
  flex: 1;
  margin: 0 14px;
  background: var(--felt-interior);
  border: 1.5px solid #261c13;
  box-shadow: inset 0 10px 28px rgba(0,0,0,0.98), inset 0 0 45px rgba(0,0,0,0.9);
  position: relative;
  overflow: hidden !important;
  contain: paint;
}

/* Strict Tab Separation */
.scatter-shelf {
  position: absolute;
  inset: 0;
  display: none !important;
  pointer-events: none;
  overflow: hidden;
}
.scatter-shelf.active {
  display: block !important;
  pointer-events: auto;
}

/* Drawer Front Faceplate (Mounted to bottom edge) */
.drawer-front-faceplate {
  height: 38px; width: 100%;
  background: linear-gradient(180deg, #3d424e 0%, #252830 50%, #151619 100%);
  border-top: 2px solid #5d6575; border-radius: 0 0 4px 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.92), inset 0 1px 1px rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; flex-shrink: 0;
}
.drawer-faceplate-rim { display: flex; align-items: center; }
.heavy-brass-handle {
  width: 60px; height: 6px;
  background: linear-gradient(180deg, #f0d58e 0%, #cfa85b 45%, #7a5823 100%);
  border: 1px solid #3d280c; border-radius: 2px;
  box-shadow: 0 2px 3px #000, inset 0 1px 0 rgba(255,255,255,0.4);
}
.drawer-faceplate-label {
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: #e4e7f0;
}

/* ==========================================================================
   PURE 3D ISOLATED ARTIFACTS
   ========================================================================== */
.scatter-artifact {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  max-width: 90px;
}
.scatter-artifact.dragging {
  cursor: grabbing !important;
  z-index: 999999 !important;
}

.pure-3d-object {
  display: flex; align-items: center; justify-content: center;
  background: transparent !important; border: none !important;
  box-shadow: none !important; position: relative;
  transform-style: preserve-3d;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.scatter-artifact:hover .pure-3d-object,
.scatter-artifact.active-dwell .pure-3d-object {
  transform: translateY(-8px) scale(1.15) translateZ(25px) !important;
}
.scatter-artifact:hover .artifact-label,
.scatter-artifact.active-dwell .artifact-label {
  color: var(--gold-bright); font-weight: 700;
}

.artifact-label {
  margin-top: 1px; font-family: var(--font-display); font-size: 0.56rem;
  font-weight: 700; letter-spacing: 0.05em; text-align: center; color: #c4cad6;
  text-shadow: 0 1px 3px #000, 0 2px 5px #000; white-space: nowrap; pointer-events: none;
}

/* Master Footer */
footer.archive-vault-footer {
  background: #040302; border-top: 2px solid #140e0a; padding: 45px 1rem 25px; color: var(--paper-aged); width: 100%;
}
.vault-creed {
  max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column;
  gap: 0.6rem; font-family: var(--font-mono); font-size: 0.65rem; color: #63615b;
}
@media (min-width: 768px) { .vault-creed { flex-direction: row; justify-content: space-between; } }

/* Mobile screen constraints */
@media (max-width: 768px) {
  header.evidence-topbar { padding: 0 0.8rem; }
  .drawer-perspective-rig { width: 250px; }
  .slot-trigger-label { display: none; }
  .cabinet-slot-trigger { justify-content: center; }

  .drawer-3d-chassis {
    width: 100%;
    height: 280px;
  }
}