:root {
  --walnut: #21130D;
  --parchment: #F1D8A8;
  --wax: #7A2F1B;
  --green: #146B58;
  --green-soft: #2F8F83;
  --violet: #7B4DFF;
  --brass: #E7B84A;
  --midnight: #0E1A2D;
  --ink: #26160f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Libre Baskerville", Georgia, serif;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 14%, rgba(123, 77, 255, .25), transparent 28%),
    radial-gradient(circle at 62% 82%, rgba(20, 107, 88, .35), transparent 34%),
    linear-gradient(115deg, #120a07 0%, var(--walnut) 48%, var(--midnight) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image:
    linear-gradient(90deg, rgba(231, 184, 74, .04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 34px 34px, 7px 7px;
  mix-blend-mode: screen;
}

.archive-shell {
  display: grid;
  grid-template-columns: minmax(270px, 24vw) 1fr;
  height: 100vh;
}

.catalog {
  position: relative;
  z-index: 5;
  padding: 24px 18px 28px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.42), transparent 9%, rgba(231,184,74,.09) 10%, transparent 12%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 2px, transparent 2px 10px),
    linear-gradient(145deg, #301910, var(--walnut) 54%, #0d0604);
  border-right: 7px solid #120805;
  box-shadow: 22px 0 42px rgba(0,0,0,.58), inset -18px 0 20px rgba(0,0,0,.36);
}

.catalog::after {
  content: "";
  position: absolute;
  top: 0;
  right: 18px;
  width: 10px;
  height: 100%;
  background: linear-gradient(90deg, #8c5c25, var(--brass), #5c3915);
  box-shadow: inset 1px 0 rgba(255,255,255,.35), 0 0 14px rgba(231,184,74,.3);
}

.catalog-top {
  position: relative;
  min-height: 130px;
  padding: 18px 16px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(14,26,45,.36), rgba(0,0,0,.22)), #2b150d;
  box-shadow: inset 0 0 24px rgba(0,0,0,.56), 0 10px 18px rgba(0,0,0,.32);
  border: 1px solid rgba(231,184,74,.22);
}

.brass-hinge {
  width: 96px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(#fff3a8, var(--brass) 38%, #6b4216 78%, #fff0a0);
  box-shadow: 0 2px 0 #39200d, 0 0 18px rgba(231,184,74,.34);
  animation: brassGlint 5.5s infinite;
}

.case-label, .drawer strong, .drawer em, .tiny-label, .verdict-frag, .folio, .notice-slip, .brass-clasp, .burn-mark, .plant-label {
  font-family: "Special Elite", Courier, monospace;
}

.case-label {
  color: var(--brass);
  font-size: 12px;
  margin: 18px 0 4px;
  letter-spacing: .08em;
}

.catalog h2 {
  margin: 0;
  color: var(--parchment);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(32px, 3vw, 48px);
  line-height: .9;
}

.drawer-list { display: grid; gap: 12px; }

.drawer {
  position: relative;
  min-height: 76px;
  padding: 12px 48px 12px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--parchment);
  border: 1px solid rgba(231,184,74,.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 87% 50%, var(--brass) 0 7px, #4c2d12 8px 13px, transparent 14px),
    linear-gradient(180deg, rgba(255,255,255,.07), transparent 44%),
    linear-gradient(105deg, #3a1e12, #180b07);
  box-shadow: inset 0 3px 8px rgba(255,255,255,.05), inset 0 -8px 18px rgba(0,0,0,.45), 0 8px 15px rgba(0,0,0,.34);
  transition: transform .55s ease, border-color .55s ease, box-shadow .55s ease;
}

.drawer span {
  color: var(--brass);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  float: left;
  width: 42px;
}

.drawer strong { display: block; font-size: 13px; letter-spacing: .08em; }
.drawer em { display: block; margin-top: 6px; color: rgba(241,216,168,.74); font-size: 11px; font-style: normal; }

.drawer.active {
  transform: translateX(12px);
  border-color: var(--green);
  box-shadow: inset 0 0 22px rgba(20,107,88,.25), 0 0 24px rgba(123,77,255,.22), 0 12px 18px rgba(0,0,0,.45);
}

.drawer:hover { transform: translateX(8px); border-color: var(--brass); }

.ribbon {
  position: absolute;
  right: 31px;
  top: 164px;
  width: 34px;
  height: 180px;
  padding-top: 18px;
  color: #f7d9c8;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
  font: 10px "Special Elite", monospace;
  letter-spacing: .16em;
  background: linear-gradient(90deg, #4c160d, var(--wax), #2a0a06);
  box-shadow: 0 8px 18px rgba(0,0,0,.42), inset 2px 0 rgba(255,255,255,.12);
  transition: transform .55s ease;
}

.ribbon::after {
  content: "";
  position: absolute;
  bottom: -24px;
  left: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-top: 24px solid #4c160d;
}

.drawer-collage {
  position: absolute;
  left: 24px;
  right: 42px;
  bottom: 24px;
  height: 112px;
  padding: 14px;
  transform: rotate(-2deg);
  background: rgba(241,216,168,.82);
  box-shadow: 0 12px 22px rgba(0,0,0,.43), inset 0 0 18px rgba(122,47,27,.25);
}

.witness-eye {
  width: 74px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--violet) 0 8px, var(--midnight) 9px 12px, #ead09e 13px);
  box-shadow: 0 0 20px rgba(123,77,255,.45);
}

.tiny-label, .verdict-frag { display: block; margin-top: 10px; color: var(--walnut); font-size: 12px; }
.verdict-frag { color: var(--wax); text-decoration: line-through; transform: rotate(3deg); }

.desk {
  position: relative;
  height: 100vh;
  overflow: hidden;
  padding: clamp(30px, 5vw, 72px);
  background:
    radial-gradient(ellipse at 45% 45%, rgba(231,184,74,.08), transparent 48%),
    linear-gradient(125deg, rgba(33,19,13,.8), rgba(14,26,45,.86));
}

.aurora-underpage {
  position: absolute;
  inset: 11% 8% 9% 9%;
  filter: blur(28px);
  opacity: .58;
  background: linear-gradient(135deg, #146B58 0%, #2F8F83 34%, #7B4DFF 68%, #E7B84A 100%);
  transform: rotate(-7deg);
  animation: auroraBreathe 8s ease-in-out infinite;
}

.scene {
  position: absolute;
  inset: clamp(28px, 5vw, 70px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(80px) rotate(2deg) scale(.98);
  transition: opacity .65s ease, transform .8s cubic-bezier(.2,.8,.25,1);
}

.scene.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) rotate(0) scale(1);
}

.paper {
  position: relative;
  width: min(760px, 82%);
  min-height: min(680px, 76vh);
  padding: clamp(34px, 5vw, 66px);
  background:
    radial-gradient(circle at 24% 28%, rgba(122,47,27,.12), transparent 17%),
    radial-gradient(circle at 78% 64%, rgba(20,107,88,.12), transparent 18%),
    repeating-linear-gradient(2deg, rgba(33,19,13,.035) 0 1px, transparent 1px 7px),
    var(--parchment);
  border: 1px solid rgba(231,184,74,.58);
  box-shadow: 0 34px 54px rgba(0,0,0,.55), inset 0 0 0 7px rgba(122,47,27,.08), inset 0 0 40px rgba(33,19,13,.18);
}

.paper::before, .paper::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.paper::before {
  inset: 10px;
  border: 1px solid rgba(122,47,27,.28);
}

.paper::after {
  right: -1px;
  bottom: -1px;
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, transparent 48%, rgba(92,54,25,.42) 49%, rgba(255,240,190,.45) 52%, #d4b77a 100%);
  box-shadow: -8px -8px 18px rgba(0,0,0,.12);
}

.angled-left { transform: rotate(-2.2deg); }
.angled-right { transform: rotate(2deg); }

.folio {
  color: var(--wax);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2 {
  margin: 12px 0 18px;
  color: var(--walnut);
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: .88;
}

h1 { font-size: clamp(62px, 9vw, 124px); letter-spacing: -.05em; }
h2 { font-size: clamp(48px, 6vw, 86px); }

.subtitle, .quote {
  max-width: 620px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.05;
  color: #3a2116;
}

.transcript p, .paper > p:not(.subtitle):not(.quote):not(.marginalia) {
  max-width: 620px;
  font-size: 16px;
  line-height: 1.75;
}

.dropcap {
  float: left;
  font: 700 74px/.72 "Cormorant Garamond", Georgia, serif;
  padding-right: 9px;
  color: var(--wax);
}

.wax-seal {
  position: absolute;
  right: 78px;
  top: 98px;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  color: #f2b9a0;
  border-radius: 47% 54% 50% 44%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,.2), transparent 16%),
    radial-gradient(circle at 66% 72%, #4d120a, transparent 28%),
    var(--wax);
  box-shadow: inset 8px 8px 18px rgba(255,255,255,.1), inset -10px -12px 18px rgba(0,0,0,.32), 0 12px 22px rgba(0,0,0,.35);
  font: 700 24px "Cormorant Garamond", serif;
  animation: sealPulse 4.6s ease-in-out infinite;
}

.marginalia {
  font-family: "Homemade Apple", cursive;
  color: var(--green);
  font-size: 20px;
  transform: rotate(-4deg);
}

.red-note { color: var(--wax); }

.notice-slip {
  position: absolute;
  right: 10%;
  bottom: 10%;
  width: 220px;
  padding: 18px;
  transform: rotate(8deg);
  background: #dec38d;
  border: 2px dashed rgba(122,47,27,.52);
  box-shadow: 0 16px 26px rgba(0,0,0,.36);
}

.notice-slip b { display: block; color: var(--wax); margin-bottom: 8px; }
.notice-slip span { font-size: 12px; }

.slip-stack { position: relative; min-height: 310px; margin-top: 22px; }
.witness-slip {
  position: absolute;
  width: min(430px, 86%);
  padding: 22px;
  background: rgba(245,225,180,.92);
  border-left: 8px solid var(--brass);
  box-shadow: 0 14px 23px rgba(0,0,0,.26), inset 0 0 15px rgba(122,47,27,.14);
}
.witness-slip:nth-child(1) { left: 20px; top: 0; transform: rotate(-5deg); }
.witness-slip:nth-child(2) { left: 90px; top: 86px; transform: rotate(3deg); }
.witness-slip:nth-child(3) { left: 42px; top: 176px; transform: rotate(-1deg); border-left-color: var(--green); }
.witness-slip span { font-family: "Special Elite", monospace; color: var(--wax); }

.ink-heart {
  position: absolute;
  left: 18%;
  bottom: 16%;
  width: 74px;
  height: 54px;
  border-radius: 52% 45% 48% 53%;
  background: radial-gradient(circle, var(--green), #10231d 72%);
  filter: blur(.4px);
  opacity: .72;
  animation: inkBeat 2.7s infinite;
}

.botanical-board {
  position: relative;
  min-height: 350px;
  margin-top: 26px;
  border: 1px solid rgba(122,47,27,.24);
  background: rgba(255,255,255,.12);
}

.pressed-leaf {
  position: absolute;
  width: 32px;
  height: 150px;
  border-radius: 80% 20% 80% 20%;
  background: linear-gradient(90deg, #4d6832, #829b51, #31451f);
  box-shadow: 0 0 0 1px rgba(33,19,13,.12), 0 10px 16px rgba(0,0,0,.2);
  opacity: .78;
}
.leaf-one { left: 18%; top: 70px; transform: rotate(-24deg); }
.leaf-two { left: 45%; top: 35px; transform: rotate(11deg); height: 210px; }
.leaf-three { left: 67%; top: 112px; transform: rotate(38deg); height: 130px; }
.thread { position: absolute; height: 2px; background: var(--wax); transform-origin: left; box-shadow: 0 0 5px rgba(122,47,27,.35); }
.thread-a { width: 430px; left: 70px; top: 134px; transform: rotate(16deg); }
.thread-b { width: 330px; left: 160px; top: 247px; transform: rotate(-11deg); }
.plant-label { position: absolute; right: 22px; bottom: 18px; color: var(--wax); }

.sky-chart {
  color: #d7e8dc;
  background:
    radial-gradient(circle at 23% 24%, rgba(123,77,255,.26), transparent 18%),
    linear-gradient(135deg, rgba(20,107,88,.42) 0%, rgba(47,143,131,.24) 34%, rgba(123,77,255,.38) 68%, rgba(231,184,74,.24) 100%),
    var(--midnight);
  border-color: rgba(123,77,255,.48);
}
.sky-chart h2, .sky-chart .folio, .sky-chart p { color: #ecdec2; }
.moon-row { display: flex; gap: 28px; margin-top: 38px; }
.moon-row i { width: 44px; height: 44px; border-radius: 50%; background: #f1d8a8; box-shadow: inset -14px 0 0 rgba(14,26,45,.65), 0 0 18px rgba(231,184,74,.42); }
.constellation { position: absolute; inset: 34% 20% 18% 18%; }
.constellation span { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 24px var(--green); animation: starThrob 3s infinite; }
.constellation span:nth-child(1) { left: 12%; top: 12%; }
.constellation span:nth-child(2) { left: 42%; top: 30%; animation-delay: .4s; }
.constellation span:nth-child(3) { left: 60%; top: 7%; animation-delay: .9s; }
.constellation span:nth-child(4) { left: 76%; top: 54%; animation-delay: 1.2s; }
.constellation span:nth-child(5) { left: 28%; top: 70%; animation-delay: 1.6s; }
.apparition { position: absolute; right: 8%; bottom: 14%; color: rgba(255,255,255,.16); font: 700 110px "Cormorant Garamond", serif; }

.brass-clasp {
  width: 260px;
  padding: 17px;
  margin-top: 40px;
  background: linear-gradient(#fff1a5, var(--brass), #624015);
  box-shadow: inset 0 1px rgba(255,255,255,.6), 0 12px 18px rgba(0,0,0,.26);
  color: #3c240d;
}
.burn-mark {
  position: absolute;
  right: 74px;
  bottom: 88px;
  width: 180px;
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 48%;
  background: radial-gradient(circle, rgba(122,47,27,.45), rgba(33,19,13,.18) 58%, transparent 72%);
  color: rgba(33,19,13,.58);
}

del { color: var(--wax); text-decoration-thickness: 4px; }
ins { color: var(--green); text-decoration-color: var(--violet); }
.vellum-note {
  margin-top: 34px;
  padding: 28px;
  width: min(560px, 90%);
  background: rgba(255,255,255,.33);
  border: 1px solid rgba(123,77,255,.4);
  box-shadow: 0 0 30px rgba(20,107,88,.22), inset 0 0 30px rgba(255,255,255,.18);
  font: 24px/1.45 "Cormorant Garamond", serif;
}
.writing-note { width: 0; white-space: nowrap; overflow: hidden; animation: writeNote 4.8s steps(34) infinite alternate; }

@keyframes sealPulse { 0%,100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.045); filter: brightness(1.16); } }
@keyframes brassGlint { 0%,100% { filter: brightness(.88); } 45% { filter: brightness(1.35); } }
@keyframes auroraBreathe { 0%,100% { opacity: .38; transform: rotate(-7deg) scale(.96); } 50% { opacity: .72; transform: rotate(-4deg) scale(1.04); } }
@keyframes inkBeat { 0%,100% { transform: scale(.9); opacity: .46; } 45% { transform: scale(1.15); opacity: .82; } }
@keyframes starThrob { 0%,100% { transform: scale(.82); opacity: .5; } 50% { transform: scale(1.3); opacity: 1; } }
@keyframes writeNote { from { width: 0; } to { width: 520px; } }

@media (max-width: 860px) {
  body { overflow: auto; }
  .archive-shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .catalog { position: relative; min-height: 620px; }
  .desk { min-height: 880px; }
  .scene { inset: 24px; }
  .paper { width: 94%; padding: 28px; }
  .wax-seal { right: 34px; top: 82px; width: 78px; height: 78px; }
}
