/* Two interiors of the observatory: velvet under the cards, paper under the ink. */
.ritual-section,
.folio {
  --chamber-night: #151020;
  --chamber-ink: #21182d;
  --chamber-violet: #382944;
  --chamber-lilac: #bdaec7;
  --chamber-brass: #d7ba90;
  --chamber-ivory: #f3eadc;
  position: relative;
  isolation: isolate;
  color-scheme: dark;
  color: var(--chamber-ivory);
  border-block: 0;
}

.ritual-section {
  --rt-paper: var(--chamber-ivory);
  --rt-metal: var(--chamber-brass);
  --rt-muted: #ccbacd;
  background:
    radial-gradient(ellipse at 74% 40%, #4a345268 0, transparent 49%),
    radial-gradient(ellipse at 19% 10%, #6f4f7d35, transparent 46%),
    linear-gradient(108deg, #21182c, #1f182a 52%, #171321);
}

.ritual-section::before,
.folio::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
}

.ritual-section::before {
  background:
    repeating-linear-gradient(112deg, #f0d6ef03 0 1px, transparent 1px 4px),
    linear-gradient(118deg, transparent 50%, #c5a5cc06 53%, transparent 60%);
}

.ritual-section .rt-shell,
.folio .folio-inner {
  width: min(1330px, 88%);
  min-height: calc(100svh - 70px);
  margin-inline: auto;
}

.ritual-section .rt-shell {
  grid-template-columns: minmax(255px,.78fr) minmax(0,1.22fr);
  align-content: center;
  padding-block: clamp(46px, 7.2svh, 92px);
  column-gap: clamp(37px, 5vw, 95px);
  row-gap: clamp(24px, 4svh, 48px);
}

.rt-room .rt-label,
.folio .overline {
  color: #d9c2a7;
  font: 500 .78rem/1.5 var(--sans);
  letter-spacing: .18em;
}

.rt-room .rt-label span {
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  background: none;
}

.rt-room .rt-label span::before {
  content: "✧";
  font: 1.4rem/1 var(--roman);
  color: var(--chamber-brass);
}

.rt-room h2,
.folio h2 {
  font: 500 clamp(3.1rem,5.1vw,5.8rem)/1.12 var(--serif);
  letter-spacing: -.08em;
  color: var(--chamber-ivory);
}

.rt-room h2 { margin: .26em 0 .31em; }
.rt-room .rt-lead { color: #e5d6d0; font-family: var(--serif); }
.rt-options > p { color: #d6c9d4; }
.rt-rule { color: #cabcce; }
.rt-rule summary { color: #ddc8a9; }
.rt-prompt { min-height: 2em; }

.rt-room .rt-choice {
  color: #ded1dc;
  background: #1a1323a8;
  border: 1px solid #b69ca550;
}
.rt-room .rt-choice[aria-pressed="true"] {
  color: #332431;
  background: #e3ccaa;
  border-color: #e8d3b1;
}
.rt-room .rt-choice:disabled:not([aria-pressed="true"]) { opacity: .72; }

.rt-room .rt-shuffle,
.rt-room .rt-new {
  color: #eed8b6;
  border-bottom-color: #c9b08c82;
}

/* The ellipse is a silk-lined working surface; its edge stays below the active cards. */
.rt-stage {
  padding: clamp(14px, 2.5vw, 37px) clamp(8px, 1.1vw, 19px) clamp(15px, 2vw, 28px);
  border-block: 1px solid #cfafa22b;
}

.rt-stage::before {
  inset: 0;
  background:
    radial-gradient(ellipse at 53% 38%, #a987a02c, transparent 60%),
    linear-gradient(90deg, transparent, #baa1ba0a 50%, transparent);
}

.rt-mat {
  inset: 10% auto auto 4%;
  width: 92%;
  height: 68%;
  aspect-ratio: auto;
  border: 1px solid #d1b69574;
  border-radius: 50%;
  transform: rotate(-3deg);
  background:
    radial-gradient(ellipse at 52% 12%, #87617b45, transparent 69%),
    repeating-linear-gradient(116deg, #eadbe004 0 1px, transparent 1px 3px),
    radial-gradient(ellipse, #3a2d45 26%, #302338 73%, #211927 99%);
  box-shadow:
    0 3px 0 #352834,
    0 5px 0 #a4876b7a,
    0 17px 22px -7px #0f0b18a8,
    inset 0 0 28px #21142572;
}

.rt-mat::before {
  inset: 3.2%;
  border: 1px solid #dbc2a04a;
}
.rt-mat::after {
  inset: 5%;
  transform: none;
  border: 1px dashed #dbc2a02b;
}
.rt-mat > div {
  inset: 18% 20%;
  transform: rotate(8deg);
  border-color: #d1b0bd29;
  border-style: solid;
}

.rt-room .rt-card {
  color: #d4b990;
  border-color: #c4ac8b;
  background:
    repeating-linear-gradient(121deg, #f0dbed08 0 1px, transparent 1px 4px),
    linear-gradient(144deg, #5c485d, #3c2e45 23%, #302738 64%, #483849);
  box-shadow: -3px 5px 8px #100b17b8, inset 0 0 13px #c5a5a11a;
}
.rt-room .rt-stage-hint { color: #dfd0c6; font-size: .875rem; }
.rt-room .rt-fan { margin-bottom: clamp(10px, 1.25vw, 21px); }

.rt-room .rt-empty,
.rt-room .rt-filled:not([aria-pressed="true"]) {
  border-color: #c0a1905c;
  color: #d9cbd5;
  background: #1c15235c;
}
.rt-room .rt-empty { border-style: solid; }
.rt-room .rt-filled {
  background: #372938;
  border-color: #c6a987;
}
.rt-place-index { color: #d7b991; }
.rt-slot-copy small { color: #ddc6b4; }

.rt-room.rt-complete .rt-filled,
.rt-room.rt-complete .rt-filled:not([aria-pressed="true"]) {
  border: 0;
  background: none;
}
.rt-room.rt-complete .rt-mat {
  top: 9%;
  height: 68%;
}
.rt-reading {
  border-top-color: #cfb6a54d;
  padding-top: clamp(18px, 2.1vw, 34px);
}
.rt-room .rt-answer-label { color: #e0c499; }
.rt-room .rt-answer-copy,
.rt-room .rt-thread > p:not(.rt-answer-label) { color: #e7dce4; }
.rt-room .rt-context { color: #cbbccb; }
.rt-room .rt-thread .rt-reflection { color: #e8d7bc; }

/* A dark conservation mount carries the historical print and its working star map. */
.folio {
  background:
    radial-gradient(ellipse at 50% 38%, #54435c88, transparent 70%),
    linear-gradient(104deg, #201829, #271d30 47%, #211a2b);
}

.folio::before {
  background: repeating-linear-gradient(90deg, #d6b8c603 0 1px, transparent 1px 5px);
}

.folio .folio-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  padding: clamp(34px, 5.2svh, 68px) 0 clamp(35px, 6svh, 78px);
}

.folio-heading {
  padding-bottom: clamp(14px, 2.25svh, 28px);
  margin-bottom: 0;
}
.folio h2 { margin: .16em 0 0; }
.folio .fine-star { color: var(--chamber-brass); }
.folio-heading .atlas-select { color: #cebfce; }

.folio .select-box select {
  color-scheme: dark;
  color: #f2e6d2;
  background: #2c2233;
  border: 1px solid #bfa39085;
  border-radius: 2px;
  padding-block: .5rem;
}
.folio .select-box span { color: #e0c6a6; top: .33rem; }

.folio-spread {
  position: relative;
  padding: clamp(6px, .65vw, 11px);
  gap: 1px;
  grid-template-columns: 1fr 1.08fr;
  border: 1px solid #ad938477;
  background: linear-gradient(150deg, #554151, #332937 34%, #392e3a 73%, #594557);
  box-shadow: 0 18px 38px -20px #0b0617e6, inset 0 0 0 2px #211a28;
}

.archive-leaf {
  padding: clamp(15px, 1.4vw, 25px);
  color: #e8dccf;
  border: 1px solid #bfa5974d;
  background:
    radial-gradient(ellipse at 52% 25%, #584452, transparent 84%),
    linear-gradient(98deg, #322638, #40313e 66%, #2a222e);
}
.archive-leaf .print-window img {
  height: clamp(180px, 30svh, 320px);
  width: 100%;
  object-fit: contain;
  mix-blend-mode: normal;
  opacity: .84;
  filter: grayscale(.9) sepia(.27) brightness(.89);
}
.print-developed .archive-leaf .print-window img {
  opacity: 1;
  filter: saturate(1.06);
}
.archive-leaf figcaption { border-color: #d7bca04f; }
.archive-leaf .folio-spec span:first-child { color: #f0d9b5; }
.archive-leaf .folio-spec span:last-child,
.archive-leaf .plate-credit { color: #cec1c7; }

.folio-spread .plot {
  color-scheme: light;
  color: #493c49;
  background:
    repeating-linear-gradient(113deg, #4f3c4805 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 56% 40%, #e5d9c7, transparent 69%),
    linear-gradient(92deg, #bba99e, #d5c7b8 7%, #ded2bf 55%, #cdbfaf);
  box-shadow: inset 0 0 26px #6853472b;
}
.folio-spread .plot::before { border-color: #79675f79; }
.folio-spread .plot-top,
.folio-spread .plot-bottom { color: #54434a; }
.folio-spread #chart { max-height: min(35svh, 350px); }
.folio-spread .trace-star .ring { stroke: #8a5635; }
.folio-spread .sky-node { fill: #6d5b5b; }
.folio-spread #chart-sound[aria-pressed="true"] { background: #624e5b; border-color: #624e5b; }
.folio-spread #chart-sound[aria-pressed="false"] { background: #fcf3e336; color: #56414b; }
.folio-note { color: #d6cbd5; }
.folio-note #folio-reflection { color: #ebd3b0; }
.folio .folio-link { color: #e2c8a6; border-color: #c2a380a6; }

#light-table {
  background: #261e30;
  border-color: #b09a86;
}
#light-table::backdrop { background: #100c19d9; }
.light-frame { background: #382c3e; }
.light-bar p { color: #d3b893; }
.light-foot { color: #d6c7cc; }
.light-tools button { border-color: #a38a80; }

@media (min-width: 741px) and (max-height: 720px) {
  .ritual-section .rt-shell { padding-block: 2rem; row-gap: 1.4rem; }
  .rt-room .rt-options { margin-top: 1.1rem; }
  .rt-stage { padding-block: 12px; }
  .rt-fan { height: clamp(215px, 36cqw, 255px); }
  .rt-room .rt-card { width: min(21cqw,127px); }
  .rt-room.rt-complete .rt-filled .rt-face { width: min(91%,120px); }
  .rt-room .rt-stage-hint { margin-top: 2px; }
  .folio .folio-inner { padding-block: 1.8rem; }
}

@media (max-width: 980px) {
  .ritual-section .rt-shell,
  .folio .folio-inner { width: 92%; }
  .ritual-section .rt-shell { column-gap: 3vw; }
}

@media (max-width: 740px) {
  .ritual-section .rt-shell,
  .folio .folio-inner { width: calc(100% - 36px); }
  .ritual-section .rt-shell {
    min-height: calc(100svh - 57px);
    grid-template-columns: minmax(0,1fr);
    justify-content: start;
    align-content: center;
    padding-block: clamp(27px, 5svh, 44px);
    gap: 1.25rem;
  }
  .rt-room .rt-intro { max-width: 100%; }
  .rt-room h2,
  .folio h2 { font-size: clamp(2.5rem, 8.6vw, 3.75rem); }
  .rt-room .rt-label,
  .folio .overline { font-size: .73rem; letter-spacing: .13em; }
  .rt-room .rt-label span { width: 1rem; height: 1rem; }
  .rt-room .rt-options { margin-top: 1.05rem; }
  .rt-room .rt-prompt { min-height: 1.6em; }
  .rt-stage { padding: 12px 0 14px; }
  .rt-stage .rt-fan { height: max(180px, 43cqw); }
  .rt-room .rt-stage-hint { font-size: .83rem; }
  .rt-mat { width: 94%; left: 3%; }
  .rt-room .rt-empty { padding: 6px 3px; min-height: 44px; font-size: .84rem; }
  .rt-spread { margin-top: .55rem; }
  .rt-room .rt-reading { gap: 1rem; }
  .folio .folio-inner { min-height: calc(100svh - 57px); padding-block: clamp(27px, 5svh, 44px); }
}

@media (max-width: 680px) {
  .folio-spread { grid-template-columns: minmax(0,1fr); }
  .folio .folio-heading { padding-bottom: 1.25rem; }
  .folio-spread .plot { min-height: clamp(290px, 44svh, 415px); }
  .folio-spread #chart { max-height: none; }
  .print-developed .archive-leaf { padding: .8rem; }
  .archive-leaf .print-window img { height: clamp(200px, 36svh, 330px); }
  .folio-note { margin-top: 1rem; }
  .folio-note > div { font-size: .94rem; }
}
