:root {
  --paper: #f3e8cf;
  --paper-light: #fbf4e4;
  --paper-deep: #dcc89d;
  --ink: #1c2b27;
  --ink-soft: #42534c;
  --muted: #59665d;
  --jade: #1f5145;
  --jade-deep: #123a31;
  --jade-soft: #dbe5d7;
  --rust: #a64938;
  --gold: #b6814e;
  --line: #c6b78f;
  --line-strong: #887755;
  --shadow: 0 18px 42px rgba(52, 42, 25, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #d7c39a; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif; line-height: 1.75; }
body::before { content: ""; position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: .25; background-image: radial-gradient(rgba(87, 67, 37, .25) .5px, transparent .6px), linear-gradient(115deg, transparent 0 47%, rgba(165, 126, 70, .05) 48% 49%, transparent 50%); background-size: 5px 5px, 28rem 28rem; mix-blend-mode: multiply; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 40; left: 1rem; top: -4rem; padding: .55rem .9rem; color: #fff; background: var(--jade-deep); border-radius: 2px; }
.skip-link:focus { top: 1rem; }

.atmosphere { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(circle at 80% 8%, rgba(249, 229, 174, .72), transparent 25%), linear-gradient(165deg, #ead8b5 0%, #f7ecd6 48%, #e4e7d6 100%); }
.atmosphere::before { content: ""; position: absolute; inset: 8% 0 auto; height: 44%; opacity: .24; background: repeating-linear-gradient(173deg, transparent 0 3.2rem, rgba(119, 93, 51, .22) 3.25rem 3.31rem, transparent 3.36rem 6.5rem); transform: skewY(-2deg); }
.atmosphere::after { content: "荷"; position: absolute; right: -8rem; bottom: -8rem; width: 34rem; height: 22rem; opacity: .18; border-radius: 50%; background: repeating-radial-gradient(ellipse at center, transparent 0 14px, rgba(43, 83, 70, .42) 15px 16px, transparent 17px 28px); transform: rotate(-8deg); }
.moon-glow, .mist, .water-sheen { position: absolute; pointer-events: none; }
.moon-glow { width: 22rem; height: 22rem; right: -5rem; top: -10rem; border-radius: 50%; background: rgba(255, 246, 201, .48); filter: blur(1px); }
.mist { width: 70vw; height: 11rem; border-radius: 50%; background: rgba(255,255,255,.22); filter: blur(26px); }
.mist-a { left: -18vw; bottom: 11%; }
.mist-b { right: -20vw; bottom: 27%; opacity: .5; }
.water-sheen { left: 0; right: 0; bottom: 0; height: 24%; opacity: .14; background: repeating-linear-gradient(177deg, transparent 0 2.2rem, rgba(44, 83, 71, .45) 2.25rem 2.31rem, transparent 2.37rem 4.7rem); transform: skewY(-2deg); }

.top, #view, footer { position: relative; z-index: 1; }
.top { min-height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(1rem, 5vw, 5.5rem); color: #f8f0dd; background: linear-gradient(98deg, #16372f 0%, #214d40 58%, #152d27 100%); border-bottom: 2px solid var(--gold); box-shadow: 0 5px 20px rgba(22, 39, 31, .16); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: #fff8e8; font-size: 1.2rem; font-weight: 600; letter-spacing: .22em; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; color: #f3d49f; border: 1px solid rgba(244, 215, 165, .75); border-radius: 50%; font-size: 1rem; transform: rotate(-24deg); }
.top nav { display: flex; align-items: stretch; gap: clamp(.8rem, 2.5vw, 2.2rem); height: 78px; }
.top nav a { position: relative; display: flex; align-items: center; padding: .25rem 0; color: #dfebdd; font-size: .86rem; letter-spacing: .15em; }
.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 2px; background: #e7bf7b; transform: scaleX(0); transform-origin: right; transition: transform .2s ease; }
.top nav a:hover, .top nav a[aria-current="page"] { color: #fff8e8; }
.top nav a:hover::after, .top nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) 0 6rem; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--jade-deep); }
h1 { font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif; font-weight: 600; line-height: 1.05; letter-spacing: .1em; }
h2 { font-weight: 600; line-height: 1.25; letter-spacing: .08em; }
h3 { font-weight: 600; line-height: 1.35; }
.eyebrow { margin: 0 0 .65rem; color: var(--rust); font-size: .72rem; letter-spacing: .2em; }
.eyebrow i { color: var(--gold); font-style: normal; }
.eyebrow-dot { display: inline-block; width: .46rem; height: .46rem; margin-right: .45rem; vertical-align: .05em; border-radius: 50%; background: var(--rust); box-shadow: 0 0 0 4px rgba(166, 73, 56, .14); }
.quiet-link { color: var(--jade); font-size: .82rem; white-space: nowrap; text-decoration: underline; text-decoration-color: rgba(31,81,69,.4); text-underline-offset: .24em; }
.muted, .section-note { color: var(--muted); }

.hero { position: relative; display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr); gap: clamp(2rem, 7vw, 6.5rem); align-items: center; min-height: 520px; margin: .6rem 0 4rem; padding: clamp(2rem, 5vw, 4.8rem); overflow: hidden; border: 1px solid var(--line-strong); background: linear-gradient(118deg, rgba(255,248,232,.94), rgba(244,228,194,.88)); box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; inset: .65rem; border: 1px solid rgba(157, 141, 105, .5); pointer-events: none; }
.hero::after { content: "荷"; position: absolute; right: 2rem; bottom: -2.2rem; color: rgba(166, 73, 56, .1); font-size: 16rem; line-height: 1; font-family: "STKaiti", serif; pointer-events: none; }
.hero-cover-wrap { position: relative; z-index: 1; order: 2; justify-self: center; width: min(100%, 300px); }
.cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border: 11px solid rgba(252, 244, 225, .92); background: #29473d; box-shadow: 0 16px 30px rgba(47, 38, 25, .24), 0 0 0 1px var(--line-strong); transform: rotate(-1.5deg); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 54%, rgba(12, 33, 28, .42)); pointer-events: none; }
.cover > span { position: absolute; z-index: 1; left: 1rem; bottom: .8rem; color: #fff2d2; writing-mode: vertical-rl; letter-spacing: .22em; font-size: 1.2rem; text-shadow: 0 2px 10px #152d27; }
.cover-stamp { position: absolute; z-index: 2; top: 1.2rem; right: -.9rem; padding: .48rem .35rem; color: var(--rust); border: 1px solid rgba(166, 73, 56, .72); background: #f4e6c6; writing-mode: vertical-rl; letter-spacing: .2em; font-size: .74rem; }
.hero-copy { position: relative; z-index: 1; order: 1; }
.hero-copy h1 { max-width: none; margin-bottom: .25rem; font-size: clamp(3.3rem, 8vw, 6.7rem); }
.hero-title-sub { margin-bottom: 1.25rem; color: var(--rust); font-size: clamp(1.1rem, 2vw, 1.4rem); letter-spacing: .24em; }
.hero-soul { margin-bottom: .7rem; color: var(--jade); font-size: 1.15rem; letter-spacing: .09em; }
.lead { max-width: 36rem; color: var(--ink-soft); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.9rem 0 .7rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; min-height: 2.75rem; padding: .58rem 1.05rem; color: var(--jade-deep); border: 1px solid var(--line-strong); background: rgba(255,255,255,.3); font-size: .86rem; letter-spacing: .12em; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-2px); border-color: var(--jade); background: var(--paper-light); }
.btn.primary { color: #fff9ea; border-color: var(--jade); background: var(--jade); }
.btn.primary:hover { background: var(--jade-deep); }
.resume-note { margin: 0; color: var(--muted); font-size: .78rem; }

.story-dashboard { margin: 0 0 4.6rem; padding: clamp(1.4rem, 3vw, 2.3rem); border: 1px solid var(--line); background: rgba(255, 248, 233, .72); box-shadow: 0 10px 28px rgba(52, 42, 25, .08); }
.state-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.25rem; }
.state-head h2 { margin: .1rem 0 .3rem; font-size: clamp(1.45rem, 3vw, 2.2rem); }
.state-intro { max-width: 45rem; margin: 0; color: var(--ink-soft); font-size: .9rem; }
.state-live { display: flex; min-width: 9rem; flex-direction: column; align-items: flex-end; color: var(--jade); font-size: .84rem; }
.state-live small { color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: .08em; }
.live-dot, .state-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #66875f; box-shadow: 0 0 0 5px rgba(102, 135, 95, .14); vertical-align: middle; }
.live-dot { margin-right: .42rem; }
.state-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 1.35rem 0; }
.meta-pill { display: inline-flex; min-height: 4.3rem; flex-direction: column; justify-content: center; padding: .55rem .75rem; border: 1px solid var(--line); background: rgba(255,255,255,.5); }
.meta-pill b { color: var(--jade-deep); font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.meta-pill small { color: var(--muted); font-size: .67rem; letter-spacing: .08em; }
.state-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.state-card { min-height: 11.5rem; padding: 1.2rem; border: 1px solid var(--line); background: rgba(250, 244, 228, .82); }
.state-card h3 { margin: .28rem 0 .5rem; font-size: 1.18rem; }
.state-card p { margin-bottom: 0; color: var(--ink-soft); font-size: .86rem; line-height: 1.8; }
.card-kicker { margin: 0 !important; color: var(--rust) !important; font: 10px ui-monospace, monospace !important; letter-spacing: .13em; text-transform: uppercase; }
.state-card-foot, .state-footnote { display: flex; justify-content: space-between; gap: 1rem; padding-top: .75rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .75rem; }
.state-card-foot { margin-top: 1rem; }
.state-card-foot a { color: var(--rust); text-decoration: underline; text-underline-offset: .2em; }
.state-list { display: grid; gap: .45rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.state-list li { display: flex; gap: .55rem; align-items: flex-start; font-size: .84rem; }
.state-marker { width: .42rem; height: .42rem; flex: 0 0 auto; margin-top: .55rem; border-radius: 50%; background: var(--gold); }
.state-avatar { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; flex: 0 0 auto; color: var(--rust); border: 1px solid var(--line-strong); border-radius: 50%; font-size: .74rem; }
.state-list li small { display: block; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.thread-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.thread-columns ul { margin: .45rem 0 0; padding-left: 1.05rem; color: var(--ink-soft); font-size: .76rem; line-height: 1.7; }
.state-production { display: flex; flex-direction: column; align-items: flex-start; }
.production-badge { display: inline-block; margin-top: auto; padding: .22rem .5rem; color: var(--muted); border: 1px solid var(--line-strong); font: 10px ui-monospace, monospace; letter-spacing: .08em; }
.state-footnote { margin-top: 1rem; padding-top: .8rem; border-top-style: solid; }
.state-footnote span:last-child { text-align: right; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 2px solid var(--line-strong); }
.section-heading h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.1rem); }
.archive-rail, .reading-deck { margin-top: 4.5rem; }
.archive-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.archive-nav-card { display: flex; align-items: center; gap: .7rem; min-height: 96px; padding: 1rem; border: 1px solid var(--line); background: rgba(255, 249, 232, .7); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.archive-nav-card:hover { transform: translateY(-3px); border-color: var(--jade); background: var(--paper-light); }
.archive-nav-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: .18rem; }
.archive-nav-card b { color: var(--jade-deep); font-size: 1.03rem; font-weight: 600; }
.archive-nav-card small { color: var(--muted); font-size: .72rem; }
.archive-nav-card i { margin-left: auto; color: var(--rust); font-style: normal; }
.nav-glyph { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; color: var(--jade); border: 1px solid currentColor; border-radius: 50%; font-size: .83rem; }
.tone-amber .nav-glyph { color: #966c3b; }
.tone-red .nav-glyph { color: var(--rust); }
.tone-ink .nav-glyph { color: #425b54; }
.chapter-grid, .catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 1.2rem 0; padding: 0; list-style: none; }
.chapter-card { border: 1px solid var(--line); background: rgba(255,249,233,.66); }
.chapter-card:hover { border-color: var(--jade); }
.chapter-card a { display: grid; grid-template-columns: 3.5rem 1fr auto; gap: .7rem; align-items: center; min-height: 6.8rem; padding: .9rem 1rem; }
.card-index { color: var(--rust); font: .73rem ui-monospace, monospace; letter-spacing: .06em; }
.card-body { display: flex; min-width: 0; flex-direction: column; }
.card-body b { color: var(--jade-deep); font-weight: 600; }
.card-body small { color: var(--muted); font-size: .72rem; }
.card-arrow { color: var(--rust); }
.archive-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 4.5rem; padding: 1.25rem 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.status-copy { display: flex; align-items: center; gap: .7rem; color: var(--jade); font-size: .83rem; }
.status-copy small { display: block; color: var(--muted); font-size: .72rem; }
.status-metrics { display: flex; flex-wrap: wrap; gap: .55rem; }
.status-metrics .meta-pill { min-width: 4.5rem; min-height: 3.5rem; }

.page-intro { padding: 2rem 0 1.6rem; border-bottom: 2px solid var(--line-strong); }
.page-intro h1, .world-intro h1 { max-width: none; margin-bottom: .55rem; font-size: clamp(2.7rem, 6vw, 5.5rem); }
.page-intro p:not(.eyebrow), .world-intro p:not(.eyebrow) { max-width: 45rem; color: var(--ink-soft); }
.catalog-toolbar, .toolbar, .pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .8rem; }
.catalog-toolbar { margin: 1.2rem 0; }
.catalog .chapter-card a { min-height: 7rem; }
.reader-shell { max-width: 850px; margin: 0 auto; padding-bottom: 4rem; }
.reader-shell .toolbar { margin-bottom: 2rem; }
.reader { font-size: 1.04rem; }
.reader h1 { margin: .55rem 0 .35rem; font-size: clamp(2.35rem, 6vw, 4.8rem); }
.reader h2, .reader h3 { margin-top: 2.2rem; }
.reader p { margin: 1rem 0; line-height: 2.06; text-indent: 2em; }
.reader blockquote { margin: 1.5rem 0; padding: .45rem 1.3rem; color: var(--ink-soft); border-left: 3px solid var(--rust); background: rgba(255,255,255,.22); }
.reader img { max-width: 100%; }
.chapter-kicker { color: var(--rust); font: 10px ui-monospace, monospace; letter-spacing: .12em; }
.meta { color: var(--muted); font-size: .82rem; }
.pager { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pager a { color: var(--jade); text-decoration: underline; text-decoration-color: rgba(31,81,69,.35); text-underline-offset: .2em; }

.world-intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding: 2rem 0; border-bottom: 2px solid var(--line-strong); }
.world-seal { display: grid; place-content: center; width: 112px; height: 112px; flex: 0 0 auto; color: var(--rust); border: 1px solid var(--rust); border-radius: 50%; text-align: center; font-size: .82rem; line-height: 1.4; transform: rotate(8deg); }
.world-seal small { font: 9px ui-monospace, monospace; letter-spacing: .1em; }
.world-console { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.25rem 0; }
.archive-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.archive-tab { display: flex; align-items: center; gap: .48rem; padding: .62rem .85rem; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; font-size: .82rem; }
.archive-tab:hover, .archive-tab[aria-selected="true"], .archive-tab.is-active { color: var(--jade-deep); border-bottom-color: var(--rust); background: rgba(255,255,255,.27); }
.archive-tab small { color: var(--muted); font: 10px ui-monospace, monospace; }
.archive-search { display: flex; align-items: center; gap: .5rem; min-width: 250px; padding: .25rem .2rem; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.archive-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .82rem; }
.world-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; padding-bottom: 4rem; }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 1.55rem; }
.result-count { color: var(--muted); font: 10px ui-monospace, monospace; }
.archive-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 0; padding: 0; list-style: none; }
.archive-entry { min-height: 9rem; padding: 1rem; border: 1px solid var(--line); background: rgba(255,249,233,.66); }
.archive-entry h3 { margin: .45rem 0 .2rem; font-size: 1.02rem; }
.archive-entry p { margin: 0; color: var(--ink-soft); font-size: .82rem; }
.archive-entry small { color: var(--muted); font-size: .72rem; }
.entry-index { color: var(--rust); font: .68rem ui-monospace, monospace; }
.event-entry { border-left: 3px solid var(--rust); }
.world-aside { display: flex; flex-direction: column; gap: .7rem; }
.aside-card { padding: 1.2rem; border: 1px solid var(--line); background: rgba(255,249,233,.7); }
.aside-card h2 { margin-bottom: .5rem; font-size: 1.3rem; }
.aside-card p:not(.eyebrow) { color: var(--ink-soft); font-size: .82rem; }
.aside-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: 1.1rem 0 0; }
.aside-card dl div { padding-top: .4rem; border-top: 1px solid var(--line); }
.aside-card dt { color: var(--muted); font-size: .7rem; }
.aside-card dd { margin: 0; color: var(--jade-deep); font-size: 1.3rem; }
.quote-card { display: flex; gap: .55rem; align-items: flex-start; }
.quote-card > span { color: var(--rust); font-size: 2.6rem; line-height: .8; }
.quote-card p { margin: 0; }
.empty-state, .empty { grid-column: 1 / -1; padding: 2rem; color: var(--muted); border: 1px dashed var(--line-strong); text-align: center; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

footer { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding: 1.5rem clamp(1rem, 5vw, 5.5rem); color: var(--muted); border-top: 1px solid var(--line-strong); font-size: .75rem; letter-spacing: .08em; }
footer b { color: var(--rust); font-weight: 400; }
footer small { margin-left: auto; letter-spacing: .04em; }
.error { padding: 2rem; border: 1px solid var(--rust); background: rgba(166,73,56,.08); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 2.2rem; }
  .hero-cover-wrap { width: min(100%, 270px); }
  .hero-copy { text-align: center; }
  .hero-copy .lead { margin-right: auto; margin-left: auto; }
  .hero-actions { justify-content: center; }
  .archive-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state-head { display: block; }
  .state-live { align-items: flex-start; margin-top: 1rem; }
  .world-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .top { align-items: flex-start; flex-direction: column; gap: .5rem; padding-top: 1rem; }
  .top nav { width: 100%; height: 44px; justify-content: space-between; gap: .3rem; }
  .top nav a { font-size: .75rem; }
  .top nav a::after { bottom: 3px; }
  main { width: min(100% - 1.25rem, 1180px); padding-top: 1.2rem; }
  .hero { padding: 1.45rem; margin-bottom: 3rem; }
  .hero-copy h1 { font-size: clamp(3rem, 16vw, 4.8rem); }
  .story-dashboard { margin-bottom: 3rem; }
  .state-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state-grid, .chapter-grid, .catalog, .archive-list { grid-template-columns: 1fr; }
  .archive-nav { grid-template-columns: 1fr; }
  .archive-status, .world-console, .world-intro { align-items: flex-start; flex-direction: column; }
  .archive-search { width: 100%; min-width: 0; }
  .world-seal { align-self: flex-end; }
  .thread-columns { grid-template-columns: 1fr; }
  .state-footnote { display: block; }
  .state-footnote span { display: block; }
  .state-footnote span:last-child { margin-top: .4rem; text-align: left; }
  footer small { width: 100%; margin-left: 0; }
}
@media (max-width: 400px) {
  .top nav a { letter-spacing: .06em; }
  .hero-title-sub { letter-spacing: .14em; }
  .state-metrics { gap: .45rem; }
  .meta-pill { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* Reference-style home: straight paper cards, six archive entries, no tilted artwork. */
.reference-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(300px, .96fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; min-height: 430px; margin: .6rem 0 3.8rem; padding: clamp(2rem, 5vw, 4rem); overflow: hidden; border: 1px solid var(--line-strong); background: linear-gradient(116deg, rgba(255,249,232,.96), rgba(239,221,183,.9)); box-shadow: var(--shadow); }
.reference-hero::before { content: ""; position: absolute; inset: .65rem; border: 1px solid var(--line-strong); pointer-events: none; }
.reference-hero::after { content: "荷"; position: absolute; right: 12%; bottom: -4rem; color: rgba(166,73,56,.09); font: 18rem/1 "STKaiti", "KaiTi", serif; pointer-events: none; }
.reference-hero-copy, .reference-hero-art { position: relative; z-index: 1; }
.reference-hero-copy { padding-left: clamp(0rem, 2vw, 1.5rem); }
.reference-hero h1 { margin: .2rem 0 .2rem; color: var(--jade-deep); font-size: clamp(3.8rem, 8vw, 6.4rem); }
.reference-work { margin-bottom: 1rem; color: var(--rust); font-size: clamp(1.1rem, 2vw, 1.4rem); letter-spacing: .28em; }
.reference-soul { max-width: 38rem; margin-bottom: .65rem; color: var(--jade); font-size: 1.12rem; letter-spacing: .08em; }
.reference-lede { max-width: 38rem; color: var(--ink-soft); font-size: 1rem; }
.reference-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.55rem 0 .7rem; }
.reference-hero-art { width: 100%; margin: 0; padding: .7rem; border: 1px solid var(--line-strong); background: rgba(225,205,161,.66); box-shadow: 0 13px 26px rgba(52,42,25,.17); transform: none !important; }
.reference-hero-art img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 46%; border: 1px solid rgba(255,248,228,.8); transform: none !important; filter: sepia(.16) saturate(.86) contrast(.98); }
.reference-hero-art figcaption { padding: .65rem .2rem .05rem; color: var(--muted); font-size: .72rem; letter-spacing: .15em; text-align: right; }
.reference-section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; border-bottom: 2px solid var(--line-strong); }
.reference-section-head h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.reference-entries { margin: 0 0 3.8rem; }
.reference-entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin: 1.15rem 0 0; padding: 0; list-style: none; }
.reference-entry-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto 8.1rem; gap: .4rem .7rem; min-height: 14rem; padding: .95rem; overflow: hidden; border: 1px solid var(--line); background: rgba(255,249,232,.78); box-shadow: 0 8px 18px rgba(52,42,25,.07); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.reference-entry-card::before { content: ""; position: absolute; inset: .35rem; border: 1px solid var(--line-strong); pointer-events: none; }
.reference-entry-card:hover { transform: translateY(-3px); border-color: var(--jade); box-shadow: 0 14px 24px rgba(52,42,25,.14); }
.entry-number { position: relative; z-index: 1; display: grid; place-items: center; width: 2.15rem; height: 2.15rem; color: #fff8e8; border-radius: 50%; background: var(--rust); font: 700 .86rem/1 ui-monospace, monospace; }
.entry-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 2.15rem; height: 2.15rem; justify-self: end; color: var(--jade); border: 1px solid currentColor; border-radius: 50%; font-size: .8rem; }
.entry-copy { position: relative; z-index: 1; grid-column: 1 / -1; display: flex; flex-direction: column; padding: .2rem .1rem 0; }
.entry-copy b { color: var(--jade-deep); font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif; font-size: 1.65rem; font-weight: 600; letter-spacing: .1em; }
.entry-copy small { color: var(--ink-soft); font-size: .76rem; }
.entry-art { position: relative; z-index: 1; grid-column: 1 / -1; align-self: end; height: 8.1rem; overflow: hidden; border: 1px solid var(--line-strong); background-color: #c3b78e; background-repeat: no-repeat; background-size: cover; background-position: center; }
.entry-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(248,239,213,.02), rgba(22,53,44,.28)); pointer-events: none; }
.entry-art span { position: absolute; z-index: 1; right: .7rem; bottom: .45rem; color: rgba(255,248,228,.92); font-size: .74rem; letter-spacing: .14em; text-shadow: 0 1px 4px rgba(14,40,32,.7); }
.entry-read .entry-art { background-image: linear-gradient(120deg, rgba(29,75,62,.25), rgba(166,73,56,.05)), url("cover.svg"); background-position: center 60%; }
.entry-catalog .entry-art { background-image: linear-gradient(120deg, rgba(217,194,139,.2), rgba(67,76,65,.22)), url("cover.svg"); background-position: 22% 30%; filter: sepia(.22) saturate(.68); }
.entry-characters .entry-art { background-image: linear-gradient(120deg, rgba(33,65,58,.16), rgba(166,73,56,.18)), url("cover.svg"); background-position: 70% 38%; filter: hue-rotate(11deg) saturate(.78); }
.entry-places .entry-art { background-image: linear-gradient(120deg, rgba(129,102,57,.18), rgba(31,81,69,.18)), url("cover.svg"); background-position: 50% 18%; filter: sepia(.32) saturate(.76); }
.entry-events .entry-art { background-image: linear-gradient(120deg, rgba(117,47,38,.18), rgba(24,42,39,.24)), url("cover.svg"); background-position: 78% 68%; filter: sepia(.28) contrast(1.05); }
.entry-props .entry-art { background-image: linear-gradient(120deg, rgba(172,128,64,.18), rgba(29,75,62,.2)), url("cover.svg"); background-position: 30% 76%; filter: sepia(.35) saturate(.72); }
.entry-catalog .entry-icon, .entry-props .entry-icon { color: #91683a; }
.entry-events .entry-icon { color: var(--rust); }

/* Keep every artwork rectangular and aligned, including the legacy cover component. */
.cover, .cover img, .cover-frame, .cover-frame img { transform: none !important; }

@media (max-width: 860px) {
  .reference-hero { grid-template-columns: 1fr; gap: 2rem; }
  .reference-hero-copy { text-align: center; padding-left: 0; }
  .reference-lede { margin-right: auto; margin-left: auto; }
  .reference-actions { justify-content: center; }
  .reference-hero-art { width: min(100%, 34rem); justify-self: center; }
  .reference-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .reference-hero { margin-top: .35rem; padding: 1.45rem; }
  .reference-hero h1 { font-size: clamp(3.4rem, 18vw, 5rem); }
  .reference-work { letter-spacing: .16em; }
  .reference-entry-grid { grid-template-columns: 1fr; }
  .reference-entry-card { min-height: 13.4rem; }
}

/* A quieter archive masthead, closer to the printed-reference layout. */
.top { position: relative; min-height: 142px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; gap: .65rem 2rem; padding: 1.25rem clamp(1rem, 5vw, 5.5rem) .7rem; color: var(--jade-deep); background: linear-gradient(104deg, #f6e8c9 0%, #f8edd9 58%, #e6d3aa 100%); border-bottom: 2px solid var(--line-strong); box-shadow: 0 8px 18px rgba(52,42,25,.09); }
.top::before { content: ""; position: absolute; inset: 0; opacity: .28; pointer-events: none; background: radial-gradient(circle at 84% 25%, rgba(188,134,77,.34), transparent 20%), repeating-linear-gradient(174deg, transparent 0 2.2rem, rgba(136,119,85,.16) 2.25rem 2.3rem, transparent 2.35rem 4.5rem); }
.top > * { position: relative; z-index: 1; }
.brand { color: var(--jade-deep); font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: .28em; }
.brand-mark { color: var(--rust); border-color: var(--rust); }
.top nav { grid-column: 1 / -1; display: flex; align-items: stretch; justify-content: space-between; gap: .55rem; width: 100%; height: auto; padding-top: .65rem; border-top: 1px solid var(--line); }
.top nav a { min-width: 6rem; justify-content: center; padding: .38rem .75rem .45rem; color: var(--ink-soft); border: 1px solid transparent; font-size: .84rem; letter-spacing: .13em; }
.top nav a::after { bottom: -.1rem; height: 3px; background: var(--rust); }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--jade-deep); border-color: var(--line); background: rgba(255,249,232,.54); }

@media (max-width: 650px) {
  .top { min-height: 128px; display: flex; align-items: flex-start; flex-direction: column; gap: .6rem; padding-top: 1rem; }
  .top nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; width: 100%; padding-top: .55rem; }
  .top nav a { min-width: 0; padding-right: .18rem; padding-left: .18rem; font-size: .7rem; letter-spacing: .04em; }
}


.desk-home { margin: 2.4rem 0 2.8rem; }
.desk-disclaimer { max-width: 42rem; color: var(--muted); font-size: .9rem; }
.desk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin: 1.15rem 0 0; padding: 0; list-style: none; }
.desk-card { border: 1px solid var(--line); background: rgba(255,249,233,.72); }
.desk-card:hover { border-color: var(--jade); }
.desk-card a { display: flex; min-height: 12.4rem; flex-direction: column; gap: .5rem; padding: 1.15rem 1.2rem 1rem; }
.desk-kicker { color: var(--rust); font-size: .72rem; letter-spacing: .16em; }
.desk-card b { color: var(--jade-deep); font-size: 1.38rem; letter-spacing: .14em; }
.desk-card small { color: var(--ink-soft); line-height: 1.65; }
.desk-foot { margin-top: auto; color: var(--muted); font-size: .75rem; letter-spacing: .06em; }
.desk-reader .reader p { text-indent: 0; }
.desk-reader .reader h2 { font-size: 1.28rem; letter-spacing: .08em; }
.desk-reader .reader h3 { font-size: 1.02rem; color: var(--rust); }
.desk-reader .reader hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.desk-reader .reader .note { margin: 1rem 0; padding: .75rem 1rem; color: var(--ink-soft); border: 1px dashed var(--line); background: rgba(255,255,255,.28); }
@media (max-width: 820px) { .desk-grid { grid-template-columns: 1fr; } }
