:root {
  color-scheme: light;
  --ink: #382d26;
  --muted: #6e5b4c;
  --paper: #f8f2e8;
  --line: #d7c9b7;
  --rust: #8b5037;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 system-ui, sans-serif; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }
.masthead, main, footer { width: min(1120px, 90%); margin-inline: auto; }
.masthead, footer { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.masthead { border-bottom: 1px solid var(--line); }
.brand { font: italic 25px Georgia, serif; text-decoration: none; }
.brand span, footer span { color: var(--rust); }
.nav { font-size: .9rem; text-underline-offset: .3em; }
.spread { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 8vw, 100px); align-items: center; padding: clamp(42px, 8vw, 94px) 0; }
.intro { max-width: 430px; }
.eyebrow, figcaption { font: .75rem/1.5 ui-monospace, Consolas, monospace; letter-spacing: .15em; color: var(--muted); }
h1, h2 { font-family: "Noto Serif SC", "Songti SC", SimSun, serif; font-weight: 600; margin: .24em 0; }
h1 { font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: .07em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.intro > p:first-of-type { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button { padding: .65em 1em; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: transparent; text-decoration: none; font: inherit; cursor: pointer; }
.button:hover { background: #eee2d2; }
.primary { color: #fffaf3; background: #583d30; border-color: #583d30; }
.primary:hover { background: #734a37; }
.status { min-height: 1.4em; margin: .55em 0; color: var(--muted); font-size: .85rem; }
details { border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: .9rem; }
summary { cursor: pointer; }
figure { margin: 0; }
figure a { display: block; }
figure img { display: block; width: 100%; height: auto; }
.cover { padding: 10px; background: #fdfaf5; border: 1px solid var(--line); box-shadow: 0 10px 32px #62432b12; }
.cover figcaption { padding: 8px 4px 0; }
.cover figcaption span { margin-left: .7em; }
.section-head, .grid figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head { border-top: 1px solid var(--line); padding: 16px 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 4vw, 48px); }
.grid img { border: 1px solid var(--line); }
.grid figcaption { margin-top: 9px; }
.grid figcaption span:first-child { font-size: 1rem; color: var(--ink); letter-spacing: normal; }
footer { margin-top: 52px; border-top: 1px solid var(--line); color: var(--muted); font: italic 18px Georgia, serif; }
@media (max-width: 650px) {
  .spread { grid-template-columns: 1fr; }
  .cover { width: min(100%, 430px); }
  .grid figcaption { display: block; }
  .grid figcaption span { display: block; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.room-nav { display: flex; gap: 18px; }
@font-face {
  font-family: Daruma;
  src: url("art/DarumadropOne-Regular.ttf") format("truetype");
  font-display: swap;
}
.room-lobby {
  position: relative;
  isolation: isolate;
  min-height: max(460px, 100svh);
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  background: #d7c8bf;
}
.room-lobby::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, #f6efdd35, #f5eddf42 55%, #ece6db24),
    url("art/zoey-reference-dream.png") center 57% / cover no-repeat;
  filter: saturate(.72) contrast(.83) brightness(1.11);
}
.room-foyer { display: contents; }
.foyer-spread {
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding: 0;
}
.room-lobby .foyer-spread { position: static; isolation: auto; }
.foyer-title {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(17px, 3.2vw, 47px) clamp(25px, 5vw, 82px);
  border: 1px solid #fff9e8e0;
  border-radius: 49% 51% 48% 52% / 50% 48% 52% 50%;
  background: #fff5dfce;
  box-shadow: 0 7px 32px #59425d26, inset 0 0 25px #fffce766;
  backdrop-filter: blur(6px);
}
.foyer-title::before {
  content: "";
  position: absolute;
  inset: 7px 10px;
  border: 1px dashed #95859b75;
  border-radius: inherit;
  pointer-events: none;
}
.foyer-title h1 {
  margin: 0;
  color: #4e405d;
  font: clamp(2.35rem, 5.9vw, 6rem)/1.1 Daruma, "Trebuchet MS", sans-serif;
  letter-spacing: .035em;
  white-space: nowrap;
}
.foyer-mark {
  position: absolute;
  right: 3%;
  top: -.58em;
  color: #fff4be;
  font-size: clamp(1.7rem, 2.6vw, 3.1rem);
  line-height: 1;
  text-shadow: 0 1px 8px #7c5b92ac;
  pointer-events: none;
}
.foyer-nav {
  position: relative;
  grid-row: 3;
  align-self: end;
  z-index: 2;
  width: max-content;
  margin-inline: auto;
  margin-bottom: max(20px, 5svh, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}
.foyer-menu { border: 0; padding: 0; position: relative; }
.foyer-menu summary {
  display: flex;
  align-items: center;
  gap: .7em;
  list-style: none;
  padding: .72em 1.05em;
  color: #51445d;
  background: #fff4de;
  border-radius: 999px;
  border-color: #fff9ee;
  box-shadow: 0 4px 22px #4d385849;
}
.foyer-menu summary::-webkit-details-marker { display: none; }
.foyer-menu summary span { color: #746083; }
.foyer-menu summary span:last-child {
  display: grid;
  place-items: center;
  width: 1.65em;
  height: 1.65em;
  border: 1px solid #b8a3bf;
  border-radius: 50%;
}
.foyer-menu summary:hover, .foyer-menu[open] summary { background: #f8e6dc; }
.foyer-links {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(245px, 78vw);
  list-style: none;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf2;
  box-shadow: 0 9px 28px #66462d26;
}
.foyer-links a { display: flex; justify-content: space-between; padding: 9px 11px; border-radius: 5px; text-decoration: none; }
.foyer-links a:hover, .foyer-links a:focus-visible { background: #f2e5d5; }
.spread { position: relative; isolation: isolate; }
.spread .intro, .spread .cover { position: relative; z-index: 1; }
.room-charms {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.room-charm {
  position: absolute;
  width: var(--size);
  aspect-ratio: 1;
  pointer-events: auto;
}
.bubble { border-radius: 50%; }
.bubble::before, .bubble::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.bubble::before {
  inset: 0;
  border-radius: inherit;
  border: 1px solid #fff9;
  background:
    radial-gradient(ellipse at 28% 22%, #fffffff0 0%, #fff7 12%, transparent 30%),
    radial-gradient(ellipse at 38% 30%, #fff5, var(--tint) 69%, #fff7 100%);
  box-shadow: inset -4px -5px 12px var(--tint), 0 4px 17px var(--tint);
}
.bubble::after {
  inset: 50% auto auto 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  color: var(--halo);
  box-shadow: -13px -10px 3px, 3px -16px 2px, 16px -5px 3px, 13px 11px 3px, -3px 15px 2px, -16px 6px 3px;
  opacity: 0;
}
.bubble-lilac { --size: 57px; --tint: #ba9ddd70; --halo: #b89ad8; --delay: -2s; --drift: 5px -9px; top: 32px; left: 13%; }
.bubble-peach { --size: 46px; --tint: #efaa8c63; --halo: #df997d; --delay: -5s; --drift: -8px -3px; bottom: 19px; right: 6%; }
.bubble-mint { --size: 35px; --tint: #a4c8b675; --halo: #8eb5a0; --delay: -4s; --drift: -4px 6px; bottom: 49px; left: 9%; }
.bubble-rose { --size: 21px; --tint: #e9a2b35e; --halo: #e39aab; --delay: -7s; --drift: 7px 4px; top: 58px; right: 25%; }
.bubble-blue { --size: 38px; --tint: #a8bddc65; --halo: #99afd1; --delay: -3s; --drift: -6px -8px; top: 14px; right: 4%; }
.bubble-small { --size: 15px; --tint: #d4bfe97a; --halo: #b89ad8; --delay: -1s; --drift: 3px -7px; bottom: 26px; left: 45%; }
.spark { width: calc(var(--size) + 14px); padding: 7px; filter: drop-shadow(0 0 5px var(--halo)); }
.spark::before {
  content: "";
  display: block;
  aspect-ratio: 1;
  background: var(--tint);
  clip-path: polygon(50% 1%, 60% 37%, 99% 50%, 60% 63%, 50% 99%, 39% 63%, 1% 50%, 39% 37%);
}
.spark-gold { --size: 26px; --tint: #efc18b; --halo: #f6b971; --delay: -1s; --drift: 4px 7px; top: 12px; left: 25%; rotate: 13deg; }
.spark-lilac { --size: 18px; --tint: #c0a2ce; --halo: #d0ace7; --delay: -5s; --drift: 5px -7px; bottom: 16px; left: 20%; rotate: -13deg; }
.spark-pearl { --size: 11px; --tint: #e8c695; --halo: #f9dfad; --delay: -7s; --drift: -5px -3px; top: 67px; left: 5%; rotate: -9deg; }
.spark-rose { --size: 20px; --tint: #d7a2b5; --halo: #f0a7c1; --delay: -3s; --drift: 6px -4px; top: 27px; right: 17%; rotate: 10deg; }
.spark-blue { --size: 12px; --tint: #a4b6cf; --halo: #a0bdea; --delay: -6s; --drift: -4px 7px; bottom: 68px; right: 6%; rotate: 17deg; }
.room-charms .ornament { aspect-ratio: auto; animation: none; }
.chandelier {
  --size: clamp(140px, 26vw, 318px);
  width: min(var(--size), 36svh);
  top: 0;
  left: 33%;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 10px #fff1c9be);
}
.candle {
  --size: clamp(62px, 7.5vw, 94px);
  bottom: 11%;
  left: auto;
  right: 12%;
  filter: drop-shadow(0 0 15px #ffc87b91);
}
.chandelier:hover, .chandelier:active { filter: drop-shadow(0 0 15px #fff4c5); }
.crystal-drops { filter: drop-shadow(0 0 3px #fffae8); }
.candle:hover, .candle:active { filter: drop-shadow(0 0 19px #ffca75); }
.lamp-glint, .candle-flame { transform-box: fill-box; transform-origin: center; }
.lamp-glint { fill: #fffce8; stroke: #ebcf94; filter: drop-shadow(0 0 5px #fff0a9); }
.candle-flame { filter: drop-shadow(0 0 5px #f9ab4e) drop-shadow(0 0 10px #ffd591b0); }
@keyframes lamp-shimmer {
  0%, 100% { opacity: .57; scale: .82; }
  48% { opacity: 1; scale: 1.3; }
}
@keyframes candle-flicker { 45% { scale: .89 1.08; rotate: -4deg; } 80% { scale: 1.06 .95; rotate: 3deg; } }
@media (prefers-reduced-motion: no-preference) {
  .lamp-glint { animation: lamp-shimmer 3.6s ease-in-out infinite; }
  .lamp-glint:nth-child(2) { animation-delay: -1.4s; }
  .lamp-glint:nth-child(3) { animation-delay: -2.5s; }
  .candle-flame { animation: candle-flicker 3.2s ease-in-out infinite; }
  .chandelier:hover .lamp-glint, .candle:hover .candle-flame { animation-duration: 1.1s; }
}
@media (max-width: 650px) {
  .chandelier { --size: clamp(132px, 38vw, 176px); left: 42%; }
  .candle { --size: 62px; right: 8%; bottom: 15%; }
}
@keyframes charm-drift { from { translate: 0 0; } to { translate: var(--drift); } }
@keyframes bubble-dissolve {
  0% { opacity: 1; scale: 1; }
  45% { opacity: .17; scale: 1.12; }
  100% { opacity: 1; scale: 1; }
}
@keyframes bubble-scatter {
  0% { scale: .38; opacity: 0; }
  26% { opacity: .85; }
  100% { scale: 2.1; opacity: 0; }
}
@keyframes star-glint {
  0%, 100% { scale: 1; background: var(--tint); }
  38% { scale: 1.35; background: #fff7de; }
}
@media (hover: hover) and (pointer: fine) {
  .bubble:hover::before { box-shadow: inset -4px -5px 13px var(--tint), 0 0 24px var(--halo); }
  .spark:hover { filter: drop-shadow(0 0 9px var(--halo)); }
}
@media (prefers-reduced-motion: no-preference) {
  .room-charm { animation: charm-drift 9s ease-in-out var(--delay) infinite alternate; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .room-charm:hover { animation-play-state: paused; }
  .bubble:hover::before { animation: bubble-dissolve 1s ease-out; }
  .bubble:hover::after { animation: bubble-scatter .85s ease-out; }
  .spark:hover::before { animation: star-glint .62s ease-out; }
}
@media (max-width: 650px) {
  .bubble-lilac { top: 29px; left: 14%; --size: 38px; }
  .bubble-rose { top: 52px; right: 24%; --size: 15px; }
  .bubble-blue { top: 15px; right: 4%; --size: 28px; }
  .spark-gold { top: 10px; left: 28%; --size: 18px; }
  .spark-pearl { top: 56px; left: 1%; --size: 9px; }
  .spark-rose { top: 23px; right: 17%; --size: 14px; }
  .bubble-peach { bottom: 15px; right: 25%; --size: 34px; }
  .bubble-mint { bottom: 43px; left: 9%; --size: 24px; }
  .bubble-small { bottom: 23%; left: 35%; --size: 12px; }
  .spark-lilac { bottom: 17px; left: 21%; --size: 13px; }
  .spark-blue { bottom: 56px; right: 28%; --size: 10px; }
}
.room-lobby .bubble-lilac { top: 24%; left: 11%; }
.room-lobby .bubble-peach { bottom: 6%; right: 5%; }
.room-lobby .bubble-mint { bottom: 23%; left: 12%; }
.room-lobby .bubble-rose { top: 30%; right: 18%; }
.room-lobby .bubble-blue { top: 12%; right: 10%; }
.room-lobby .bubble-small { bottom: 24%; left: 33%; }
.room-lobby .spark-gold { top: 11%; left: 12%; }
.room-lobby .spark-lilac { bottom: 10%; left: 22%; }
.room-lobby .spark-pearl { top: 33%; left: 5%; }
.room-lobby .spark-rose { top: 17%; right: 27%; }
.room-lobby .spark-blue { bottom: 28%; right: 8%; }
@media (max-width: 650px) {
  .room-lobby .spark-lilac { left: 13%; }
}
#art-viewer { width: min(620px, 94vw); max-height: 95dvh; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); padding: 12px; }
.studio-page {
  --studio-image: url("art/haze-willow.webp");
  --ink: #3f364b;
  --muted: #625671;
  --paper: #faf7f3;
  --line: #dcd2e4;
  --rust: #705b8c;
  container-type: inline-size;
  background: var(--paper);
}
.poem-entry {
  --studio-image: url("art/sage-dream.webp");
  --ink: #394c42;
  --muted: #51695b;
  --paper: #f5f5ec;
  --line: #cdd9c8;
  --rust: #42644e;
}
.studio-page .masthead {
  position: relative;
  z-index: 2;
  border-color: #78658332;
}
.studio-room {
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr);
  min-height: clamp(570px, 81svh, 840px);
  padding: 70px 0 120px;
}
.studio-room::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -90px calc((100% - 100cqw) / 2) 0;
  background:
    linear-gradient(0deg, var(--paper), #faf7f300 16%),
    var(--studio-image) right center / cover no-repeat,
    #f3edf7;
}
.studio-page .intro {
  width: min(100%, 425px);
  max-width: none;
  margin-left: clamp(0px, 2.5vw, 40px);
}
.studio-page .intro h1 {
  margin: 0;
  font-size: clamp(3rem, 6.4vw, 5.6rem);
  font-weight: 500;
  letter-spacing: .085em;
  line-height: 1.2;
  text-shadow: 0 1px 12px #fff;
}
.studio-page .intro > p:first-of-type { max-width: 330px; margin-top: 1.35em; }
.studio-page .intro .button {
  border-radius: 999px;
  padding-inline: 1.15em;
  background: #fffaf8a8;
}
.studio-page .intro .primary {
  color: #fffaff;
  border-color: #59476d;
  background: #59476d;
}
.studio-page .intro .button:hover { background: #ede3f3; }
.studio-page .intro .primary:hover { background: #483858; }
.poem-entry .intro .primary { border-color: #456451; background: #456451; }
.poem-entry .intro .primary:hover { border-color: #354e3e; background: #354e3e; }
.poem-entry .studio-room { min-height: calc(100svh - 66px); }
.poem-entry .studio-motes i { box-shadow: 0 0 7px 3px #fffaf8ba, 0 0 20px 7px #e6ebbc8a; }
.studio-page .intro details { max-width: 370px; }
.studio-page #prompt {
  padding: 12px 15px;
  border-radius: 12px;
  background: #fffcf6db;
}
.studio-motes { position: absolute; inset: 0; pointer-events: none; }
.studio-motes i {
  position: absolute;
  width: var(--size, 4px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fffdfa;
  box-shadow: 0 0 7px 3px #fffaf8ba, 0 0 20px 7px #d6bded69;
}
.studio-motes i:nth-child(1) { top: 15%; left: 46%; --size: 5px; }
.studio-motes i:nth-child(2) { top: 9%; left: 74%; --size: 3px; }
.studio-motes i:nth-child(3) { top: 34%; right: 9%; --size: 6px; }
.studio-motes i:nth-child(4) { bottom: 25%; right: 15%; --size: 3px; }
.studio-motes i:nth-child(5) { bottom: 21%; left: 51%; --size: 5px; }
.studio-light-curtain {
  position: absolute;
  inset: -2% -2% auto 52%;
  height: 59%;
  pointer-events: none;
}
.studio-light-curtain span {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: 11px;
  height: var(--length);
  transform-origin: top center;
  filter: drop-shadow(0 0 3px #fffbf4) drop-shadow(0 0 8px #e6cff9);
}
.studio-light-curtain span::before {
  content: "";
  position: absolute;
  inset: 0 4px;
  background:
    radial-gradient(circle, #fffdf7 1px, #fffdf76b 1.5px, transparent 2px) center / 4px 11px repeat-y,
    linear-gradient(#fffdf700, #fffdf7ab 28%, #fffdf7a0 75%, #fffdf700) center / 1px 100% no-repeat;
  mask-image: linear-gradient(transparent, #000 22%, #000 83%, transparent);
  opacity: .81;
}
.studio-light-curtain i {
  position: absolute;
  top: var(--star, 78%);
  left: 50%;
  width: var(--spark, 12px);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: #fffdf7;
  clip-path: polygon(50% 0, 59% 39%, 100% 50%, 59% 61%, 50% 100%, 41% 61%, 0 50%, 41% 39%);
}
.studio-light-curtain span:nth-child(1) { --left: 8%; --top: 4%; --length: 44%; --delay: -2s; --star: 60%; }
.studio-light-curtain span:nth-child(2) { --left: 19%; --top: -1%; --length: 59%; --delay: -4s; --spark: 9px; }
.studio-light-curtain span:nth-child(3) { --left: 29%; --top: 8%; --length: 37%; --delay: -.4s; --spark: 15px; }
.studio-light-curtain span:nth-child(4) { --left: 69%; --top: -2%; --length: 35%; --delay: -1s; --spark: 10px; }
.studio-light-curtain span:nth-child(5) { --left: 87%; --top: 8%; --length: 69%; --delay: -3s; --star: 64%; --spark: 16px; }
.studio-light-curtain span:nth-child(6) { --left: 95%; --top: 6%; --length: 48%; --delay: -5s; --spark: 9px; }
@keyframes studio-thread { from { rotate: -.7deg; } to { rotate: 1deg; } }
@keyframes studio-star { from { opacity: .38; scale: .68; } to { opacity: .98; scale: 1.08; } }
@keyframes studio-mote {
  from { opacity: .35; translate: -5px 4px; }
  to { opacity: .97; translate: 6px -8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .studio-motes i { animation: studio-mote 5s ease-in-out infinite alternate; }
  .studio-motes i:nth-child(even) { animation-delay: -2.3s; animation-direction: alternate-reverse; }
  .studio-light-curtain span { animation: studio-thread 8s ease-in-out var(--delay) infinite alternate; }
  .studio-light-curtain i { animation: studio-star 4.6s ease-in-out var(--delay) infinite alternate; }
}
@media (max-width: 650px) {
  .studio-room { align-items: start; min-height: max(630px, 83svh); padding: 60px 0 180px; }
  .studio-room::before {
    background:
      linear-gradient(0deg, var(--paper), #faf7f300 18%, #faf7f300 45%, #faf7f3d9 86%),
      var(--studio-image) 75% 100% / cover no-repeat,
      #f3edf7;
  }
  .studio-page .intro { margin-left: 0; }
  .studio-light-curtain { inset: auto 0 5% 48%; height: 31%; }
  .studio-light-curtain span:nth-child(2n) { display: none; }
}
#art-viewer::backdrop { background: #302219c9; }
#viewer-image { display: block; max-width: 100%; max-height: 72dvh; margin: 8px auto; object-fit: contain; }
.viewer-bar { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.viewer-nav { justify-content: center; }
.viewer-bar .button { font-size: .85rem; padding: .35em .7em; }
@keyframes page-arrival { from { opacity: .15; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: no-preference) {
  .spread .intro, .spread .cover, .has-arrived { animation: page-arrival 550ms ease-out both; }
  .spread .cover { animation-delay: 100ms; }
  .cover a img, .grid a img { transition: filter 180ms ease; }
  .cover a:hover img, .grid a:hover img { filter: brightness(1.045); }
}
