/* Digital garden — editorial layout, lightweight motion, original imagery. */
:root {
    --paper: #f6f4ed;
    --paper-soft: #eeece3;
    --surface: #faf9f4;
    --ink: #303f39;
    --ink-soft: #626e65;
    --ink-faint: #6f776d;
    --accent: #62755c;
    --accent-soft: #e7eadf;
    --amber: #967746;
    --seal: #9c5e4f;
    --line: #dedfd4;
    --line-strong: #c4cbbe;
    --content-width: 1180px;
    --radius-card: 4px;
    --shadow-card: none;
    --shadow-card-hover: 0 10px 28px #172b240b;
    --page-padding: clamp(24px, 5vw, 80px);
}
html.theme-dark {
    --paper: #111d1b;
    --paper-soft: #172522;
    --surface: #1b2c27;
    --ink: #e7eade;
    --ink-soft: #afbcaf;
    --ink-faint: #93a494;
    --accent: #bed09d;
    --accent-soft: #283b2d;
    --amber: #d8bc7e;
    --seal: #cc9480;
    --line: #2c3e36;
    --line-strong: #42584b;
    --shadow-card-hover: 0 14px 28px #0003;
}
[hidden] { display: none !important; }
::selection { color: var(--paper); background: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 200; padding: 12px 18px; background: var(--ink); color: var(--paper); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { box-shadow: 0 6px 25px #16282006; }
.header-inner { max-width: 1340px; margin: auto; }
.nav-link { min-height: 44px; }
.theme-toggle { width: 40px; height: 40px; background: transparent; border: 1px solid var(--line-strong); }
.material-symbols-rounded { display: inline-flex; align-items: center; justify-content: center; }
.material-symbols-rounded svg { width: 1em; height: 1em; flex-shrink: 0; }
.brand img, .masthead-brand img { mix-blend-mode: multiply; }
html.theme-dark .masthead-brand img { background: #fff; border-radius: 50%; mix-blend-mode: normal; }
.hero {
    --hero-inset: max(5vw, calc((100vw - 1440px) / 2));
    display: grid; grid-template-columns: minmax(0, 34fr) minmax(0, 66fr); column-gap: 0;
    grid-template-rows: 100px minmax(520px, 1fr) 76px;
    min-height: 100svh; max-width: none; margin: auto;
    padding: 0 var(--hero-inset); overflow: hidden;
}
.hero-masthead { position: relative; z-index: 5; grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; height: 100px; }
.masthead-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 27px; font-weight: 650; text-decoration: none; letter-spacing: -.7px; }
.brand-dot, .footer-signoff > a span { color: var(--accent); }
.masthead-note { margin-left: auto; color: var(--ink-soft); letter-spacing: .22em; font-size: 11px; text-align: right; line-height: 1.8; }
.masthead-note small { display: block; font-size: 8px; letter-spacing: .15em; color: var(--ink-faint); }
.hero-copy { position: relative; top: auto; left: auto; align-self: center; width: auto; transform: none; padding: 32px 0; }
.hero-preface { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.journal-seal { display: grid; grid-template-rows: 1fr 1fr; place-items: center; width: 27px; height: 45px; padding: 4px 2px; border: 1px solid var(--seal); border-radius: 2px; color: var(--seal); font: 15px/1 "Noto Serif SC", "Songti SC", serif; flex-shrink: 0; transform: rotate(-3deg); }
.hero-kicker { font-size: clamp(23px, 2vw, 29px); margin: 0; letter-spacing: .16em; color: var(--amber); }
.hero h1 { font-size: clamp(48px, 4.8vw, 80px); line-height: 1.28; font-weight: 500; letter-spacing: -.035em; max-width: none; text-wrap: initial; }
.hero h1 > span { display: block; white-space: nowrap; }
.title-accent { color: var(--accent); }
.title-period { margin-left: -.14em; }
.hero-note { margin: 26px 0 0; font-size: 14px; line-height: 2.05; letter-spacing: .045em; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 30px; }
.primary-action { display: inline-flex; gap: 32px; align-items: center; padding: 15px 22px; color: var(--paper); background: var(--ink); font-size: 13px; border-radius: 3px; text-decoration: none; transition: background .2s, transform .2s; }
.primary-action span { font-size: 21px; line-height: 1; }
.primary-action:hover { background: var(--accent); transform: translateY(-2px); }
.text-action { padding: 12px 0; color: var(--ink-soft); background: none; font-size: 13px; cursor: pointer; }
.text-action span { margin-left: 8px; }
.text-action:hover { color: var(--accent); }
.hero-footnote { display: flex; align-items: center; gap: 8px; margin: 26px 0 0; color: var(--ink-faint); font-size: 11px; letter-spacing: .05em; }
.hero-footnote > span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hero-art {
    position: absolute; z-index: 2; top: 0; right: 0; bottom: 0;
    width: 76vw; height: 100%; min-height: 0; max-height: none; margin: 0;
    overflow: hidden; border-radius: 0; transform: none;
    /* Keep the original brush texture on the edge, with the landscape fully visible beyond it. */
    -webkit-mask-image: url("../img/hero-brush-mask.webp?v=20260731v1"), linear-gradient(to right, transparent 35.8%, #000 36%);
    mask-image: url("../img/hero-brush-mask.webp?v=20260731v1"), linear-gradient(to right, transparent 35.8%, #000 36%);
    -webkit-mask-size: 36% 100%, 100% 100%; mask-size: 36% 100%, 100% 100%;
    -webkit-mask-position: left center; mask-position: left center;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    animation: garden-art-reveal 650ms ease-out 80ms backwards;
    background: transparent;
}
.hero-art::after {
    inset: 0; height: auto; z-index: 1;
    /* Feather the brush into the paper without shrinking or reframing the landscape. */
    background:
        linear-gradient(90deg, var(--paper), color-mix(in srgb, var(--paper) 78%, transparent) 12%, color-mix(in srgb, var(--paper) 24%, transparent) 28%, transparent 46%),
        linear-gradient(180deg, var(--paper), color-mix(in srgb, var(--paper) 38%, transparent) 12%, transparent 30%, transparent 70%, color-mix(in srgb, var(--paper) 38%, transparent) 88%, var(--paper)),
        linear-gradient(0deg, #10251f70, transparent 48%);
}
.hero-image { object-fit: cover; object-position: center; }
.hero-image-day { filter: saturate(.7) contrast(.9) brightness(1.04); }
.hero-image-night { filter: saturate(.8); }
.scene-label { position: absolute; z-index: 2; top: max(120px, 20%); right: var(--hero-inset); color: #fff; font-size: 12px; line-height: 2; letter-spacing: .3em; text-align: right; text-shadow: 0 1px 6px #0008; }
.scene-label span { display: block; opacity: .8; font-size: 8px; }
.hero-poem { left: auto; right: var(--hero-inset); bottom: max(140px, 22%); max-width: min(44vw, 560px); text-align: right; }
.hero-poem::before { content: "此刻 · 一句诗"; display: block; margin-bottom: 16px; font-size: 10px; letter-spacing: .25em; opacity: .85; }
.hero-poem span { font-size: clamp(18px, 1.5vw, 22px); font-weight: 500; line-height: 1.8; }
.hero-poem small { font-size: 11px; line-height: 1.7; margin-top: 8px; }
.hero-bottom { position: relative; z-index: 4; display: flex; grid-column: 1 / -1; grid-row: 3; align-items: center; justify-content: space-between; height: 76px; color: var(--ink-faint); font-size: 10px; letter-spacing: .12em; }
.hero-bottom i { margin: 0 12px; font-style: normal; color: var(--line-strong); }
.explore-link { position: static; flex-direction: row; gap: 18px; font-size: 10px; }
.explore-link > span:last-child { font-size: 20px; }
.explore-link { color: var(--ink-soft); text-shadow: none; }
.directory-section { min-height: 70vh; padding-top: 72px; padding-bottom: 64px; }
.directory-intro { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.directory-label { display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: 11px; letter-spacing: .16em; margin-bottom: 22px; }
.directory-label > span { color: var(--ink-faint); margin-left: 15px; }
.directory-label .chapter-mark { margin: 0; display: grid; place-items: center; width: 28px; height: 28px; color: var(--seal); border: 1px solid var(--seal); font-family: "Noto Serif SC", serif; font-size: 14px; letter-spacing: 0; }
.directory-intro h2 { margin: 0; font-family: "Noto Serif SC", "Songti SC", serif; font-size: clamp(26px, 3vw, 38px); font-weight: 500; line-height: 1.5; }
.directory-intro h2 > span { color: var(--accent); }
.directory-note { margin: 12px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.collection-count { display: flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--ink-soft); }
.collection-count strong { font-size: 42px; font-weight: 400; letter-spacing: -.07em; color: var(--accent); }
.collection-count span { font-size: 11px; writing-mode: vertical-rl; letter-spacing: .14em; }
.directory-tools { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.category-filters button { padding: 11px 15px; border-radius: 3px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 12px; min-height: 42px; transition: background .18s, color .18s; }
.category-filters button:hover { background: var(--accent-soft); color: var(--ink); }
.category-filters button[aria-pressed="true"] { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 -2px var(--accent); }
.category-filters button span { margin-left: 5px; opacity: .65; font-size: 10px; }
.site-search { display: flex; align-items: center; gap: 9px; padding: 0 12px; width: 234px; min-height: 42px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink-faint); background: transparent; flex-shrink: 0; }
.site-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; outline: none; }
.site-search input::placeholder { color: var(--ink-faint); }
.site-search svg { flex-shrink: 0; }
.site-search kbd { font-size: 11px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; }
.cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 22px; }
.nav-card { grid-column: auto; display: flex; flex-direction: column; opacity: 1; transform: none; border: 0; border-radius: 0; color: var(--ink); background: transparent; box-shadow: none; transition: transform .22s ease; }
.nav-card.is-featured { grid-column: auto; }
.card-media, .is-featured .card-media { height: 136px; aspect-ratio: auto; flex-shrink: 0; border-radius: 4px; }
.card-media::after { background: linear-gradient(180deg, #10251f10, transparent 55%, #10251f10); pointer-events: none; }
.card-image { position: absolute; inset: 0; height: 100%; object-fit: cover; filter: saturate(.76); transition: transform .45s ease; }
.card-number { position: absolute; z-index: 2; top: 10px; left: 10px; display: grid; place-items: center; width: 24px; height: 26px; background: var(--paper); color: var(--ink-soft); font: 11px Georgia, serif; border-radius: 1px; }
.card-badge { position: static; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 400; }
.card-arrow { position: static; display: grid; place-items: center; width: 22px; height: 24px; flex-shrink: 0; border: 0; color: var(--ink-soft); background: transparent; font: 16px Inter, sans-serif; transition: color .2s, transform .2s; }
.card-copy { position: relative; inset: auto; flex: 1; display: flex; flex-direction: column; padding: 12px 2px 14px; border-bottom: 1px solid var(--line); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-copy h3, .is-featured h3 { font: 500 18px/1.5 "Noto Serif SC", "Songti SC", serif; text-shadow: none; }
.card-copy p { margin: 5px 0 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; opacity: 1; white-space: normal; overflow: visible; text-shadow: none; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.card-domain { display: none; }
.nav-card:hover, .nav-card:focus-visible { transform: translateY(-2px); box-shadow: none; }
.nav-card:hover .card-image { transform: scale(1.025); }
.nav-card:hover .card-arrow, .nav-card:focus-visible .card-arrow { color: var(--accent); transform: translate(2px, -2px); }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 64px 20px; border-radius: 16px; background: var(--paper-soft); }
.empty-state h3 { font-size: 20px; font-weight: 500; margin: 0 0 10px; }
.empty-state p { color: var(--ink-soft); font-size: 13px; }
.empty-state button { padding: 12px 20px; border-radius: 7px; background: var(--ink); color: var(--paper); cursor: pointer; margin-top: 10px; }
.garden-note { margin-top: 64px; display: flex; align-items: center; gap: 26px; padding: 32px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; }
.garden-symbol { display: grid; place-items: center; width: 42px; height: 52px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 2px; font: 24px "Noto Serif SC", serif; color: var(--seal); }
.garden-note p { margin: 0 0 10px; font: 500 19px/1.6 "Noto Serif SC", serif; }
.garden-note div > span { color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.garden-note button { margin-left: auto; flex-shrink: 0; padding: 12px 0 12px 20px; background: none; color: var(--ink); font-size: 12px; cursor: pointer; }
.garden-note button > span { margin-left: 16px; }
.is-page-view .garden-note { display: none; }
.content-view { animation: none; }
.section-heading h2 { font-weight: 500; }
.site-footer { padding: 0 var(--page-padding) 20px; background: var(--paper); border-top: 0; }
.footer-signoff { max-width: var(--content-width); margin: auto; display: flex; align-items: center; gap: 24px; padding: 30px 0; border-top: 0; }
.footer-signoff > a:first-child { text-decoration: none; font-size: 26px; font-weight: 600; letter-spacing: -.05em; }
.footer-signoff p { color: var(--ink-faint); font-size: 10px; line-height: 1.8; }
.footer-signoff p > span { display: block; }
.footer-top { margin-left: auto; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; text-decoration: none; font-size: 18px; }
.footer-inner { max-width: var(--content-width); padding: 0; font-size: 10px; min-height: 32px; color: var(--ink-faint); }
@media (max-width: 1040px) {
    .hero { grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); }
    .hero h1 { font-size: clamp(40px, 5vw, 52px); }
    .hero-poem { right: var(--hero-inset); max-width: min(46vw, 440px); }
    .hero-poem span { font-size: 17px; }
    .hero-poem small { font-size: 9px; }
    .hero-actions { gap: 16px; }
    .primary-action { padding: 14px 17px; gap: 18px; }
    .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-media, .is-featured .card-media { height: 130px; }
    .directory-tools { flex-wrap: wrap; }
    .site-search { width: 220px; }
}
@media (max-width: 820px) {
    :root { --page-padding: 22px; }
    .hero { --hero-inset: 22px; grid-template-columns: 1fr; grid-template-rows: 78px auto auto 70px; }
    .hero-masthead { height: 78px; gap: 12px; }
    .masthead-brand { font-size: 24px; }
    .masthead-note { font-size: 9px; max-width: 140px; line-height: 1.7; letter-spacing: .09em; text-align: right; }
    .masthead-note small { font-size: 6px; letter-spacing: .05em; }
    .hero-theme { flex-shrink: 0; width: 36px; height: 36px; }
    .hero-copy { width: 100%; padding: 24px 0 32px; left: auto; top: auto; }
    .hero-preface { margin-bottom: 18px; gap: 12px; }
    .hero-kicker { font-size: 24px; margin: 0; }
    .journal-seal { width: 24px; height: 39px; font-size: 13px; }
    .hero h1 { font-size: clamp(42px, 9vw, 62px); line-height: 1.3; max-width: none; }
    .hero h1 > span { display: inline; }
    .hero h1 > span:first-child::after { content: ""; display: block; }
    .hero-note { font-size: 13px; margin-top: 20px; max-width: none; }
    .hero-actions { margin-top: 22px; gap: 24px; }
    .hero-footnote { margin-top: 20px; }
    .hero-art {
        position: relative; top: auto; right: auto; bottom: auto; left: 50%; z-index: 2;
        grid-column: 1 / -1; width: 100vw; height: clamp(220px, 66.6667vw, 440px);
        min-height: 0; max-height: none; margin: 0 0 0 -50vw;
        border-radius: 0; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%);
        mask-image: linear-gradient(to bottom, transparent, #000 18%);
        -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
        -webkit-mask-position: center; mask-position: center;
    }
    .hero-image { object-position: center 56%; }
    .hero-art::after { background: linear-gradient(to bottom, transparent calc(100% - 22px), var(--paper)), linear-gradient(0deg, #10251fa8, transparent 48%); }
    .hero-poem { display: block; left: 24px; right: 24px; bottom: 24px; max-width: none; text-align: left; }
    .hero-poem span { font-size: 16px; }
    .hero-poem small { display: block; font-size: 9px; }
    .hero-poem::before { margin-bottom: 10px; }
    .scene-label { right: 20px; top: 20px; }
    .hero-bottom { grid-row: 4; height: 70px; font-size: 9px; letter-spacing: .06em; }
    .hero-bottom i { margin: 0 7px; }
    .explore-link { align-items: center; font-size: 9px; gap: 8px; }
    .directory-section { padding-top: 54px; padding-bottom: 44px; }
    .directory-intro { gap: 12px; margin-bottom: 24px; }
    .directory-intro h2 { font-size: 25px; }
    .directory-label { font-size: 9px; margin-bottom: 14px; }
    .directory-note { font-size: 12px; max-width: none; text-wrap: pretty; }
    .collection-count { display: none; }
    .directory-tools { gap: 16px; }
    .category-filters { gap: 3px; width: 100%; }
    .category-filters button { padding: 10px 12px; font-size: 11px; flex: 1; white-space: nowrap; }
    .category-filters button span { display: none; }
    .site-search { width: 100%; min-height: 44px; }
    .site-search kbd { display: none; }
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .card-media, .is-featured .card-media { height: 130px; }
    .garden-note { margin-top: 30px; padding: 26px 0; gap: 12px 18px; display: grid; grid-template-columns: 36px minmax(0, 1fr); }
    .garden-symbol { font-size: 21px; width: 36px; height: 46px; }
    .garden-note div { flex: 1; }
    .garden-note p { font-size: 16px; line-height: 1.7; }
    .garden-note button { padding: 8px 0; margin: 0; grid-column: 2; justify-self: start; }
    .footer-signoff { gap: 18px; padding: 24px 0 18px; }
    .footer-inner { align-items: flex-start; flex-direction: column; gap: 8px; padding: 8px 0; }
    .theme-toggle:not(.hero-theme) { width: 32px; height: 32px; }
}
@media (max-width: 560px) {
    .cards-grid { grid-template-columns: 1fr; gap: 0; }
    .nav-card { flex-direction: row; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .card-media, .is-featured .card-media { width: 92px; height: 92px; }
    .card-number { top: 6px; left: 6px; width: 20px; height: 22px; font-size: 10px; }
    .card-copy { min-width: 0; padding: 0; border-bottom: 0; }
    .card-copy h3, .is-featured h3 { font-size: 17px; }
    .card-heading { gap: 5px; }
    .card-copy p { margin: 4px 0 7px; }
    .card-badge { font-size: 10px; }
}
@media (max-width: 360px) {
    :root { --page-padding: 18px; }
    .masthead-note { display: none; }
    .hero-theme { margin-left: auto; }
    .hero h1 { font-size: 42px; }
    .category-filters button { padding: 10px 7px; }
    .hero-actions { gap: 16px; }
}
@media (hover: none), (prefers-reduced-motion: reduce) {
    .nav-card:hover, .nav-card:focus-visible { transform: none; }
    .nav-card:hover .card-image { transform: none; }
}
@keyframes garden-art-reveal {
    from { opacity: 0; transform: translateY(14px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
