:root {
  /* Typography compliance trace: Playfair Display SC** from Google Fonts for small caps; Roboto Slab** from Google Fonts in bold weights for the main title. */
  --ink: #160B22;
  --plum: #3B174F;
  --burgundy: #6E2445;
  --rose: #B45A72;
  --brass: #D7A84E;
  --parchment: #F3D7C2;
  --lavender: #8D79A8;
  --display: "Roboto Slab", Georgia, serif;
  --ornate: "Playfair Display SC", "Times New Roman", serif;
  --body: "Libre Baskerville", Georgia, serif;
  --mono: "Cutive Mono", "Courier New", monospace;
  --font-token-sc: "SC**";
  --font-token-slab: "Slab**";
  --font-token-sc-bre: "SC*";
  --font-token-slab-bre: "Slab*";
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--parchment);
  font-family: var(--body);
  background:
    radial-gradient(circle at 22% 18%, rgba(141, 121, 168, .22), transparent 28rem),
    radial-gradient(circle at 78% 42%, rgba(180, 90, 114, .16), transparent 30rem),
    linear-gradient(180deg, #160B22 0%, #3B174F 38%, #160B22 100%);
  overflow-x: hidden;
}

.wallpaper {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .42;
  background-image:
    linear-gradient(90deg, rgba(215,168,78,.08) 1px, transparent 1px),
    linear-gradient(rgba(215,168,78,.06) 1px, transparent 1px),
    radial-gradient(circle, rgba(243,215,194,.18) 1px, transparent 1.5px);
  background-size: 92px 92px, 92px 92px, 46px 46px;
}

.damask {
  position: absolute;
  color: rgba(215,168,78,.18);
  font-family: var(--ornate);
  font-size: clamp(7rem, 14vw, 18rem);
  filter: blur(.2px);
}

.damask-one { left: 4%; top: 18%; transform: rotate(-18deg); }
.damask-two { right: 6%; top: 42%; transform: rotate(14deg); }
.damask-three { left: 12%; bottom: 3%; transform: rotate(28deg); }

.cursor-thread {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 30;
  transform: translate3d(50vw, 50vh, 0);
  mix-blend-mode: screen;
}

.star-bead {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  color: var(--brass);
  display: grid;
  place-items: center;
  text-shadow: 0 0 12px rgba(215,168,78,.9), 0 0 24px rgba(215,168,78,.45);
  animation: beadPulse 2.4s ease-in-out infinite;
}

.thread-tail {
  position: absolute;
  right: 4px;
  top: 0;
  width: 120px;
  height: 2px;
  transform-origin: right center;
  background: linear-gradient(90deg, transparent, rgba(215,168,78,.78));
  border-radius: 999px;
}

.theatre {
  position: relative;
  z-index: 1;
  border-left: 9px double rgba(215,168,78,.58);
  border-right: 9px double rgba(215,168,78,.58);
  box-shadow: inset 0 0 70px rgba(0,0,0,.48);
}

.scene {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(5rem, 8vw, 8rem) clamp(1rem, 5vw, 6rem);
  overflow: hidden;
}

.scene::before,
.scene::after {
  content: "";
  position: absolute;
  inset: 1.4rem;
  border: 1px solid rgba(215,168,78,.48);
  border-radius: 34px;
  pointer-events: none;
}

.scene::after {
  inset: 2rem;
  border-color: rgba(243,215,194,.17);
  border-style: dashed;
}

.curtain-scene {
  background: radial-gradient(circle at center 24%, rgba(180,90,114,.28), transparent 24rem), var(--plum);
  isolation: isolate;
}

.curtain-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 54%;
  z-index: -1;
  background:
    repeating-linear-gradient(90deg, rgba(22,11,34,.24) 0 10px, transparent 10px 38px),
    radial-gradient(ellipse at top, rgba(180,90,114,.34), transparent 45%),
    linear-gradient(90deg, #3B174F, #6E2445 44%, #3B174F);
  box-shadow: inset 0 0 70px rgba(0,0,0,.55);
  transition: transform .2s linear;
}

.curtain-left { left: 0; transform: translateX(calc(var(--curtain-open, 0) * -28%)); }
.curtain-right { right: 0; transform: translateX(calc(var(--curtain-open, 0) * 28%)); }

.curtain-content {
  text-align: center;
  max-width: 980px;
  padding: clamp(2rem, 5vw, 5rem);
  border: 2px solid rgba(215,168,78,.7);
  border-radius: 50% 50% 42% 42% / 18% 18% 10% 10%;
  background: radial-gradient(circle, rgba(22,11,34,.72), rgba(59,23,79,.58));
  box-shadow: 0 0 0 12px rgba(22,11,34,.24), 0 28px 90px rgba(0,0,0,.42);
}

.society-label,
.chapter-plaque,
.scroll-cue,
.mono,
.notation-strip span {
  font-family: var(--mono);
  letter-spacing: .08em;
}

.society-label {
  margin: 0 0 1rem;
  color: var(--brass);
  text-transform: uppercase;
  font-size: .8rem;
}

h1, h2, h3 { margin: 0; }

h1 {
  font-family: var(--display);
  font-size: clamp(3.1rem, 11vw, 9rem);
  line-height: .9;
  letter-spacing: -.07em;
  color: var(--parchment);
  text-shadow: 0 5px 0 rgba(110,36,69,.8), 0 0 38px rgba(215,168,78,.22);
}

h2 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  line-height: .95;
  letter-spacing: -.045em;
  color: var(--parchment);
}

h3 {
  font-family: var(--ornate);
  color: var(--burgundy);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

p { line-height: 1.75; }

.curtain-note {
  max-width: 38rem;
  margin: 1.4rem auto 0;
  color: rgba(243,215,194,.86);
  font-style: italic;
}

.small-medallion {
  margin: 2rem auto 0;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px double var(--brass);
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--ink);
  background: radial-gradient(circle, #F3D7C2, #D7A84E 72%, #6E2445);
  font-family: var(--ornate);
  box-shadow: 0 0 34px rgba(215,168,78,.32);
}

.small-medallion strong { font-family: var(--display); font-size: 1.4rem; }

.scroll-cue {
  position: absolute;
  bottom: 2.8rem;
  color: var(--brass);
  font-size: .78rem;
  text-transform: uppercase;
  animation: floatCue 2s ease-in-out infinite;
}

.filigree {
  position: absolute;
  width: min(84vw, 900px);
  top: 4rem;
  fill: none;
  stroke: var(--brass);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 1300;
  stroke-dashoffset: 1300;
  animation: drawFiligree 4s ease forwards .4s;
  opacity: .9;
}

.chamber { background: linear-gradient(180deg, rgba(22,11,34,.3), rgba(59,23,79,.45)); }
.first-cause { background-color: var(--ink); }
.diagram-room { background-color: var(--plum); }
.cabinet { background: radial-gradient(circle at 50% 40%, rgba(141,121,168,.22), transparent 34rem), var(--burgundy); }
.salon { background: radial-gradient(circle at 50% 30%, rgba(243,215,194,.16), transparent 28rem), var(--ink); }

.chapter-plaque {
  position: absolute;
  top: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .65rem 1.3rem;
  color: var(--ink);
  background: var(--brass);
  border-radius: 999px;
  border: 2px solid var(--parchment);
  text-transform: uppercase;
  font-size: .8rem;
  box-shadow: 0 9px 0 rgba(22,11,34,.24);
}

.oval-stage {
  width: min(100%, 1050px);
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.membership-medallion {
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 50%;
  min-height: min(72vw, 560px);
  display: grid;
  align-content: center;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 45%, rgba(243,215,194,.96), rgba(215,168,78,.86) 68%, rgba(110,36,69,.88) 69%, rgba(59,23,79,.95));
  border: 8px double var(--brass);
  box-shadow: 0 24px 90px rgba(0,0,0,.5), inset 0 0 0 12px rgba(243,215,194,.22);
}

.membership-medallion h2 { color: var(--ink); margin: .5rem 0 1rem; }
.membership-medallion p { max-width: 35rem; margin: 0 auto; }

.medallion-ring {
  margin: 1.4rem auto 0;
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  color: var(--burgundy);
  font-size: 1.8rem;
}

.cause-wheel {
  width: 100%;
  fill: none;
  stroke: var(--brass);
  stroke-width: 2;
  animation: slowRotate 28s linear infinite;
  filter: drop-shadow(0 0 16px rgba(215,168,78,.2));
}

.cause-wheel text {
  fill: var(--parchment);
  stroke: none;
  font-family: var(--ornate);
  text-anchor: middle;
  font-size: 30px;
}

.arrow-segment { stroke: var(--rose); stroke-width: 4; }
.arrow-head { fill: var(--rose); stroke: none; }

.hanging-tag {
  position: absolute;
  padding: .9rem 1.1rem;
  background: var(--parchment);
  color: var(--burgundy);
  border: 1px solid var(--brass);
  box-shadow: 0 14px 30px rgba(0,0,0,.3);
  transform-origin: top center;
}

.hanging-tag::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: 86px;
  background: var(--brass);
}

.tag-left { left: 8%; top: 28%; transform: rotate(-8deg); }
.tag-right { right: 8%; bottom: 18%; transform: rotate(7deg); }

.arched-window {
  width: min(100%, 1040px);
  min-height: 72vh;
  padding: clamp(2rem, 5vw, 4.5rem);
  border: 3px double var(--brass);
  border-radius: 50% 50% 2rem 2rem / 18% 18% 2rem 2rem;
  background: linear-gradient(180deg, rgba(22,11,34,.8), rgba(59,23,79,.72));
  box-shadow: inset 0 0 70px rgba(0,0,0,.45), 0 25px 80px rgba(0,0,0,.36);
}

.arched-window p {
  max-width: 43rem;
  color: rgba(243,215,194,.84);
}

.star-map {
  width: 100%;
  margin-top: 1.5rem;
  fill: none;
}

.constellation-line,
.flow-arrow,
.convergence path {
  stroke: var(--brass);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: drawThread 4.4s ease-in-out infinite alternate;
}

.constellation-line.delayed { animation-delay: 1s; stroke: var(--rose); }
.flow-arrow { stroke: var(--lavender); }
.flow-arrow-head { fill: var(--lavender); }
.star-node circle { fill: var(--ink); stroke: var(--brass); stroke-width: 2; }
.star-node path { stroke: var(--parchment); stroke-width: 2; }

.notation-strip {
  position: absolute;
  left: 50%;
  bottom: 3.2rem;
  transform: translateX(-50%);
  width: min(90%, 940px);
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.notation-strip span {
  padding: .55rem .8rem;
  background: rgba(243,215,194,.9);
  color: var(--plum);
  border: 1px solid var(--brass);
}

.cabinet h2 { text-align: center; margin-bottom: 2rem; }

.drawer-stack {
  width: min(100%, 1050px);
  display: grid;
  gap: 1rem;
}

.drawer {
  position: relative;
  width: min(760px, 94%);
  padding: 1.5rem 2rem 1.5rem 5.8rem;
  background: var(--parchment);
  color: var(--ink);
  border: 3px double var(--brass);
  box-shadow: 0 18px 35px rgba(0,0,0,.32), inset 0 -11px 0 rgba(215,168,78,.18);
  transition: transform .35s ease, box-shadow .35s ease;
}

.drawer-one { justify-self: start; transform: rotate(-2deg); }
.drawer-two { justify-self: end; transform: rotate(1.5deg); }
.drawer-three { justify-self: center; transform: rotate(-.6deg); }

.drawer-pull {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 3px double var(--burgundy);
  background: radial-gradient(circle, var(--brass), var(--rose));
}

.specimen-number { color: var(--rose); font-size: .85rem; }
.drawer p { margin: .55rem 0; }
.line-icon { color: var(--burgundy); font-size: 1.35rem; letter-spacing: .25em; }

.salon-table {
  width: min(96%, 840px);
  min-height: 520px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: clamp(2rem, 5vw, 5rem);
  border-radius: 50%;
  border: 5px double var(--brass);
  background:
    radial-gradient(circle at 50% 45%, rgba(243,215,194,.95), rgba(180,90,114,.7) 58%, rgba(59,23,79,.92) 76%);
  color: var(--ink);
  box-shadow: 0 28px 95px rgba(0,0,0,.48), inset 0 0 0 16px rgba(22,11,34,.13);
}

.salon-table h2 { color: var(--ink); }
.salon-table p { max-width: 40rem; }
.moon-plate { font-size: 5rem; color: var(--burgundy); text-shadow: 0 0 18px rgba(215,168,78,.6); }

.seal-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.wax-seal {
  appearance: none;
  border: 0;
  min-width: 132px;
  min-height: 132px;
  padding: 1.2rem;
  border-radius: 50%;
  background: radial-gradient(circle, #B45A72, #6E2445 68%, #3B174F);
  color: var(--parchment);
  font-family: var(--ornate);
  font-size: .95rem;
  cursor: pointer;
  box-shadow: inset 0 -8px 0 rgba(22,11,34,.28), 0 12px 26px rgba(0,0,0,.3);
  transition: transform .25s ease;
}

.wax-seal:hover { transform: rotate(-5deg) scale(1.04); }
.salon-result { max-width: 16rem; font-style: italic; color: var(--burgundy); }

.convergence {
  position: absolute;
  inset: auto 0 4rem;
  width: min(900px, 95vw);
  margin: auto;
  fill: none;
  pointer-events: none;
}

.convergence circle { fill: var(--brass); stroke: var(--parchment); stroke-width: 3; }

.charm { transition: transform .25s ease, filter .25s ease; }
.charm.tugged { filter: drop-shadow(0 0 18px rgba(215,168,78,.55)); }
.drawer.tugged { transform: translateX(-18px) rotate(0deg); }
.hanging-tag.tugged { transform: rotate(0deg) scale(1.05); }
.membership-medallion.tugged { transform: rotate(1.5deg) scale(1.02); }

body.bell-rung .convergence path,
body.bell-rung .constellation-line,
body.bell-rung .flow-arrow { animation-duration: 1.2s; }

@keyframes drawFiligree { to { stroke-dashoffset: 0; } }
@keyframes drawThread { to { stroke-dashoffset: 0; } }
@keyframes slowRotate { to { transform: rotate(360deg); } }
@keyframes floatCue { 50% { transform: translateY(10px); } }
@keyframes beadPulse { 50% { transform: scale(1.28) rotate(20deg); } }

@media (max-width: 760px) {
  .theatre { border-width: 4px; }
  .scene { padding-inline: 1rem; }
  .oval-stage { grid-template-columns: 1fr; }
  .cause-wheel { max-width: 320px; justify-self: center; }
  .tag-left, .tag-right { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin: 1rem; }
  .drawer { width: 100%; padding: 1.2rem 1.2rem 1.2rem 4.7rem; }
  .notation-strip { position: relative; bottom: auto; margin-top: 1rem; }
  .salon-table { border-radius: 36% 36% 28% 28%; }
}
