:root {
  /* Typography compliance notes: Inter** practical explanatory JetBrains Mono** tiny */
  --ink-black: #17120E;
  --oxide-brown: #3A2418;
  --lamp-amber: #D69A45;
  --vellum-cream: #F1DDAD;
  --garnet-wine: #74312F;
  --smoked-quartz: #8E7A62;
  --crystal-blue-gray: #9FB6BA;
  --jost: "Jost", "Futura", sans-serif;
  --cormorant: "Cormorant Garamond", serif;
  --inter: "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-black);
  color: var(--vellum-cream);
  font-family: var(--inter);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(214, 154, 69, .16), transparent 28rem),
    radial-gradient(circle at 78% 42%, rgba(116, 49, 47, .18), transparent 30rem),
    linear-gradient(135deg, #17120E 0%, #241711 48%, #0e0b09 100%);
  z-index: -4;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: .18;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(241, 221, 173, .18) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(98deg, rgba(159, 182, 186, .05) 0 1px, transparent 1px 7px);
  mix-blend-mode: soft-light;
}

.cursor-glow {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: .42;
  filter: blur(38px);
  background: radial-gradient(circle, rgba(214, 154, 69, .18), rgba(116, 49, 47, .07) 42%, transparent 68%);
  transform: translate3d(-50%, -50%, 0);
}

.shelf-ribbon {
  position: fixed;
  left: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .8rem .55rem;
  border-left: 1px solid rgba(214, 154, 69, .35);
  background: rgba(23, 18, 14, .42);
  backdrop-filter: blur(16px);
}

.shelf-link {
  color: var(--smoked-quartz);
  text-decoration: none;
  font-family: var(--jost);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .7rem;
  writing-mode: vertical-rl;
  transition: color .5s ease, transform .5s ease;
}

.shelf-link span {
  font-family: var(--mono);
  color: var(--garnet-wine);
}

.shelf-link.active, .shelf-link:hover {
  color: var(--lamp-amber);
  transform: translateX(.18rem);
}

.reading-room { position: relative; }

.scene {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.4rem;
  padding: clamp(5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 5rem) clamp(4rem, 7vw, 7rem) clamp(4rem, 8vw, 8rem);
  overflow: hidden;
  isolation: isolate;
}

.scene::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% -10%;
  height: 22rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(214, 154, 69, .12), transparent 62%);
  filter: blur(18px);
  z-index: -1;
}

.shelf-mark, .note-tag {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lamp-amber);
}

h1, h2 {
  font-family: var(--jost);
  margin: 0;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .9;
}

h1 { font-size: clamp(4.5rem, 13vw, 12rem); }
h2 { font-size: clamp(3rem, 7vw, 7.5rem); }

p { line-height: 1.75; color: rgba(241, 221, 173, .78); }

.hero-scene { align-items: center; }

.lamp-pool {
  position: absolute;
  width: 58vw;
  height: 58vw;
  min-width: 34rem;
  min-height: 34rem;
  left: 36%;
  top: 3%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 221, 173, .22), rgba(214, 154, 69, .18) 25%, rgba(58, 36, 24, .12) 54%, transparent 72%);
  filter: blur(22px);
  animation: lampBreath 8s ease-in-out infinite alternate;
  z-index: -2;
}

.table-arc {
  position: absolute;
  inset: 18% -10% auto 8%;
  height: 42rem;
  border-radius: 50%;
  border: 1px solid rgba(142, 122, 98, .22);
  transform: rotate(-8deg);
  z-index: -3;
}

.hero-copy {
  grid-column: 2 / span 6;
  z-index: 2;
}

.quiet-line {
  font-family: var(--cormorant);
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-style: italic;
  color: var(--lamp-amber);
  margin: .3rem 0 1rem;
}

.body-lead {
  max-width: 34rem;
  font-size: 1.1rem;
}

.crystal-stage {
  grid-column: 8 / span 4;
  position: relative;
  min-height: 32rem;
  filter: blur(10px);
  opacity: .45;
  transform: rotate(7deg) scale(.95);
  transition: filter 1.5s ease, opacity 1.5s ease, transform 1.5s ease;
}

.scene.active .crystal-stage, .scene.active .reveal-crystal {
  filter: blur(0);
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.crystal-svg {
  width: min(39vw, 32rem);
  max-width: 100%;
  filter: drop-shadow(0 0 38px rgba(214, 154, 69, .22));
}

.specimen-label {
  position: absolute;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--crystal-blue-gray);
  border-top: 1px solid rgba(159, 182, 186, .5);
  padding-top: .35rem;
}

.label-top { top: 11%; right: 8%; }
.label-side { bottom: 23%; left: -5%; }

.vellum-card, .paper-fragment, .annotation-card, .passed-note, .invitation-card {
  background:
    linear-gradient(135deg, rgba(241, 221, 173, .16), rgba(241, 221, 173, .06)),
    repeating-linear-gradient(0deg, rgba(58, 36, 24, .14) 0 1px, transparent 1px 16px);
  border: 1px solid rgba(241, 221, 173, .2);
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, .35);
  backdrop-filter: blur(18px);
}

.hero-note {
  grid-column: 7 / span 3;
  align-self: end;
  padding: 1.4rem;
  transform: rotate(-6deg) translateY(4rem);
}

.gather-scene { align-items: center; }

.wandering-band {
  position: absolute;
  width: 120%;
  height: 16rem;
  left: -12%;
  top: 35%;
  background: linear-gradient(90deg, transparent, rgba(214, 154, 69, .09), rgba(159, 182, 186, .07), transparent);
  filter: blur(22px);
  transform: rotate(-13deg);
}

.paper-fragment {
  grid-column: 2 / span 5;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  clip-path: polygon(3% 0, 95% 4%, 100% 88%, 10% 100%, 0 18%);
  transform: rotate(-3deg);
}

.aside-quote {
  grid-column: 8 / span 4;
  font-family: var(--cormorant);
  font-style: italic;
  font-size: clamp(2rem, 4vw, 4.5rem);
  color: var(--vellum-cream);
  line-height: 1.05;
  margin: 0;
}

.reason-stones span {
  position: absolute;
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, rgba(214,154,69,.3), rgba(116,49,47,.22));
  clip-path: polygon(50% 0, 100% 35%, 82% 100%, 18% 100%, 0 35%);
  filter: blur(.2px) drop-shadow(0 0 22px rgba(214, 154, 69, .16));
}

.reason-stones span:nth-child(1) { left: 68%; top: 20%; transform: rotate(19deg); }
.reason-stones span:nth-child(2) { left: 82%; top: 66%; transform: rotate(-12deg) scale(.72); }
.reason-stones span:nth-child(3) { left: 18%; top: 77%; transform: rotate(41deg) scale(.55); }
.reason-stones span:nth-child(4) { left: 51%; top: 54%; transform: rotate(-31deg) scale(.45); background: rgba(159,182,186,.18); }

.margin-note {
  position: absolute;
  font-family: var(--cormorant);
  font-style: italic;
  color: var(--smoked-quartz);
  font-size: 1.4rem;
}

.note-a { left: 58%; top: 18%; transform: rotate(8deg); }
.note-b { left: 14%; bottom: 16%; transform: rotate(-9deg); }

.specimen-scene { align-items: center; }

.connector-map {
  position: absolute;
  inset: 8% 4%;
  width: 92%;
  height: 84%;
  z-index: -1;
  opacity: .55;
}

.connector-map path, .connector-map circle {
  fill: none;
  stroke: var(--smoked-quartz);
  stroke-width: 1;
  stroke-dasharray: 7 9;
}

.connector-map circle { fill: var(--lamp-amber); stroke: none; }

.specimen-copy { grid-column: 2 / span 5; }

.faceted-diagram {
  grid-column: 7 / span 5;
  position: relative;
  min-height: 34rem;
  filter: blur(9px);
  opacity: .45;
  transition: filter 1.2s ease, opacity 1.2s ease, transform 1.2s ease;
}

.facet {
  position: absolute;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--vellum-cream);
  background: linear-gradient(135deg, rgba(214, 154, 69, .26), rgba(159, 182, 186, .12), rgba(116, 49, 47, .25));
  border: 1px solid rgba(241, 221, 173, .24);
  clip-path: polygon(50% 0, 100% 28%, 88% 84%, 30% 100%, 0 56%, 12% 18%);
}

.f1 { width: 16rem; height: 13rem; left: 30%; top: 5%; }
.f2 { width: 15rem; height: 12rem; left: 6%; top: 29%; transform: rotate(-18deg); }
.f3 { width: 18rem; height: 15rem; left: 42%; top: 31%; transform: rotate(12deg); }
.f4 { width: 12rem; height: 10rem; left: 24%; top: 61%; transform: rotate(31deg); }
.f5 { width: 10rem; height: 9rem; left: 68%; top: 66%; transform: rotate(-11deg); background: rgba(159, 182, 186, .18); }

.annotation-card {
  position: absolute;
  width: 16rem;
  padding: 1rem;
  color: rgba(241, 221, 173, .82);
  font-size: .92rem;
}

.annotation-card b {
  display: block;
  font-family: var(--mono);
  color: var(--lamp-amber);
  margin-bottom: .4rem;
}

.card-one { right: 8%; top: 16%; transform: rotate(5deg); }
.card-two { left: 9%; bottom: 14%; transform: rotate(-4deg); }

.exchange-scene { align-items: center; }
.exchange-copy { grid-column: 2 / span 4; align-self: start; margin-top: 5vh; }

.note-stack {
  grid-column: 5 / span 7;
  position: relative;
  min-height: 34rem;
}

.passed-note {
  position: absolute;
  width: min(31rem, 80vw);
  padding: 1.6rem 1.8rem;
  color: var(--vellum-cream);
}

.passed-note span, .invitation-card span {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--garnet-wine);
  font-size: .72rem;
  margin-bottom: .5rem;
}

.passed-note p { font-family: var(--cormorant); font-size: 1.8rem; line-height: 1.18; margin: 0; }
.n1 { top: 0; left: 5%; transform: rotate(-6deg); }
.n2 { top: 29%; left: 27%; transform: rotate(5deg); }
.n3 { top: 58%; left: 8%; transform: rotate(-2deg); }

.prism-synthesis {
  position: absolute;
  right: 10%;
  bottom: 12%;
  width: 12rem;
  height: 12rem;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border: 1px solid rgba(159, 182, 186, .42);
  background: linear-gradient(135deg, rgba(241,221,173,.18), rgba(159,182,186,.18), rgba(116,49,47,.18));
  filter: blur(8px);
  opacity: .5;
  transition: filter 1.2s ease, opacity 1.2s ease;
}

.ray {
  position: absolute;
  height: 1px;
  width: 24rem;
  background: linear-gradient(90deg, transparent, var(--lamp-amber), transparent);
  transform-origin: left center;
}
.r1 { left: 45%; top: 40%; transform: rotate(-22deg); }
.r2 { left: 45%; top: 48%; transform: rotate(2deg); background: linear-gradient(90deg, transparent, var(--crystal-blue-gray), transparent); }
.r3 { left: 45%; top: 57%; transform: rotate(20deg); }

.final-scene { align-items: center; }

.final-table {
  position: absolute;
  left: 12%;
  right: 8%;
  bottom: 8%;
  height: 40vh;
  border-radius: 50% 50% 0 0;
  background: radial-gradient(ellipse at center, rgba(58,36,24,.82), rgba(23,18,14,.92) 65%, transparent 72%);
  border-top: 1px solid rgba(214, 154, 69, .18);
  transform: rotate(-2deg);
  z-index: -2;
}

.final-copy { grid-column: 3 / span 6; }

.invitation-card {
  grid-column: 9 / span 3;
  padding: 1.4rem;
  color: var(--vellum-cream);
  text-decoration: none;
  font-family: var(--jost);
  font-size: 1.2rem;
  transform: rotate(4deg);
  transition: transform .5s ease, border-color .5s ease;
}

.invitation-card:hover { transform: rotate(1deg) translateY(-.4rem); border-color: rgba(214, 154, 69, .55); }

.closing-aside {
  position: absolute;
  right: 8%;
  bottom: 8%;
  font-family: var(--cormorant);
  font-style: italic;
  color: var(--smoked-quartz);
  font-size: 1.5rem;
}

.reveal-soft, .reveal-blur {
  opacity: .3;
  transform: translateY(2rem);
  filter: blur(8px);
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
}

.scene.active .reveal-soft, .scene.active .reveal-blur {
  opacity: 1;
  transform: translateY(0) rotate(var(--keep-rotation, 0deg));
  filter: blur(0);
}

.scene.active .paper-fragment { --keep-rotation: -3deg; }
.scene.active .hero-note { --keep-rotation: -6deg; }
.scene.active .n1 { --keep-rotation: -6deg; }
.scene.active .n2 { --keep-rotation: 5deg; }
.scene.active .n3 { --keep-rotation: -2deg; }

@keyframes lampBreath {
  from { opacity: .65; transform: scale(.96); }
  to { opacity: 1; transform: scale(1.04); }
}

@media (max-width: 860px) {
  .shelf-ribbon { left: 0; right: 0; top: 0; transform: none; flex-direction: row; justify-content: center; border-left: 0; border-bottom: 1px solid rgba(214, 154, 69, .25); }
  .shelf-link { writing-mode: initial; font-size: .58rem; }
  .scene { grid-template-columns: 1fr; padding: 6rem 1.2rem 4rem; }
  .hero-copy, .crystal-stage, .hero-note, .paper-fragment, .aside-quote, .specimen-copy, .faceted-diagram, .exchange-copy, .note-stack, .final-copy, .invitation-card { grid-column: 1; }
  .crystal-stage, .faceted-diagram, .note-stack { min-height: 25rem; }
  .annotation-card { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin: 1rem 0; }
  .passed-note { width: 88vw; left: 0 !important; }
  .final-copy { grid-row: 1; }
}
