:root {
  --bg: #f2efe6;
  --fg: #262721;
  --accent: #a53823;
  --rule: #c8c6ba;
  --paper: #e9e2d3;
  color-scheme: light;
}
body { font-family: "DM Sans", "Microsoft YaHei", Arial, sans-serif; }
p, .credits { color: #55564d; }
header { padding: 19px 5vw; border-color: var(--rule); background: var(--bg); }
header .brand { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; line-height: 1; }
.brand i { width: 27px; height: 27px; background: radial-gradient(circle,#f2efe6 0 12%,#45443e 13% 22%,transparent 23%),repeating-radial-gradient(#292a26 0 1px,#5f6057 2px,#272722 3px); border-radius: 50%; }
.brand small { font-size: 12px; border-left: 1px solid var(--rule); padding-left: 12px; }
header button { border-color: var(--rule); font-size: 14px; }
.archive { background: var(--paper); padding: 0 5vw; overflow: hidden; border-bottom: 0; transition: background .6s; }
.archive-grid { max-width: 1500px; margin: auto; display: grid; grid-template-columns: minmax(240px,.9fr) minmax(0,1.5fr); align-items: center; gap: 3vw; padding: clamp(36px,6vh,80px) 0 28px; min-height: min(73vh,760px); }
.sleeve-copy { max-width: 490px; position: relative; z-index: 2; }
.index-line,.collection-label small,.case-tools,.back small,.inlay small,.notes-head small,.back>span,.stepper output { font-family: "IBM Plex Mono", Consolas, monospace; letter-spacing: .07em; font-size: 13px; }
.index-line { display: flex; gap: 12px; align-items: center; color:#3c3d34; }
.red-mark { width: 23px; height: 4px; background: #a53823; }
.archive h1 { font-family: "Songti SC", SimSun, Georgia, serif; font-size: clamp(50px,6.7vw,108px); font-weight: 600; letter-spacing: -.06em; line-height: 1.12; margin: 30px 0 0; overflow-wrap: anywhere; }
.english-title { margin: 0; font: italic clamp(32px,3.8vw,65px)/1.12 "Instrument Serif", Georgia, serif; color:#87533f; }
.synopsis { max-width: 26em; margin: 25px 0 28px; line-height:1.85; color: #494a41; font-size: 16px; }
button { color: inherit; }
.ink-button,.case-tools button { border-radius: 3px; background:#292a24; color:#fff; border-color:#292a24; padding: 12px 23px; font-weight: 600; }
.text-button { border:0; border-radius:0; text-decoration:underline; text-underline-offset:5px; }
.stage-column { min-width: 0; text-align: center; }
.stage { --size: clamp(230px,min(32vw,49vh),460px); height: calc(var(--size) * 1.15 + 18px); display: grid; place-items: center; perspective: 1200px; touch-action: pan-y; cursor: grab; user-select: none; }
.stage:active { cursor: grabbing; }
.case-position { width: var(--size); aspect-ratio: 1.08; transform-style: preserve-3d; transition: transform .8s; }
.case { position: relative; width:100%; height:100%; transform-style:preserve-3d; transform:rotateX(var(--rx,10deg)) rotateY(calc(var(--ry,-16deg) + var(--flip,0deg))) rotateZ(-5deg); transition: transform .82s cubic-bezier(.22,.75,.2,1); }
.stage.dragging .case { transition:none; }
.case::before { content:""; display:block; position:absolute; inset:7% -1% -3% 4%; transform:translateZ(-18px); box-shadow:9px 21px 24px #3f392e40; border-radius:5px; }
.case .lid, .case .tray,.case .back { position:absolute; inset:0; border-radius:4px; }
.tray { padding:4%; background:repeating-linear-gradient(90deg,#363934 0 2px,#484942 3px,#242722 4px); border:4px ridge #aaa99b; box-shadow:2px 3px 0 #66665c; display:grid; place-items:center; }
.disc { height:99%; aspect-ratio:1; border-radius:50%; background:repeating-radial-gradient(circle,transparent 0 2px,#fff4 3px,transparent 4px),conic-gradient(from 45deg,#a8c0ba,#efe7d5,#9db9b6,#c9a7b6,#e5e8df,#a8c0ba); display:grid; place-items:center; position:relative; box-shadow:0 2px 5px #131610; }
.disc-label { position:absolute; inset:8%; border-radius:50%; background:var(--art) center/cover; opacity:.8; }
.disc i { width:16%; height:16%; border-radius:50%; background:radial-gradient(circle,#33352f 40%,#8a8c83 42%,#dfded2 52%,#8e9085 75%); z-index:1; }
.lid { transform-style:preserve-3d; transform-origin:0% center; transform:translateZ(7px); transition:transform .92s cubic-bezier(.2,.73,.2,1); }
.jacket,.inlay,.back { backface-visibility:hidden; }
.jacket { position:absolute; inset:0; padding:1.1% 1.3% 1.4% 8%; background:repeating-linear-gradient(90deg,#676860 0 1px,#cccbbd 2px,#77786e 3px,#494b43 4px); border:3px ridge #bcbdb2; border-radius:4px; box-shadow:inset 0 0 0 1px #f6f4e8,2px 3px 1px #54554c; overflow:hidden; }
.jacket::after { content:""; pointer-events:none; position:absolute; inset:0; background:linear-gradient(116deg,#fff4,transparent 23%,transparent 50%,#fff2 53%,transparent 76%); }
.jacket img { width:100%;height:100%;display:block;object-fit:cover;pointer-events:none; }
.cover-ink { position:absolute; inset:auto 1.6% 1.6% 8%; padding:4% 5%; background:linear-gradient(transparent,#181914dc); color:#fff; text-align:left; }
.cover-ink b { display:block; font:700 clamp(17px,2.4vw,37px)/1 Arial,sans-serif; letter-spacing:-.045em; }
.cover-ink span { font-size:13px; }
.inlay,.back { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; text-align:left; padding:10%; background:#f0eadb; color:#30322b; border:4px ridge #aaa99a; transform: rotateY(180deg) translateZ(1px); overflow:hidden; }
.inlay strong,.back h3 { font: 600 clamp(19px,2.4vw,35px)/1.2 Georgia,SimSun,serif; margin: 10px 0; }
.inlay p,.back p { font-size:clamp(12px,1.2vw,17px); line-height:1.6; margin:4px 0; }
.inlay span { font-size:11px; margin-top:auto; }
.back { transform:rotateY(180deg) translateZ(5px); }
.barcode { width:24%;height:18px; margin: 12px 0 3px; background:repeating-linear-gradient(90deg,#242721 0 2px,transparent 2px 4px,#242721 4px 5px,transparent 5px 7px); }
.stage.is-back { --flip:180deg; }
.stage.is-open .case-position { transform: translateX(33%) scale(.73); }
.stage.is-open .lid { transform: translateZ(7px) rotateY(-155deg); }
.case-tools { display:flex; align-items:center; justify-content:center; gap:18px; height:42px; color:#54554b; }
.case-tools>span:first-child { font-weight:700; color:#292a24; }
.case-tools button { padding:4px 10px; }
.collection { max-width:1500px; margin:auto; border-top:1px solid #a8aa9e; display:flex; align-items:center; gap:24px; padding:18px 0 20px; }
.collection-label small { display:block; font-size:11px; }
#shelf { display:flex; gap:12px; flex:1; min-width:0; overflow-x:auto; padding:4px; }
.shelf-item { border:1px solid transparent; padding:3px; flex:0 0 auto; width:60px; height:60px; border-radius:2px; transition:transform .2s; background:transparent; }
.shelf-item img { width:100%; height:100%; object-fit:cover; display:block; border-left:4px solid #787a70; }
.shelf-item[aria-pressed=true] { border-color:var(--accent); }
.shelf-item:hover { transform:translateY(-2px); }
.stepper { display:flex; align-items:center; gap:14px; }
.stepper button { width:36px;height:36px;padding:0;line-height:1;font:24px Georgia,serif;border-color:#888b7e; }
#notes { width:min(620px,92vw); max-height:86vh; padding:26px clamp(18px,4vw,46px); background:#f7f3e9; color:#252720; border:1px solid #9a998d; border-radius:4px; }
#notes::backdrop { background:#171914a8; }
.notes-head { display:flex; align-items:center; justify-content:space-between; }
#notes h2 { font-size:36px; margin:24px 0 12px; }
#notes-media video { height:min(58vh,520px); }
#notes-media a { display:inline-block; margin:12px 0; }
body:has(dialog[open]) { overflow:hidden; }
section:not(.archive),footer { border-color:var(--rule); }
.thoughts { background:#dedccb; color:var(--fg); }
.note { background:#e9e6db; }
.film-start { border-color:white; }
.credits { flex-wrap: wrap; }
html.quiet { scroll-behavior:auto; }
html.quiet *,html.quiet *::before,html.quiet *::after { transition:none!important; animation:none!important; }
@media(max-width:760px){
  header { padding:14px 5vw;gap:14px; }
  header nav { margin-top:0; }
  .archive-grid { grid-template-columns:1fr; gap:10px; padding:24px 0 16px; min-height:0; }
  .sleeve-copy { max-width:none; }
  .index-line { margin:0; }
  .archive h1 { margin:12px 0 0; font-size:clamp(43px,9vw,62px); }
  .english-title { font-size:30px; }
  .synopsis { margin:12px 0 15px; max-width:36em; }
  .ink-button,.text-button { padding:8px 14px; }
  .stage { --size:clamp(170px,54vw,290px); }
  .case-tools { height:30px; }
  .collection { gap:10px; flex-wrap:wrap; padding:10px 0 14px; }
  .collection-label { flex:1; }
  .collection-label small { display:inline; margin-left:8px; }
  #shelf { order:3; flex:1 1 100%; gap:8px; }
  .shelf-item { width:clamp(40px,12vw,54px); height:clamp(40px,12vw,54px); }
  .stepper { gap:9px; }
}
@media(prefers-reduced-motion:reduce){
  .archive *, .case, .lid { transition:none!important; }

}


/* Keep the identity, navigation labels and motion control on their own baselines. */
header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  padding: 16px clamp(18px, 3.4vw, 64px);
  gap: clamp(12px, 2vw, 32px);
}
header .brand, header nav a, header #motion { white-space: nowrap; }
header .brand { gap: 9px; line-height: 1.25; }
header .brand i { flex: none; }
header .brand small { padding-left: 9px; letter-spacing: .09em; }
header nav {
  order: 0; width: auto; min-width: 0;
  flex-wrap: nowrap; justify-content: center; align-items: center;
  gap: clamp(12px, 2vw, 30px);
  font-size: clamp(.9rem, 1.24vw, 1.0625rem);
}
header nav a { flex: none; line-height: 1.4; padding-block: 6px; }
header #motion { font-size: .875rem; line-height: 1.3; padding: 9px 13px; }
@media (max-width: 690px) {
  header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "identity motion" "links links";
    gap: 11px 10px;
    padding: 13px 16px 7px;
  }
  header .brand { grid-area: identity; justify-self: start; }
  header #motion { grid-area: motion; }
  header nav {
    grid-area: links; justify-content: space-between; gap: 12px;
    overflow-x: auto; padding-top: 5px; border-top: 1px solid var(--rule);
  }
}
