@charset "UTF-8";
:root {
  --paper: #eae1cf;
  --ink: #27251f;
  --muted: #796e5a;
  --rust: #b77a60;
  --serif: "KaiTi", "STKaiti", "楷体", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.76' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23978269' filter='url(%23n)' opacity='.7' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
button, a { color: inherit; -webkit-tap-highlight-color: transparent; }
button { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px dashed var(--rust); outline-offset: 6px; }
[hidden] { display: none !important; }
::selection { background: #ceaf8b; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.site-shell, .folio, .fan-window, .fan { position: absolute; inset: 0; width: 100%; height: 100%; }
.site-shell { height: 100dvh; overflow: clip; isolation: isolate; }
.welcome-layer, .record-layer { position: absolute; inset: 0; pointer-events: none; }
.welcome-layer { z-index: 180; }
.record-layer { z-index: 185; }
.layer-outline { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.layer-paper { fill: #eee6d6; stroke: none; pointer-events: fill; }
.welcome-layer .layer-paper { fill: #c6baa3; }
.welcome-layer .layer-shadow { display: none; }
.record-layer .layer-paper { fill: #e9e0d0; }
.layer-ink, .layer-shadow { fill: none; stroke: var(--ink); stroke-linecap: round; pointer-events: none; }
.layer-ink { stroke-width: 11; }
.layer-shadow { stroke: #a99b80; stroke-width: 22; opacity: .55; }
.record-layer .site-record a { pointer-events: auto; }
.welcome { position: absolute; z-index: 180; top: 1.5vh; left: 3vw; margin: 0; font-weight: bold; font-size: clamp(24px, 3.1vw, 46px); letter-spacing: .12em; transform: rotate(-6deg); }
.fan-window { overflow: clip; touch-action: none; }
.chapter-sheet {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(var(--angle)); transform-origin: -40vw 50vh;
  z-index: var(--layer); pointer-events: none; will-change: transform;
}
.sheet-cover {
  position: absolute; left: 23vw; top: 18vh; width: 49vw; height: 17vh;
  transform: rotate(-9deg); transform-origin: 0 50%; display: flex; align-items: center;
  pointer-events: auto; text-align: left; overflow: visible;
}
.card-face { position: absolute; inset: -10% -2%; width: 104%; height: 120%; object-fit: fill; pointer-events: none; }
.sheet-cover { translate: var(--selected-shift, 0px) 0; transition: translate .18s ease-out; }
.chapter-sheet.is-current { --selected-shift: 40px; }
.chapter-title {
  display: block; position: relative; z-index: 2; margin-left: 6vw;
  font-size: clamp(44px, 5.8vw, 98px); font-weight: 900; letter-spacing: .035em;
  line-height: 1; text-shadow: .8px .5px 0 currentColor; white-space: nowrap;
}
.chapter-art {
  position: absolute; width: 23vw; height: 24vh; left: -21vw; top: -3vh; z-index: 3;
  object-fit: contain; transform: rotate(5deg) scale(.7); pointer-events: none;
}
.paper-button-label { position:relative;display:inline-block;z-index:2;line-height:1;white-space:pre; }
.paper-label-glyph { display:inline-block;white-space:pre;transform-origin:50% 50%; }
.paper-button-surface { position:absolute;z-index:0;pointer-events:none; }
[data-surface-ready="true"] > .card-face { visibility:hidden; }
.chapter-links > a[data-surface-ready="true"]::before { display:none; }
.sheet-cover[data-polar-button],.chapter-links > a[data-polar-button] { pointer-events:none; }
.sheet-cover[data-polar-button]::after,.chapter-links > a[data-polar-button]::after { content:"";position:absolute;left:var(--hit-left);top:var(--hit-top);width:var(--hit-width);height:var(--hit-height);clip-path:var(--hit-shape);pointer-events:auto;z-index:5; }
.chapter-links {
  --option-height: max(26px, 5.5vh);
  position: absolute; top: 36vh; left: 33vw; width: 40vw; height: 50vh;
  display: block; pointer-events: none; overflow: visible;
}
.chapter-links > a {
  position: absolute; height: var(--option-height); display: flex; align-items: center;
  transform-origin: 0 50%; pointer-events: auto;
  justify-content: center; padding: 0 1vw;
  isolation: isolate;
  font-size: min(2.6vw, 3.5vh); font-weight: 700; line-height: 1;
}
.chapter-links > a::before {
  content: ""; position: absolute; inset: -30% -1%; z-index: -1; pointer-events: none;
  background: url("../assets/paper/submenu-strip.png?v=20260916-img1") center / 100% 100% no-repeat;
}
.chapter-links > a:hover { color: #9c533b; }
.is-mystery .chapter-links { --option-height: 30vh; }
.eggroom-reveal {
  position: absolute; height: var(--option-height); display: flex;
  align-items: center; justify-content: center; transform-origin: 0 50%;
  isolation: isolate; pointer-events: none;
}
.eggroom-reveal::before {
  /* The strip PNG has transparent vertical margins: let the visible paper fill the card. */
  content: ""; position: absolute; inset: -40% -2%; z-index: -1;
  background: url("../assets/paper/submenu-strip.png?v=20260916-img1") center / 100% 100% no-repeat;
}
.eggroom-egg { width: 74%; height: 74%; object-fit: contain; user-select: none; }
.chapter-sheet[data-chapter="2"] .chapter-links > a,
.chapter-sheet[data-chapter="3"] .chapter-links > a,
.chapter-sheet[data-chapter="4"] .chapter-links > a { font-size: clamp(18px, 2vw, 30px); }
.orbit-disc { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 130; pointer-events: none; }
.orbit-disc circle { fill: #dbcfb8; stroke: var(--ink); stroke-width: 9; }
.rail-drag { position: absolute; inset: 0; z-index: 200; pointer-events: none; touch-action: none; outline: none; }
#rail-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rail-path, .rail-thumb, .rail-thumb-ink { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rail-path { stroke: var(--ink); stroke-width: clamp(6px, .75vw, 12px); }
.rail-hit { fill: none; stroke: transparent; stroke-width: 48px; pointer-events: stroke; cursor: grab; touch-action: none; }
.rail-thumb-ink { stroke: var(--ink); stroke-width: clamp(14px, 1.6vw, 24px); }
.rail-thumb { stroke: var(--rust); stroke-width: clamp(9px, 1.05vw, 17px); pointer-events: stroke; cursor: grab; }
.rail-drag:active .rail-thumb, .rail-drag:active .rail-hit { cursor: grabbing; }
.rail-drag:focus-visible .rail-thumb { stroke: #cc9272; }
.rail-drag.is-wrapping .rail-thumb { animation: warp-flash .18s ease-out; }
@keyframes warp-flash { 0%, 35% { opacity: .15; } 100% { opacity: 1; } }
.record-player { position: absolute; right: 3.2vw; bottom: 6.5vh; width: clamp(200px, 38vw, 550px); z-index: 190; }
.record-button { width: 100%; aspect-ratio: 1; display: block; pointer-events: none; }
.record-disc, .tonearm { pointer-events: visiblePainted; cursor: pointer; }
.record-button svg { width: 100%; height: 100%; aspect-ratio: 1; display: block; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.vinyl-pulse, .vinyl, .tonearm { transform-box: view-box; }
.vinyl-pulse { transform-origin: 49px 49px; transform: scale(var(--record-scale, 1)); }
.vinyl { transform-origin: 49px 49px; animation: record-spin 6s linear infinite; animation-play-state: paused; }
.tonearm { transform-origin: 104px 49px; transform: rotate(-38deg); transition: transform .65s cubic-bezier(.4,0,.2,1); }
.tonearm > path { stroke-width: 3; stroke: #3b372e; }
.tonearm > circle { fill: #b88a68; stroke-width: 2; }
.tonearm .stylus { fill: #eee3cf; stroke-width: 1.5; }
.record-player.is-playing .vinyl { animation-play-state: running; }
.record-player.is-playing .tonearm { transform: rotate(0deg); }
@keyframes record-spin { to { transform: rotate(360deg); } }
.site-record { position: absolute; right: 3.7vw; bottom: 2vh; z-index: 195; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: clamp(8px, .85vw, 13px); color: #6e614e; font-family: var(--serif); transform: rotate(-3deg); }
.site-record a:hover { text-decoration: underline; }
@media (orientation: portrait) {
  .chapter-sheet.is-current { --selected-shift: 24px; }
  .welcome { font-size: 31px; top: 2vh; left: 5vw; }
  .sheet-cover { left: 22vw; top: 20vh; width: 58vw; height: 11vh; transform: rotate(-9deg); }
  .chapter-title { font-size: clamp(34px, 9.2vw, 64px); margin-left: 7vw; }
  .chapter-art { width: 32vw; height: 20vh; left: -26vw; top: -3vh; }
  .chapter-links { --option-height: max(34px, 4.8vh); left: 26vw; top: 36vh; width: 53vw; }
  .is-mystery .chapter-links { --option-height: 24vh; }
  .chapter-links > a { font-size: clamp(22px, 6vw, 31px); }
  .chapter-sheet[data-chapter="2"] .chapter-links > a,
  .chapter-sheet[data-chapter="3"] .chapter-links > a,
  .chapter-sheet[data-chapter="4"] .chapter-links > a { font-size: clamp(18px, 4.6vw, 29px); }
  .record-player { right: 2vw; bottom: 7vh; width: 56vw; }
  .site-record { font-size: 8px; bottom: 3vh; right: 4vw; }
  .rail-hit { stroke-width: 35px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .welcome { font-size: 26px; }
  .chapter-title { font-size: 9vh; }
  .chapter-links > a { font-size: 5.5vh; }
  .chapter-sheet[data-chapter="2"] .chapter-links > a,
  .chapter-sheet[data-chapter="3"] .chapter-links > a,
  .chapter-sheet[data-chapter="4"] .chapter-links > a { font-size: 4.5vh; }
  .record-player { width: 46vh; right: 4vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .chapter-sheet { will-change: auto; }
  .record-player.is-playing .vinyl { animation: none; }
}

/* K -> ink dot -> drawn vinyl -> diagonal paper separation. */
.intro { position: fixed; inset: 0; z-index: 500; color: var(--ink); background: var(--paper); overflow: hidden; }
.intro[data-phase="open"] { background: transparent; }
.intro-panels { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-paper { fill: var(--paper); }
.intro-edge, .intro-split-line { fill: none; stroke: var(--ink); stroke-width: 11; stroke-linecap: round; }
.intro-edge { opacity: 0; }
.intro-split-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro-k-stage { position: absolute; left: 50%; top: 50%; width: min(530px, 78vw, 86vh); transform: translate(-50%, -50%); }
.intro-art { width: 100%; display: block; overflow: visible; transform-origin: 50% 50%; }
.f-line { stroke-width: 1.7; stroke-dasharray: 1; stroke-dashoffset: 1; }
.k-line { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 5.5; }
.ink-point { offset-path: path("M80 321C-25 148 203 229 288 124S452 16 453 146"); opacity: 0; }
.intro-seed { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--ink); opacity: 0; }
.intro-record { position: absolute; left: 50%; top: 50%; width: clamp(100px, 32vmin, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); }
.intro-record svg { display: block; width: 100%; height: 100%; overflow: visible; }
.record-draw { opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 2.2; transform: rotate(-90deg); }
.record-draw-outer { stroke-width: 4; }
.record-draw-label { stroke: var(--rust); stroke-width: 4; }
.intro-record-raster { clip-path: circle(0% at 50% 50%); }
.intro-skip { position: absolute; right: 5vw; bottom: 5vh; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--ink); }
.intro-skip span { margin-left: 10px; }
.intro-skip:hover { color: var(--rust); }
.site-shell.is-intro-playing #record-player { visibility: hidden; }

.intro.is-running .f-line { animation: intro-flourish 1.4s ease-in-out both; }
.intro.is-running .f-two { animation-delay: .1s; }
.intro.is-running .f-three { animation-delay: .2s; }
.intro.is-running .ink-point { animation: intro-point-travel 1.4s ease-in-out both; }
.intro.is-running .k-line { animation: intro-draw 1.55s .3s linear forwards; }
/* Compress the 2.00s–4.07s morph interval to one third of its former duration. */
.intro.is-running .intro-art { animation: intro-k-collapse .183333s 2s cubic-bezier(.65,0,.4,1) forwards; }
.intro.is-running .intro-seed { animation: intro-seed .2s 2.126667s both; }
.intro.is-running .record-draw-outer { animation: intro-record-draw .26s 2.283333s ease-in-out forwards; }
.intro.is-running .record-draw-ring-one { animation: intro-record-draw .24s 2.333333s ease-in-out forwards; }
.intro.is-running .record-draw-ring-two { animation: intro-record-draw .216667s 2.376667s ease-in-out forwards; }
.intro.is-running .record-draw-label { animation: intro-record-draw .166667s 2.423333s ease-in-out forwards; }
.intro.is-running .record-draw-hole { animation: intro-record-draw .083333s 2.296667s ease-in-out forwards; }
.intro.is-running .intro-record-raster { animation: intro-record-ink .16s 2.5s ease-out forwards; }
.intro.is-running .intro-record-lines { animation: intro-trace-fade .08s 2.616667s forwards; }
.intro.is-running .intro-split-line { animation: intro-split-draw .46s 2.66s linear forwards; }
.intro.is-running .intro-welcome-paper { animation: intro-welcome-tone .46s 2.66s forwards; }
.intro.is-running .intro-record-paper { animation: intro-record-tone .46s 2.66s forwards; }
.intro.is-running .intro-edge { animation: intro-edge-appear .001s 3.12s forwards; }
.intro.is-running .intro-skip { animation: intro-trace-fade .2s 2.92s forwards; }

@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-record-draw { from { opacity: 1; stroke-dashoffset: 1; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes intro-flourish { 0% { opacity: 0; stroke-dashoffset: 1; } 15% { opacity: .7; } 65% { opacity: .6; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: -1; } }
@keyframes intro-point-travel { 0% { offset-distance: 0%; opacity: 1; } 90% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes intro-k-collapse { 0% { transform: scale(1); opacity: 1; } 92% { opacity: 1; } 100% { transform: scale(.015); opacity: 0; } }
@keyframes intro-seed { 0% { opacity: 0; transform: scale(1.3); } 25%, 65% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.5); } }
@keyframes intro-record-ink { to { clip-path: circle(72% at 50% 50%); } }
@keyframes intro-trace-fade { to { opacity: 0; } }
@keyframes intro-split-draw { 0% { stroke-dashoffset: 1; } 99% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes intro-welcome-tone { to { fill: #c6baa3; } }
@keyframes intro-record-tone { to { fill: #e9e0d0; } }
@keyframes intro-edge-appear { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }
