:root {
  color-scheme: dark;
  --bg: #15131d;
  --ink: #fbefe0;
  --muted: #bcb1bf;
  --gold: #f3c989;
  --line: #393241;
  font: 16px/1.5 system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 76% 25%, #282032 0, transparent 51%), var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #fff0bc; outline-offset: 4px; }
.shell { width: min(calc(100% - 88px), 1120px); margin-inline: auto; }
.site-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 650; letter-spacing: -.025em; }
.brand img { border-radius: 9px; }
.header-links { display: flex; align-items: center; gap: clamp(10px, 3vw, 24px); }
.gallery-link { color: var(--muted); font-size: .87rem; }
.gallery-link:hover { color: var(--gold); }
.nav-link { display: flex; gap: 13px; align-items: center; color: var(--gold); font-size: .87rem; border: 1px solid #594a53; padding: 8px 13px; border-radius: 8px; }
.nav-link:hover, .store:hover { border-color: var(--gold); }
.hero { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); gap: clamp(40px, 8vw, 112px); align-items: center; padding-block: 47px 42px; }
.eyebrow { margin: 0 0 17px; font-size: .72rem; font-weight: 700; letter-spacing: .17em; color: var(--gold); }
.signal { display: inline-block; width: 7px; height: 7px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px #f3c98980; }
h1, h2 { font-family: Georgia, 'Songti SC', serif; font-weight: 400; letter-spacing: -.055em; }
h1 { margin: 0; font-size: clamp(3.3rem, 7vw, 6.3rem); line-height: .99; }
h1 em { color: var(--gold); font-weight: inherit; }
.lede { color: var(--muted); max-width: 29ch; margin: 25px 0 28px; font-size: 1.04rem; line-height: 1.65; }
.player { max-width: 385px; padding: 15px 17px 10px; border: 1px solid #493d50; border-radius: 16px; background: #221d2b; }
.player-main { display: flex; align-items: center; gap: 13px; }
.play { display: grid; place-items: center; flex: 0 0 45px; height: 45px; border: 0; border-radius: 50%; background: var(--gold); color: #271b25; }
.play:hover { background: #ffe0a9; }
.play svg { width: 24px; fill: currentColor; }
.play .pause-icon, .playing .play-icon, .loading .play-icon { display: none; }
.playing .pause-icon, .loading .pause-icon { display: block; }
.track { display: grid; flex: 1; gap: 1px; }
.track strong { font-size: .92rem; font-weight: 650; }
.track span { font-size: .75rem; color: var(--muted); }
.meter { display: flex; gap: 3px; align-items: center; height: 21px; opacity: .5; }
.meter i { width: 2px; border-radius: 3px; height: 9px; background: var(--gold); }
.meter i:nth-child(2) { height: 17px; animation-delay: -.37s; }
.meter i:nth-child(3) { height: 12px; animation-delay: -.15s; }
.meter i:nth-child(4) { height: 6px; animation-delay: -.48s; }
.playing .meter { opacity: 1; }
.playing .meter i { animation: meter .65s ease-in-out infinite alternate; }
@keyframes meter { to { transform: scaleY(.45); } }
.timeline { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.timeline input { min-width: 0; width: 100%; height: 24px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.timeline input:disabled { opacity: .45; cursor: default; }
.preview-note { margin: 2px 0 3px; color: var(--muted); font-size: .75rem; }
.player-status { color: var(--gold); font-size: .8rem; margin: 5px 0; }

.scene { margin: 0; width: 100%; }
.room { position: relative; width: 100%; aspect-ratio: 1024 / 1200; overflow: hidden; isolation: isolate; border-radius: 20px; background: #2b2030; box-shadow: 0 20px 56px #0a080e90, 0 0 0 1px #594650; }
.room-plate { display: block; width: 100%; height: auto; }
.room-caption { position: absolute; top: 13px; left: 13px; z-index: 3; display: flex; align-items: center; gap: 8px; border: 1px solid #c6a0a355; border-radius: 6px; background: #1c1522dd; padding: 5px 8px; font-size: .62rem; letter-spacing: .12em; }
.room-caption span:first-child { color: var(--gold); }
figcaption { display: flex; gap: 9px; margin-top: 12px; color: var(--muted); font-size: .8rem; }
figcaption > span:first-child { color: var(--gold); }
.actor, .glass, .glow, .hotspot, .heart { position: absolute; }
.actor, .glass, .glow, .heart { pointer-events: none; }
.actor { display: block; }
.girl_body, .girl_head { animation: breathe 4.4s ease-in-out infinite alternate; }
.cat_tail { animation: sway 5.4s ease-in-out infinite alternate; }
.cat-pet .cat_tail { animation-duration: 2.6s; }
@keyframes breathe { to { transform: rotate(.5deg) scaleY(1.004); } }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(5deg); } }
.glass { overflow: hidden; mask: url("./media/attic/window_mask.webp") center / 100% 100% no-repeat; }
.clouds { position: absolute; inset: 0; background: url("./media/attic/clouds.webp") 0 48% / 114% auto no-repeat; animation: drift 36s ease-in-out infinite alternate; opacity: .72; }
@keyframes drift { to { transform: translateX(13%); } }
.rain { position: absolute; inset: 0; opacity: 0; transition: opacity .7s; }
.raining .rain { opacity: 1; }
.drop { position: absolute; top: -10%; width: 1px; height: 8%; background: linear-gradient(transparent, #c8e2ffc4); animation: fall var(--speed) linear var(--delay) infinite; animation-play-state: paused; }
.raining .drop { animation-play-state: running; }
@keyframes fall { to { transform: translate(-10px, 1400%); } }
.glow { border-radius: 50%; background: radial-gradient(ellipse, var(--glow), transparent 68%); mix-blend-mode: screen; animation: glow 3.4s ease-in-out var(--delay, 0s) infinite alternate; }
@keyframes glow { from { opacity: .27; } to { opacity: .92; } }
.room-shade { position: absolute; inset: 0; pointer-events: none; background: #090c25; opacity: 0; transition: opacity .7s; }
.dimmed .room-shade { opacity: .54; }
.lamp-glow { --glow: #ed9b4f76; transition: filter .7s; }
.dimmed .lamp-glow { --glow: #ffb85ea6; }
.steam { background: linear-gradient(transparent, #fff1c976, transparent); border-radius: 50%; opacity: 0; animation: steam 3.8s ease-out var(--delay) infinite; }
@keyframes steam { 15% { opacity: .52; } 85%, 100% { transform: translate(50%, -130%); opacity: 0; } }
.hotspot { z-index: 2; border: 0; background: transparent; padding: 0; border-radius: 14px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hotspot:focus-visible { outline: none; }
.hotspot::after { content: ''; position: absolute; right: 8%; bottom: 8%; width: 7px; height: 7px; background: #ffe4ac; border-radius: 50%; box-shadow: 0 0 0 4px #251a27a0, 0 0 10px #ffe4ac; }
.hotspot:focus-visible::after { outline: 2px solid #fff0bc; outline-offset: 4px; }
.hotspot-window::after { right: 15%; bottom: 16%; }
.heart { z-index: 2; color: #ffd097; font-size: clamp(18px, 3vw, 29px); text-shadow: 0 2px 6px #311f31; }

.scene-gallery { padding: 24px 0 44px; scroll-margin-top: 24px; }
.scene-gallery .eyebrow { margin-bottom: 9px; }
.gallery-intro { color: var(--muted); margin: 0 0 21px; max-width: 63ch; font-size: .95rem; }
.gallery-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gallery-controls:not([hidden]) { display: flex; gap: 8px; flex: none; }
.gallery-controls button { width: 42px; height: 42px; border: 1px solid #6d5a69; border-radius: 50%; background: #211c29; color: var(--gold); }
.gallery-controls button:hover:not(:disabled) { border-color: var(--gold); }
.gallery-controls button:disabled { opacity: .4; cursor: default; }
.scene-track {
  display: flex;
  gap: 12px;
  padding: 0 0 9px;
  margin: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #6d5a69 transparent;
}
.scene-track:focus-visible { outline-offset: 2px; }
.scene-card { flex: 0 0 clamp(168px, 21vw, 216px); scroll-snap-align: start; position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #211c29; }
.scene-card a { display: block; height: 100%; }
.scene-card a:focus-visible { outline-offset: -3px; }
.scene-card:has(a:hover) { border-color: var(--gold); }
.scene-card img { display: block; width: 100%; aspect-ratio: 8 / 9; object-fit: cover; background: #2b2030; }
.scene-name { display: block; padding: 10px 11px; font-size: .84rem; line-height: 1.3; font-weight: 650; }
.scene-badge { position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: 5px; background: #1c1522; color: var(--gold); font-size: .67rem; }

.download { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 26px; padding: 31px clamp(20px, 4vw, 42px); background: #211c29; border: 1px solid #433649; border-radius: 18px; scroll-margin-top: 16px; }
.download .eyebrow { margin-bottom: 9px; }
h2 { margin: 0 0 9px; font-size: clamp(1.95rem, 4.25vw, 3.4rem); line-height: 1.08; }
.download p:last-child { max-width: 58ch; margin: 0; color: var(--muted); font-size: .9rem; }
.store-links { display: flex; flex-wrap: wrap; gap: 9px; }
.store { display: flex; align-items: center; gap: 8px; min-height: 46px; justify-content: center; border: 1px solid #6d5a69; border-radius: 8px; padding: 8px 11px; font-size: .86rem; font-weight: 650; white-space: nowrap; }
.store.primary { color: #271b25; background: var(--gold); border-color: var(--gold); }
.store.primary:hover { background: #ffe0a9; }
.store svg { width: 20px; fill: currentColor; }
.store span { font-size: .75em; opacity: .8; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding-block: 21px 26px; color: var(--muted); font-size: .72rem; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 12px; }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .shell { width: calc(100% - 48px); }
  .hero { gap: 33px; }
  .download { grid-template-columns: 1fr; gap: 17px; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); max-width: 480px; }
  .site-header { min-height: 65px; }
  .brand img { width: 32px; height: 32px; }
  .hero { grid-template-columns: 1fr; gap: 25px; padding-block: 29px 27px; }
  h1 { font-size: clamp(3.15rem, 11vw, 4.5rem); }
  .eyebrow { margin-bottom: 13px; }
  .lede { margin-block: 14px 17px; max-width: 36ch; font-size: .96rem; }
  .player { max-width: none; }
  .room { border-radius: 15px; }
  .scene-gallery { padding: 12px 0 28px; }
  .scene-track { gap: 9px; }
  .scene-card { flex-basis: clamp(128px, 41vw, 185px); }
  .scene-name { padding: 9px; font-size: .8rem; }
  .store { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .drop { top: var(--rest); transform: rotate(12deg); }
}
