:root {
  /* DESIGN FONT TOKENS: IBM Plex Mono** only for archive IDs */
  --obsidian: #050403;
  --nero: #11100D;
  --gold: #C8A24A;
  --brass: #8C6A2F;
  --ivory: #F0E4C8;
  --smoke: #6F6A60;
  --burgundy: #5A171A;
  --sidebar: clamp(210px, 21vw, 330px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ivory);
  background: var(--obsidian);
  font-family: "Libre Franklin", Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 18%, rgba(200, 162, 74, .13), transparent 24%),
    radial-gradient(circle at 58% 65%, rgba(90, 23, 26, .18), transparent 28%),
    linear-gradient(115deg, #050403 0%, #11100D 58%, #050403 100%);
  z-index: -4;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .26;
  mix-blend-mode: screen;
  background-image:
    repeating-radial-gradient(circle at 17% 33%, rgba(240, 228, 200, .09) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(91deg, transparent 0 6px, rgba(200, 162, 74, .025) 6px 7px);
}

.marble-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: .34;
  filter: blur(.2px);
  background:
    linear-gradient(112deg, transparent 0 36%, rgba(240, 228, 200, .22) 36.2%, transparent 36.8%),
    linear-gradient(128deg, transparent 0 57%, rgba(111, 106, 96, .22) 57.2%, transparent 57.9%),
    linear-gradient(72deg, transparent 0 69%, rgba(200, 162, 74, .12) 69.1%, transparent 69.5%);
  transform: translate3d(var(--mx, 0), var(--my, 0), 0);
  transition: transform .6s ease;
}

.archive-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 10;
  background:
    linear-gradient(90deg, rgba(5, 4, 3, .98), rgba(17, 16, 13, .86)),
    linear-gradient(180deg, transparent, rgba(200, 162, 74, .08), transparent);
  border-right: 1px solid rgba(200, 162, 74, .34);
  padding: 30px 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.archive-sidebar::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold), var(--brass), transparent);
  box-shadow: 0 0 22px rgba(200, 162, 74, .38);
}

.sidebar-top { font-family: "IBM Plex Mono", monospace; color: var(--smoke); font-size: 10px; letter-spacing: .16em; line-height: 1.8; }
.sidebar-top span { display: block; }

.wordmark {
  align-self: center;
  text-decoration: none;
  color: var(--ivory);
  font-family: "Bebas Neue", "Arial Narrow", sans-serif;
  font-size: clamp(58px, 8.2vw, 124px);
  line-height: .76;
  letter-spacing: -.035em;
  text-transform: uppercase;
  transform: translateX(-8px);
  text-shadow: 0 0 30px rgba(240, 228, 200, .08);
}

.wordmark span { display: block; max-width: 1.8em; overflow: hidden; }

.chapter-nav {
  position: absolute;
  right: -98px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 22px;
}

.rewind-track {
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(111, 106, 96, .38);
}

.rewind-track span {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 0%;
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold);
}

.chapter-tick {
  position: relative;
  display: grid;
  grid-template-columns: 20px 34px 80px;
  align-items: center;
  gap: 12px;
  color: var(--smoke);
  text-decoration: none;
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
}

.chapter-tick span {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1px solid rgba(200, 162, 74, .5);
  background: var(--nero);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .8);
}

.chapter-tick em { font-style: normal; font-family: "IBM Plex Mono", monospace; }
.chapter-tick strong { font-weight: 600; }
.chapter-tick.active { color: var(--ivory); }
.chapter-tick.active span { background: radial-gradient(circle, var(--ivory), var(--gold) 38%, var(--brass) 70%, var(--nero)); box-shadow: 0 0 22px rgba(200, 162, 74, .85); }

.sidebar-command {
  align-self: end;
  width: max-content;
  padding: 10px 12px;
  color: var(--nero);
  background: var(--ivory);
  border-left: 5px solid var(--burgundy);
  font-family: Oswald, sans-serif;
  font-size: 12px;
  letter-spacing: .18em;
  transform: rotate(-2deg);
}

.dossier { margin-left: var(--sidebar); }

.room {
  position: relative;
  min-height: 100vh;
  padding: clamp(70px, 8vw, 120px) clamp(34px, 6vw, 92px);
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.room::before {
  content: attr(data-chapter);
  position: absolute;
  right: -1vw;
  top: 2vh;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(180px, 28vw, 420px);
  line-height: .8;
  color: rgba(240, 228, 200, .035);
  z-index: -1;
}

.room-index {
  position: absolute;
  top: 36px;
  left: clamp(34px, 6vw, 92px);
  color: var(--smoke);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .16em;
}

.image-well {
  position: absolute;
  width: min(48vw, 690px);
  height: min(66vh, 680px);
  right: clamp(20px, 6vw, 110px);
  top: 16vh;
  background-color: var(--nero);
  border: 1px solid rgba(200, 162, 74, .22);
  box-shadow: 0 44px 120px rgba(0, 0, 0, .55), inset 0 0 0 18px rgba(5, 4, 3, .34);
  filter: blur(10px) sepia(.65) grayscale(.8) brightness(.62);
  clip-path: inset(4% 7% 8% 2%);
  transform: translateY(38px) scale(1.04);
  transition: filter 1.5s ease, transform 1.5s ease, clip-path 1.5s ease;
}

.room.active .image-well { filter: blur(1.2px) sepia(.55) grayscale(.72) brightness(.82); transform: translateY(0) scale(1); clip-path: inset(0 0 0 0); }

.image-well::before, .image-well::after { content: ""; position: absolute; inset: 0; }
.image-well::after { background: radial-gradient(circle at 50% 42%, transparent 0 24%, rgba(5, 4, 3, .3) 55%, rgba(5, 4, 3, .86) 100%); }

.lobby-photo::before { background: linear-gradient(90deg, rgba(240, 228, 200, .16), transparent 18% 80%, rgba(0,0,0,.6)), repeating-linear-gradient(90deg, rgba(240,228,200,.17) 0 8px, rgba(5,4,3,.5) 8px 15px, transparent 15px 54px), linear-gradient(160deg, #6F6A60, #11100D 42%, #050403); }
.machine-photo::before { background: radial-gradient(circle at 62% 44%, rgba(240,228,200,.38) 0 8%, transparent 9%), repeating-radial-gradient(circle at 62% 44%, transparent 0 26px, rgba(200,162,74,.18) 27px 29px), linear-gradient(145deg, #11100D, #6F6A60 48%, #050403); }
.hand-photo::before { background: linear-gradient(115deg, transparent 0 36%, rgba(240,228,200,.25) 37% 46%, transparent 47%), repeating-linear-gradient(0deg, rgba(240,228,200,.08) 0 12px, transparent 12px 32px), linear-gradient(140deg, #050403, #6F6A60, #11100D); }
.bust-photo::before { background: radial-gradient(ellipse at 48% 35%, rgba(240,228,200,.52) 0 13%, rgba(111,106,96,.34) 14% 24%, transparent 25%), linear-gradient(90deg, transparent 44%, rgba(240,228,200,.16) 45% 52%, transparent 53%), linear-gradient(155deg, #050403, #6F6A60 50%, #11100D); }
.corridor-photo::before { background: repeating-linear-gradient(90deg, rgba(240,228,200,.12) 0 2px, transparent 2px 76px), linear-gradient(90deg, #050403, #6F6A60 50%, #050403), radial-gradient(circle at 50% 35%, rgba(200,162,74,.2), transparent 30%); }

.photo-smoke { position: absolute; inset: -12%; background: radial-gradient(circle at 44% 35%, rgba(240, 228, 200, .13), transparent 24%), linear-gradient(90deg, rgba(5,4,3,.7), transparent, rgba(5,4,3,.5)); z-index: 2; backdrop-filter: blur(2px); }

.vellum-label, .inventory-tag {
  position: absolute;
  z-index: 3;
  bottom: 34px;
  left: 30px;
  padding: 12px 16px;
  background: rgba(240, 228, 200, .74);
  color: var(--nero);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.wax-seal {
  position: absolute;
  z-index: 4;
  right: 16%;
  top: 32%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #5A171A, #321012);
  color: var(--ivory);
  font-family: Oswald, sans-serif;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: 0 0 34px rgba(90, 23, 26, .7);
}

.marble-plinth {
  position: absolute;
  right: 9vw;
  bottom: 10vh;
  width: min(42vw, 610px);
  height: 110px;
  background: linear-gradient(104deg, rgba(240,228,200,.95), rgba(111,106,96,.42), rgba(240,228,200,.82));
  box-shadow: 0 32px 60px rgba(0, 0, 0, .46);
  transform: translateX(80px);
  opacity: .45;
  transition: transform 1.2s ease .18s, opacity 1.2s ease .18s;
}

.marble-plinth::before { content: ""; position: absolute; inset: 0; background: linear-gradient(128deg, transparent 25%, rgba(5,4,3,.28) 26%, transparent 29%), linear-gradient(70deg, transparent 64%, rgba(5,4,3,.22) 65%, transparent 67%); }
.room.active .marble-plinth { transform: translateX(0); opacity: .84; }
.fractured { display: flex; gap: 8px; background: none; box-shadow: none; }
.fractured span { flex: 1; background: linear-gradient(104deg, rgba(240,228,200,.95), rgba(111,106,96,.42)); transform: translateY(var(--shift, 0)); }
.fractured span:nth-child(2) { --shift: -22px; }
.fractured span:nth-child(3) { --shift: 15px; }

.gold-line {
  position: absolute;
  height: 1px;
  width: 0;
  left: 0;
  top: 48%;
  background: linear-gradient(90deg, var(--gold), transparent);
  box-shadow: 0 0 18px rgba(200, 162, 74, .62);
  transition: width 1.4s ease .05s;
}
.room.active .gold-line { width: 72%; }
.line-b { top: 37%; transform: rotate(-3deg); background: linear-gradient(90deg, var(--gold), var(--burgundy), transparent); }
.line-c { top: 62%; transform: rotate(2deg); }

.room-copy {
  position: relative;
  z-index: 3;
  max-width: 620px;
  filter: blur(9px);
  opacity: .32;
  transform: translateY(36px);
  transition: filter 1.2s ease .35s, opacity 1.2s ease .35s, transform 1.2s ease .35s;
}
.room.active .room-copy { filter: blur(0); opacity: 1; transform: translateY(0); }
.room-copy.narrow { max-width: 540px; margin-left: 7vw; }
.room-copy.wide { max-width: 760px; }
.room-copy.final { margin-left: 10vw; }

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-family: Oswald, sans-serif;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: "Bebas Neue", "Arial Narrow", sans-serif;
  font-size: clamp(72px, 12.2vw, 178px);
  line-height: .78;
  letter-spacing: -.035em;
  text-transform: uppercase;
  color: var(--ivory);
  text-wrap: balance;
}

.room-copy p:not(.eyebrow) {
  width: min(520px, 88%);
  margin: 28px 0 0;
  color: rgba(240, 228, 200, .78);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.72;
}

.film-stack { position: absolute; right: 12vw; top: 12vh; width: 46vw; height: 70vh; z-index: 1; }
.film-stack span { position: absolute; inset: calc(var(--i, 0) * 22px); border: 1px solid rgba(200, 162, 74, .18); background: rgba(17,16,13,.42); transform: translateX(70px); transition: transform 1.4s ease; }
.film-stack span:nth-child(1) { --i: 0; }
.film-stack span:nth-child(2) { --i: 1; }
.film-stack span:nth-child(3) { --i: 2; }
.film-stack span:nth-child(4) { --i: 3; }
.room.active .film-stack span { transform: translateX(calc(var(--i) * -28px)); }

.vein-map { position: absolute; inset: 18vh 8vw 18vh auto; width: 44vw; z-index: 2; opacity: .8; }
.vein-map span { position: absolute; width: 86%; height: 1px; background: linear-gradient(90deg, transparent, var(--ivory), transparent); transform-origin: left; filter: drop-shadow(0 0 8px rgba(240,228,200,.35)); }
.vein-map span:nth-child(1) { top: 24%; transform: rotate(18deg); }
.vein-map span:nth-child(2) { top: 52%; transform: rotate(-11deg); background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.vein-map span:nth-child(3) { top: 68%; transform: rotate(33deg); }

.final-glint { position: absolute; left: 16%; top: 18%; width: 1px; height: 58vh; background: linear-gradient(180deg, transparent, var(--gold), transparent); box-shadow: 0 0 28px rgba(200,162,74,.65); }

.paper-command {
  display: inline-block;
  margin-top: 34px;
  padding: 16px 22px;
  color: var(--nero);
  background: var(--ivory);
  border-left: 7px solid var(--burgundy);
  text-decoration: none;
  font-family: Oswald, sans-serif;
  font-weight: 700;
  letter-spacing: .18em;
  transform: rotate(-1deg);
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  .archive-sidebar { width: 100%; height: 94px; min-height: 0; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr; padding: 14px 18px; border-right: 0; border-bottom: 1px solid rgba(200,162,74,.34); }
  .archive-sidebar::after { left: 16px; right: 16px; top: auto; bottom: 12px; width: auto; height: 1px; }
  .sidebar-top, .sidebar-command { display: none; }
  .wordmark { align-self: start; font-size: 42px; line-height: .82; transform: none; }
  .wordmark span { display: inline; max-width: none; }
  .chapter-nav { position: static; transform: none; align-self: center; justify-self: end; display: flex; gap: 12px; }
  .chapter-tick { grid-template-columns: 18px; gap: 0; }
  .chapter-tick em, .chapter-tick strong, .rewind-track { display: none; }
  .dossier { margin-left: 0; padding-top: 94px; }
  .room { padding: 84px 24px 70px; align-items: end; }
  .image-well { width: 86vw; height: 48vh; right: 4vw; top: 18vh; }
  .marble-plinth { width: 76vw; right: 8vw; bottom: 16vh; height: 72px; }
  .room-copy, .room-copy.narrow, .room-copy.final { margin-left: 0; }
  h1, h2 { font-size: clamp(64px, 19vw, 116px); }
  .room-copy p:not(.eyebrow) { width: 100%; }
}
