:root {
  color-scheme: light;
  --paper: #f6f0e2;
  --shelf: #f0e8d9;
  --white: #fffcf3;
  --ink: #282017;
  --muted: #665748;
  --subtle: #7d6859;
  --line: #d8cab5;
  --orange: #a84329;
  --cinnabar: #963e28;
  --dark: #32271f;
  --shell: 1304px;
  --display: Georgia, "Songti SC", "Noto Serif SC", STSong, serif;
  --body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.55 var(--body); }
button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
figure, p, h1, h2, h3, dl, dd { margin: 0; }
:focus-visible { outline: 2px solid #a3472d; outline-offset: 4px; }
[hidden] { display: none !important; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 3; top: .5rem; left: .5rem; padding: .65rem 1rem; background: var(--white); }
.shell { width: min(calc(100% - 96px), var(--shell)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.nav-inner { min-height: 77px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem; }
.brand { width: fit-content; display: inline-flex; align-items: center; gap: .7rem; }
.brand img { border-radius: 10px; }
.brand strong { display: block; font-family: var(--display); font-size: 1.06rem; line-height: 1.2; }
.brand small { display: block; margin-top: .16rem; color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .09em; }
nav { display: flex; align-items: center; gap: clamp(1.15rem, 3.1vw, 3.3rem); }
nav a { font-size: .91rem; font-weight: 620; color: var(--muted); }
nav a:hover, .top-link:hover { color: var(--orange); }
.search-shortcut { justify-self: end; display: inline-flex; align-items: center; gap: .56rem; background: transparent; border: 1px solid var(--line); padding: .44rem .62rem .44rem .8rem; border-radius: 6px; font-size: .87rem; }
.search-shortcut:hover, .search-box:focus-within { border-color: var(--orange); }
kbd { display: inline-grid; min-width: 1.2rem; min-height: 1.2rem; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: .78rem/1 var(--body); }
.search-symbol { width: .85rem; height: .85rem; display: inline-block; position: relative; flex: none; border: 1.5px solid currentColor; border-radius: 50%; margin-right: .19rem; }
.search-symbol::after { content: ""; position: absolute; width: .35rem; height: 1.5px; background: currentColor; right: -.25rem; bottom: -.1rem; transform: rotate(46deg); }

.hero { min-height: 525px; display: grid; grid-template-columns: .91fr 1.2fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: 2.8rem 3.2rem; }
.hero-copy { min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .63rem; color: var(--cinnabar); font-size: .78rem; font-weight: 750; letter-spacing: .14em; }
.eye-rule { width: 25px; height: 1px; background: currentColor; display: inline-block; }
h1 { margin: 1.05rem 0 1.5rem; font: 600 clamp(3.6rem, 7.6vw, 7.45rem)/.84 var(--display); letter-spacing: -.057em; }
h1 > span { display: block; }
h1 > span + span { margin-top: .16em; }
.title-mark { color: var(--orange); }
.hero-copy > p { max-width: 28rem; color: var(--muted); font-size: 1.02rem; line-height: 1.8; }
.hero-actions { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.45rem; }
.primary-button, .secondary-button {
  min-height: 41px; display: inline-flex; justify-content: center; align-items: center; gap: .6rem;
  border: 1px solid transparent; border-radius: 5px; padding: .52rem .96rem; font-size: .9rem; font-weight: 650;
}
.primary-button { color: var(--white); background: var(--cinnabar); border-color: var(--cinnabar); }
.primary-button:hover { background: #79321f; }
.secondary-button { color: var(--ink); border-color: var(--line); background: transparent; }
.secondary-button:hover:not(:disabled) { color: var(--cinnabar); border-color: var(--cinnabar); }
.download-format { color: var(--muted); font-size: .72rem; }
.play-symbol { width: 0; height: 0; border-block: 4px solid transparent; border-left: 7px solid currentColor; }
.pause-symbol { width: 8px; height: 10px; border-inline: 2px solid currentColor; }
.hero-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .9rem; margin-top: 1.5rem; color: var(--muted); font-size: .78rem; }
.hero-counts span + span::before { content: "·"; margin-right: .9rem; color: var(--subtle); }
.hero-counts b { color: var(--ink); font-size: .91rem; font-variant-numeric: tabular-nums; margin-right: .24rem; }

.hero-figure { min-width: 0; }
.hero-art { position: relative; overflow: hidden; aspect-ratio: 1.79; background: #60412a; box-shadow: 0 3px 0 #c9b295, 0 4px 0 #e1ceac, 0 6px 0 #cbb497, 0 15px 29px #39210726; border: 1px solid #6b4931; border-radius: 5px 5px 3px 3px; }
.hero-art::after { pointer-events: none; content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 7px #1b110c18, inset 0 0 34px #1b110c2c; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-figure figcaption { color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 42px; padding-top: .45rem; font-size: .78rem; }
.hero-figure figcaption button { flex: none; border: 0; background: transparent; padding: .15rem 0 .15rem .6rem; color: var(--cinnabar); font-size: .8rem; font-weight: 650; }
.hero-figure figcaption button span { margin-left: .2rem; }

.collection { padding-block: 2.55rem 4.15rem; background: var(--shelf); border-top: 1px solid var(--line); }
.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.2rem; }
h2 { font: 650 clamp(2.06rem,4.8vw,3.55rem)/1.14 var(--display); letter-spacing: -.035em; }
.collection-heading h2, .about h2 { margin-top: .46rem; }
.search-box { display: flex; width: min(100%, 365px); align-items: center; gap: .65rem; align-self: end; padding: .62rem .8rem; border: 1px solid var(--line); background: var(--white); border-radius: 5px; color: var(--muted); }
.search-box input { width: 100%; border: 0; background: transparent; outline: none; font-size: .94rem; }
.search-box input:focus-visible { outline: none; }
.search-box input::placeholder { color: var(--subtle); }
.search-box kbd { flex: none; }
.filters { display: flex; flex-wrap: wrap; gap: .58rem; margin: 1.55rem 0 .7rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.filter { flex: none; padding: .48rem .9rem; border-radius: 5px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .89rem; font-weight: 640; }
.filter span { margin-left: .38rem; opacity: .8; font-size: .74rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.filter:hover { border-color: var(--muted); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--dark); color: var(--white); border-color: var(--dark); }
.catalogue-controls { display: flex; align-items: center; justify-content: space-between; gap: .65rem 1rem; margin-bottom: .95rem; min-height: 38px; }
.catalogue-controls p, .pagination p { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.selects { display: flex; gap: .5rem; min-width: 0; }
.select-wrap { display: flex; position: relative; min-width: 0; }
.select-wrap::after { pointer-events: none; position: absolute; right: .7rem; top: .8rem; content: ""; width: .38rem; height: .38rem; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
select { min-width: 0; max-width: min(32vw, 320px); appearance: none; padding: .4rem 1.75rem .4rem .62rem; border: 1px solid var(--line); border-radius: 5px; background: var(--white); font-size: .82rem; color: var(--muted); text-overflow: ellipsis; }
.gallery { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1.04rem; }
.asset-card { display: flex; flex-direction: column; min-width: 0; width: 100%; overflow: hidden; padding: 0; border: 1px solid #d2c1a7; border-radius: 7px; background: var(--white); text-align: left; box-shadow: 0 2px 0 #9e806421; transition: border-color 150ms, box-shadow 150ms; }
.asset-card:hover { border-color: #9d6648; box-shadow: 0 5px 15px #48301a18; }
.card-art { isolation: isolate; width: 100%; overflow: hidden; position: relative; display: grid; place-items: center; aspect-ratio: 1.37; background: radial-gradient(ellipse at 55% 46%,#e7d8bd,#d2bc98); border-bottom: 1px solid #d4c3a6; }
.asset-card[data-category="scenes"] .card-art,
.asset-card[data-category="story"] .card-art,
.asset-card[data-kind="video"] .card-art { background: #614937; }
.card-art img { max-width: 100%; width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; padding: .78rem; }
.card-art img.is-cover { object-fit: cover; padding: 0; }
.card-art img.is-missing { display: none; }
.asset-badge { z-index: 1; position: absolute; right: .5rem; bottom: .5rem; padding: .15rem .4rem; border-radius: 3px; color: #fff8e7; background: #30251de8; font-size: .7rem; line-height: 1.4; }
.card-info { min-width: 0; width: 100%; display: flex; flex-direction: column; gap: .15rem; padding: .66rem .74rem .73rem; }
.card-info strong, .card-source { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-info strong { font-weight: 660; font-size: .91rem; }
.card-source { font-size: .75rem; color: var(--muted); }
.letter-sample { position: absolute; font: 3.2rem var(--display); color: #674735; }
.source-sample { max-width: 92%; padding: .7rem; white-space: pre-wrap; text-align: center; color: #674735; font: .9rem/1.45 ui-monospace, monospace; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 3.5rem 1rem; }
.empty p { color: var(--muted); margin: .35rem 0 1rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1.7rem 0 0; }

.about { border-top: 1px solid var(--line); padding-block: 2.8rem 3.6rem; }
.about-inner { display: grid; grid-template-columns: minmax(210px,.55fr) 1.45fr auto; gap: 2rem; align-items: start; }
.about h2 { font-size: 2.15rem; }
.about p { color: var(--muted); max-width: 47rem; font-size: .93rem; }
.about p + p { margin-top: .65rem; }
.top-link { font-size: .87rem; font-weight: 650; white-space: nowrap; }

.viewer { width: min(1150px, calc(100% - 48px)); max-height: calc(100% - 48px); margin: auto; padding: 0; color: var(--ink); background: var(--white); border: 1px solid #80654a; border-radius: 9px; box-shadow: 0 22px 100px #170d0a68; }
.viewer::backdrop { background: #211610c9; }
.viewer-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(238px, 30%); min-height: min(620px, 76vh); }
.viewer-stage { display: grid; place-items: center; align-content: center; min-width: 0; min-height: 325px; padding: 1.1rem; background: radial-gradient(ellipse at 55% 43%, #f0e4cc, #d3bea1); }
.viewer-stage[data-backdrop="dark"] { background: radial-gradient(ellipse at 55% 43%, #46372b, #282019); color: var(--white); }
.viewer-stage[data-backdrop="grid"] { background-color: #eee5d9; background-image: conic-gradient(#d7cdbe 25%,transparent 0 50%,#d7cdbe 0 75%,transparent 0); background-size: 24px 24px; }
.viewer-stage > img, .viewer-stage video { max-width: 100%; max-height: 72vh; object-fit: contain; }
.viewer-stage > img.is-zoomed { width: auto; max-width: none; max-height: none; justify-self: start; }
.viewer-stage.is-zoomed { display: block; max-height: 78vh; overflow: auto; }
.viewer-stage video { width: 100%; background: #211a16; border-radius: 4px; }
.viewer-info { padding: 1.05rem 1.25rem 1.35rem; min-width: 0; overflow: auto; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.viewer-top .eyebrow { letter-spacing: .08em; }
.close-button { width: 2.1rem; height: 2.1rem; flex: none; background: transparent; border: 1px solid var(--line); border-radius: 5px; font: 1.65rem/.8 var(--body); }
.close-button:hover { border-color: var(--orange); }
.viewer h2 { overflow-wrap: anywhere; font-size: clamp(1.55rem,2.5vw,2.3rem); margin: .6rem 0 1.08rem; }
.viewer dl { font-size: .87rem; overflow-wrap: anywhere; }
.viewer dt { margin-top: .63rem; color: var(--muted); }
.viewer dd { margin-top: .14rem; }
.viewer code { font: .8rem/1.5 ui-monospace, monospace; }
.viewer-actions, .viewer-neighbors { display: flex; flex-wrap: wrap; gap: .5rem; }
.viewer-actions { margin-top: 1.1rem; }
.viewer-neighbors { margin-top: 1.15rem; padding-top: .95rem; border-top: 1px solid var(--line); }
.viewer-actions button, .viewer-actions a, .viewer-neighbors button { min-height: 35px; font-size: .81rem; padding: .35rem .63rem; }
.viewer-note { max-width: 34rem; padding: .7rem; color: inherit; text-align: center; }
.viewer-code { justify-self: stretch; max-height: 67vh; padding: 1rem; margin: 0; overflow: auto; text-align: left; background: #211b17; color: #f0e5d1; border: 1px solid #746354; border-radius: 4px; tab-size: 4; }
.font-preview { display: grid; justify-items: stretch; width: 100%; min-width: 0; gap: 1rem; }
.font-preview .pangram { text-align: center; overflow-wrap: anywhere; font: clamp(1.5rem,5vw,4rem)/1.25 var(--sample-font,Georgia), serif; }
.font-preview input { min-width: 0; border-radius: 4px; border: 1px solid var(--line); background: var(--white); padding: .4rem .65rem; font-size: .93rem; }
model-viewer { width: 100%; height: clamp(320px,65vh,630px); border-radius: 5px; }
.filmstrip { display: grid; place-items: center; gap: 1rem; width: 100%; }
.filmstrip-screen { width: 100%; display: grid; place-items: center; aspect-ratio: 1.46; max-height: 57vh; }
.filmstrip-screen img { max-height: 100%; max-width: 88%; width: min(75%, 500px); height: 100%; object-fit: contain; }
.filmstrip-screen.is-aligned { display: block; position: relative; width: min(80%, 520px); max-height: none; }
.filmstrip-screen.is-aligned img { position: absolute; max-width: none; max-height: none; object-fit: fill; }
.filmstrip-controls { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .65rem; padding: .6rem .72rem; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.filmstrip-controls input { accent-color: var(--cinnabar); flex: 1 1 120px; max-width: 400px; }
.filmstrip-controls output { min-width: 3.2rem; font-size: .82rem; font-variant-numeric: tabular-nums; }
.filmstrip-controls .filmstrip-play { min-width: 5.2rem; min-height: 40px; font-size: .88rem; }
body:has(.viewer[open]) { overflow: hidden; }

@media (min-width: 1450px) {
  .hero { min-height: 540px; }
}
@media (max-width: 1050px) {
  .shell { width: calc(100% - 56px); }
  .hero { min-height: 0; gap: 2rem; }
  h1 { font-size: clamp(3.4rem, 8vw, 6rem); }
  .gallery { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 730px) {
  .shell { width: calc(100% - 34px); }
  .nav-inner { min-height: 65px; gap: .6rem; }
  .brand img { width: 35px; height: 35px; }
  .brand { gap: .42rem; }
  .brand strong { font-size: .9rem; }
  .brand small { font-size: .65rem; }
  nav { gap: .66rem; }
  nav a { font-size: .82rem; }
  .search-shortcut { padding: .46rem; }
  .search-shortcut span:nth-child(2), .search-shortcut kbd { display: none; }
  .hero { grid-template-columns: 1fr; gap: 1.42rem; padding-block: 2.1rem 1.85rem; }
  h1 { font-size: clamp(3.85rem,13.4vw,6.6rem); margin: .88rem 0 1rem; }
  .hero-copy > p { font-size: .92rem; }
  .hero-counts, .hero-actions { margin-top: 1rem; }
  .hero-art { aspect-ratio: 1.6; }
  .collection { padding-block: 2.15rem 2.5rem; }
  .collection-heading { align-items: start; flex-direction: column; gap: .85rem; }
  .search-box { align-self: start; width: 100%; }
  .filters { margin-top: 1.05rem; gap: .38rem; padding-bottom: .85rem; }
  .filter { padding: .33rem .52rem; font-size: .78rem; }
  .filter span { margin-left: .25rem; font-size: .66rem; }
  .catalogue-controls { flex-wrap: wrap; }
  .select-wrap select { max-width: 58vw; }
  .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .card-info { padding: .52rem .5rem; }
  .card-info strong { font-size: .83rem; }
  .card-source { font-size: .7rem; }
  .about-inner { grid-template-columns: 1fr; gap: .95rem; }
  .viewer { width: calc(100% - 18px); max-height: calc(100% - 18px); }
  .viewer-layout { display: flex; flex-direction: column; min-height: 0; }
  .viewer-stage { min-height: 235px; order: 2; padding: .6rem; }
  .viewer-stage > img, .viewer-stage video { max-height: 53vh; }
  .viewer-info { padding: .75rem .92rem; }
  .viewer-neighbors { margin-top: .7rem; padding-top: .65rem; }
  .viewer-info dl { font-size: .78rem; }
}
@media (max-width: 390px) {
  .nav-inner { grid-template-columns: 1fr auto auto; }
  nav a:last-child { display: none; }
  .hero-counts { gap: .25rem .6rem; }
  .hero-counts span + span::before { margin-right: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
