:root {
    --ink: #090807;
    --ink-soft: #12100e;
    --paper: #d8d0bf;
    --paper-muted: #aaa292;
    --gold: #c7a44c;
    --gold-bright: #e0bf68;
    --cinnabar: #951d17;
    --line: rgba(199, 164, 76, 0.24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--paper);
    background:
        radial-gradient(circle at 16% 14%, rgba(124, 27, 19, 0.14), transparent 31rem),
        radial-gradient(circle at 86% 32%, rgba(166, 125, 42, 0.07), transparent 28rem),
        var(--ink);
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.85;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 8, 7, 0.9);
    backdrop-filter: blur(14px);
}

.site-header .wrap {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { text-decoration: none; font: 700 20px/1 "Noto Serif SC", serif; letter-spacing: .08em; }
.brand span { color: var(--gold); }

.site-nav { display: flex; gap: 24px; font-size: 14px; color: var(--paper-muted); }
.site-nav a { text-decoration: none; transition: color .2s ease; }
.site-nav a:hover { color: var(--gold-bright); }

.hero {
    min-height: 78vh;
    position: relative;
    display: grid;
    align-items: end;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(9, 8, 7, .96) 0%, rgba(9, 8, 7, .78) 43%, rgba(9, 8, 7, .18) 72%),
        linear-gradient(0deg, var(--ink) 0%, transparent 42%),
        url("../images/Dai_Jin._The_Night_Excursion_of_Zhong_Kui._189,7x120,2._Palace_Museum,_Beijing.jpg") 79% 23% / cover no-repeat;
    filter: saturate(.65) contrast(1.08);
}

.hero-content { position: relative; z-index: 1; padding: 112px 0 96px; max-width: 720px; }
.eyebrow { color: var(--gold); letter-spacing: .28em; font-size: 13px; font-weight: 700; text-transform: uppercase; }

h1, h2, h3, blockquote { font-family: "Noto Serif SC", "Songti SC", serif; }
h1 { margin: 18px 0 24px; color: #f2eadb; font-size: clamp(48px, 8vw, 96px); line-height: 1.05; letter-spacing: .06em; }
.hero-lead { max-width: 650px; margin: 0; color: #d4ccbd; font-size: clamp(18px, 2vw, 23px); line-height: 1.75; }

.hero-meta { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta span { border: 1px solid var(--line); padding: 7px 12px; color: var(--paper-muted); font-size: 13px; background: rgba(9, 8, 7, .48); }

main section { padding: 104px 0; }
.section-dark { background: rgba(255, 255, 255, .018); border-block: 1px solid rgba(255, 255, 255, .035); }
.section-head { display: grid; grid-template-columns: 190px 1fr; gap: 58px; margin-bottom: 54px; }
.section-kicker { color: var(--cinnabar); font-weight: 700; letter-spacing: .18em; font-size: 13px; }
.section-head h2 { margin: 0 0 18px; color: #eee5d4; font-size: clamp(32px, 4.3vw, 55px); line-height: 1.25; }
.section-head p { max-width: 760px; margin: 0; color: var(--paper-muted); font-size: 17px; }

.editor-note {
    display: grid;
    grid-template-columns: 9px 1fr;
    gap: 24px;
    padding: 30px 34px;
    border: 1px solid var(--line);
    background: linear-gradient(120deg, rgba(149, 29, 23, .11), rgba(199, 164, 76, .035));
}
.editor-note::before { content: ""; background: var(--cinnabar); }
.editor-note strong { color: var(--gold-bright); }
.editor-note p { margin: 0; }

.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.identity-card { min-height: 280px; padding: 34px; border: 1px solid var(--line); background: rgba(18, 16, 14, .74); position: relative; overflow: hidden; }
.identity-card::after { content: attr(data-no); position: absolute; right: 18px; bottom: -26px; color: rgba(199,164,76,.055); font: 700 112px/1 Georgia, serif; }
.identity-card h3 { color: #eee5d4; font-size: 25px; margin: 16px 0 12px; }
.identity-card p { color: var(--paper-muted); margin: 0; }
.identity-card .label { color: var(--gold); font-size: 12px; letter-spacing: .18em; }

.timeline { position: relative; margin-left: 10px; }
.timeline::before { content: ""; position: absolute; left: 114px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.timeline-item { display: grid; grid-template-columns: 84px 1fr; gap: 62px; padding: 0 0 44px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-era { color: var(--gold); font-family: "Noto Serif SC", serif; font-size: 17px; text-align: right; }
.timeline-copy::before { content: ""; position: absolute; left: 98px; top: 7px; width: 33px; height: 1px; background: var(--gold); }
.timeline-copy h3 { margin: -8px 0 10px; color: #eee5d4; font-size: 23px; }
.timeline-copy p { margin: 0; color: var(--paper-muted); }

.ritual-flow { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); }
.ritual-step { min-height: 210px; padding: 27px 24px; border-right: 1px solid var(--line); }
.ritual-step:last-child { border-right: 0; }
.ritual-step b { display: block; color: var(--cinnabar); font: 700 13px/1 "Noto Sans SC", sans-serif; letter-spacing: .12em; }
.ritual-step h3 { color: #eee5d4; margin: 20px 0 11px; font-size: 21px; }
.ritual-step p { color: var(--paper-muted); font-size: 14px; line-height: 1.7; margin: 0; }
.flow-note { color: #817b70; font-size: 13px; margin: 16px 0 0; }

.tradition-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.tradition-feature, .tradition-side article { border: 1px solid var(--line); background: rgba(18, 16, 14, .72); }
.tradition-feature { padding: 42px; min-height: 510px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.tradition-feature::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(9,8,7,.98) 7%, rgba(9,8,7,.46) 76%), url("../images/Zhong_Kui_the_Demon_Queller_with_Five_Bats.jpg") center 31% / cover; opacity: .5; }
.tradition-feature > * { position: relative; }
.tradition-feature h3, .tradition-side h3 { color: #eee5d4; font-size: 27px; margin: 10px 0 13px; }
.tradition-feature p, .tradition-side p { color: var(--paper-muted); margin: 0; }
.tradition-side { display: grid; gap: 18px; }
.tradition-side article { padding: 34px; }
.tag { color: var(--gold); font-size: 12px; letter-spacing: .18em; }

.symbol-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.symbol { border-top: 1px solid var(--gold); padding-top: 22px; }
.symbol h3 { color: #eee5d4; font-size: 22px; margin: 0 0 10px; }
.symbol p { color: var(--paper-muted); font-size: 14px; margin: 0; }

.figure-row { display: grid; grid-template-columns: 1.1fr .9fr .9fr; gap: 18px; margin-top: 60px; align-items: end; }
.figure-row figure { margin: 0; }
.figure-row img { width: 100%; height: 420px; object-fit: cover; object-position: top; filter: saturate(.7) sepia(.08); border: 1px solid var(--line); }
.figure-row figure:first-child img { height: 520px; }
.figure-row figcaption { color: #817b70; font-size: 12px; line-height: 1.55; margin-top: 10px; }

.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; }
.faq details { border-top: 1px solid var(--line); padding: 22px 0; }
.faq details:last-child, .faq details:nth-last-child(2) { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; color: #eee5d4; font: 700 18px/1.5 "Noto Serif SC", serif; }
.faq details p { color: var(--paper-muted); margin: 14px 0 0; }

.sources { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.source-link { padding: 18px 20px; border: 1px solid var(--line); text-decoration: none; color: var(--paper-muted); transition: .2s ease; }
.source-link:hover { color: var(--gold-bright); border-color: var(--gold); transform: translateY(-2px); }
.source-link small { display: block; margin-top: 4px; color: #777064; }

.site-footer { border-top: 1px solid var(--line); padding: 36px 0; color: #777064; font-size: 13px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; }
.site-footer a { color: var(--gold); text-decoration: none; }

@media (max-width: 860px) {
    .site-nav a:not(:last-child) { display: none; }
    .hero { min-height: 700px; }
    .hero::before { background: linear-gradient(0deg, var(--ink) 4%, rgba(9,8,7,.45) 70%, rgba(9,8,7,.65)), url("../images/Dai_Jin._The_Night_Excursion_of_Zhong_Kui._189,7x120,2._Palace_Museum,_Beijing.jpg") 58% 15% / cover no-repeat; opacity: .8; }
    .hero-content { padding: 310px 0 70px; }
    main section { padding: 76px 0; }
    .section-head { grid-template-columns: 1fr; gap: 10px; }
    .identity-grid, .tradition-grid, .faq { grid-template-columns: 1fr; }
    .ritual-flow { grid-template-columns: 1fr; }
    .ritual-step { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .ritual-step:last-child { border-bottom: 0; }
    .symbol-grid { grid-template-columns: 1fr 1fr; }
    .figure-row { grid-template-columns: 1fr 1fr; }
    .figure-row figure:first-child { grid-column: 1 / -1; }
    .figure-row figure:first-child img, .figure-row img { height: 420px; }
    .sources { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .wrap { width: min(100% - 28px, 1160px); }
    .hero-content { padding-top: 280px; }
    .identity-card, .tradition-feature, .tradition-side article { padding: 26px; }
    .timeline::before { left: 14px; }
    .timeline-item { grid-template-columns: 1fr; gap: 9px; padding-left: 42px; }
    .timeline-era { text-align: left; }
    .timeline-copy::before { left: 0; top: 9px; width: 29px; }
    .timeline-copy h3 { margin-top: 0; }
    .symbol-grid, .figure-row { grid-template-columns: 1fr; }
    .figure-row figure:first-child { grid-column: auto; }
    .faq details:nth-last-child(2) { border-bottom: 0; }
    .site-footer .wrap { flex-direction: column; }
}
