/* =========================================================
   bailemen-hub.com.cn — 共享样式表 /assets/site.css
   ========================================================= */

/* ---------- 0. RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; }

ul, ol { list-style: none; padding: 0; }

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

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

/* ---------- 1. TOKENS ---------- */
:root {
  --ink: #0E1A17;
  --ink-deep: #08110E;
  --panel: #12241F;
  --moss: #3E5A4E;
  --gold: #D4AF37;
  --gold-light: #EBD08A;
  --magenta: #E6007E;
  --cobalt: #1B4DFF;
  --ivory: #F4EBDC;
  --stone: #5C6B66;
  --terracotta: #B4653F;

  --font-display: "Songti SC", "Source Han Serif SC", "Noto Serif SC", STSong, SimSun, Georgia, serif;
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, "Courier New", monospace;

  --wrap: 1220px;
  --gutter: clamp(16px, 4vw, 40px);
  --rule: 1px solid rgba(212, 175, 55, 0.28);
  --rule-soft: 1px solid rgba(244, 235, 220, 0.10);
  --shadow-lift: 0 18px 42px -24px rgba(0, 0, 0, 0.9);
  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
}

/* ---------- 2. BASE ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    repeating-linear-gradient(180deg, rgba(244, 235, 220, 0.018) 0 1px, transparent 1px 4px),
    radial-gradient(120% 80% at 8% 0%, rgba(62, 90, 78, 0.44), transparent 56%),
    radial-gradient(90% 60% at 92% 4%, rgba(212, 175, 55, 0.12), transparent 46%);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--ivory);
}

p { max-width: 72ch; }

strong { color: var(--gold-light); }

::selection { background: rgba(230, 0, 126, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 3. UTILITIES ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack > * + * { margin-top: 1.1em; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.text-dim { color: var(--stone); }

.brass-rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.55) 18%, rgba(212, 175, 55, 0.55) 82%, transparent);
}

.band {
  height: 10px;
  margin-block: clamp(28px, 5vw, 56px);
  background: repeating-linear-gradient(90deg, rgba(62, 90, 78, 0.9) 0 28px, rgba(212, 175, 55, 0.65) 28px 30px);
  opacity: 0.7;
}

/* ---------- 4. SKIP LINK ---------- */
.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -220%);
  padding: 10px 22px;
  background: var(--gold);
  color: var(--ink-deep);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: transform 0.22s var(--ease);
}

.skip-link:focus {
  transform: translate(-50%, 0);
  outline-offset: 0;
}

/* ---------- 5. SCROLL PROGRESS ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  background: rgba(212, 175, 55, 0.12);
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--magenta) 68%, var(--cobalt));
}

/* ---------- 6. MASTHEAD ---------- */
.masthead {
  position: relative;
  z-index: 90;
  background: linear-gradient(180deg, #08110E 0%, rgba(14, 26, 23, 0.96) 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.32);
  box-shadow: 0 26px 44px -36px rgba(0, 0, 0, 0.95);
}

.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.7), transparent);
}

.masthead__inner {
  position: relative;
  padding-block: 16px 14px;
}

.masthead__brandline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(10px, 2.4vw, 28px);
  padding-block: 4px 12px;
}

.masthead__annotation {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(212, 175, 55, 0.72);
  white-space: nowrap;
}

.masthead__annotation--side {
  justify-self: start;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.3em;
  max-height: 132px;
}

.masthead__annotation--time {
  justify-self: end;
  color: rgba(244, 235, 220, 0.5);
}

/* 报头 */
.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding-inline: clamp(8px, 2vw, 24px);
  text-align: center;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--gold-light);
  text-shadow:
    0 0 2px rgba(235, 208, 138, 0.9),
    0 0 18px rgba(212, 175, 55, 0.42),
    0 0 44px rgba(230, 0, 126, 0.18);
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: rgba(244, 235, 220, 0.58);
}

.brand__neon {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: min(320px, 82%);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--magenta), var(--gold), transparent);
  opacity: 0.85;
}

/* 栏目行 */
.masthead__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  padding-block: 6px;
}

.masthead__cta {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
}

/* ---------- 7. NAV ---------- */
.nav { grid-column: 2; min-width: 0; }

.nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 1.2vw, 18px);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav__list::-webkit-scrollbar { display: none; }

.nav__item { flex: none; }

.nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: rgba(244, 235, 220, 0.78);
  transition: color 0.2s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s var(--ease);
}

.nav__link:hover,
.nav__link:focus-visible { color: var(--gold-light); }

.nav__link:hover::after,
.nav__link:focus-visible::after { transform: scaleX(1); }

.nav__link[aria-current="page"] { color: var(--gold); }

.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--gold), var(--magenta));
}

.nav__link.is-dim { opacity: 0.26; }

.nav__link.is-hit {
  color: var(--magenta);
  text-shadow: 0 0 12px rgba(230, 0, 126, 0.5);
}

.nav__link.is-hit::after {
  transform: scaleX(1);
  background: var(--magenta);
}

/* 折叠按钮 */
.nav-toggle {
  grid-column: 1;
  justify-self: start;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
  font-size: 13px;
  letter-spacing: 0.2em;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 0 20px -8px rgba(230, 0, 126, 0.85);
}

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.nav-toggle__bars i {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.24s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- 8. SEARCHBAR ---------- */
.searchbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: var(--rule-soft);
}

.searchbar__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: rgba(212, 175, 55, 0.8);
  white-space: nowrap;
}

.searchbar__field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(8, 17, 14, 0.86);
  border: 1px solid rgba(212, 175, 55, 0.22);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.searchbar__field:focus-within {
  border-color: rgba(230, 0, 126, 0.55);
  box-shadow: 0 0 0 1px rgba(230, 0, 126, 0.26), 0 0 24px -8px rgba(230, 0, 126, 0.7);
}

.searchbar__glyph {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}

.searchbar__glyph::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -1px;
  width: 6px;
  height: 1.5px;
  background: var(--gold);
  transform: rotate(45deg);
}

.searchbar__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 0;
  background: transparent;
  border: 0;
  font-size: 15px;
  color: var(--ivory);
}

.searchbar__input::placeholder { color: rgba(244, 235, 220, 0.35); }

.searchbar__input:focus { outline: none; }

.searchbar__hint {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--stone);
  white-space: nowrap;
}

.searchbar__hint.is-hit {
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(230, 0, 126, 0.45);
}

/* ---------- 9. BUTTONS & TAGS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  letter-spacing: 0.14em;
  cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
              background-color 0.22s var(--ease), color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.btn--gold {
  background: linear-gradient(135deg, var(--gold), #B8912A);
  color: var(--ink-deep);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(235, 208, 138, 0.4), 0 12px 28px -18px rgba(212, 175, 55, 0.95);
}

.btn--gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--gold-light);
}

.btn--ghost:hover {
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 0 24px -8px rgba(230, 0, 126, 0.85);
}

.btn--neon {
  border-color: rgba(230, 0, 126, 0.6);
  background: rgba(230, 0, 126, 0.12);
  color: #fff;
}

.btn--neon:hover { background: rgba(230, 0, 126, 0.24); }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold-light);
}

.tag--magenta {
  border-color: rgba(230, 0, 126, 0.6);
  background: rgba(230, 0, 126, 0.1);
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(230, 0, 126, 0.4);
}

/* ---------- 10. BREADCRUMB ---------- */
.breadcrumb {
  padding-block: 18px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--stone);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 10px;
  color: rgba(212, 175, 55, 0.5);
}

.breadcrumb a { color: rgba(244, 235, 220, 0.7); }

.breadcrumb a:hover { color: var(--gold-light); }

/* ---------- 11. MAIN / SECTION / GRID ---------- */
.main {
  position: relative;
  z-index: 1;
}

.section { padding-block: clamp(48px, 7vw, 96px); }

.section--tight { padding-block: clamp(28px, 4vw, 52px); }

.grid { display: grid; gap: clamp(18px, 2.6vw, 32px); }

.grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.grid--index { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }

/* ---------- 12. CHAPTER ---------- */
.chapter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(14px, 2.4vw, 26px);
  margin-bottom: clamp(24px, 4vw, 40px);
}

.chapter__num {
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0.06em;
  color: rgba(212, 175, 55, 0.85);
}

.chapter__title {
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.1;
}

.chapter__note {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--stone);
}

/* ---------- 13. PANEL ---------- */
.panel {
  position: relative;
  padding: clamp(20px, 3vw, 32px);
  background: linear-gradient(158deg, rgba(18, 36, 31, 0.96), rgba(11, 23, 20, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.24);
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.panel:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: var(--shadow-lift);
}

.panel--flat:hover { transform: none; }

.panel--ivory {
  background: var(--ivory);
  border-color: rgba(14, 26, 23, 0.16);
  color: var(--ink);
}

.panel--ivory h2,
.panel--ivory h3,
.panel--ivory h4 { color: var(--ink); }

.panel--ivory p,
.panel--ivory li { color: #25332E; }

.panel--ivory strong { color: #7A5A12; }

/* ---------- 14. DATA STRIP ---------- */
.data-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: clamp(16px, 3vw, 44px);
  padding: clamp(16px, 2.4vw, 24px) 0;
  border-top: var(--rule);
  border-bottom: var(--rule);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 96px;
}

.stat__num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--gold-light);
}

.stat__num--magenta { color: var(--magenta); }

.stat__num--cobalt { color: #6E8CFF; }

.stat__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--stone);
}

/* ---------- 15. ACCORDION ---------- */
.accordion { border-top: var(--rule); }

.acc-item { border-bottom: var(--rule); }

.acc-trigger {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--ivory);
  font-size: 16px;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease);
}

.acc-trigger:hover { color: var(--gold-light); }

.acc-trigger__index {
  flex: none;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.acc-trigger__text { flex: 1 1 auto; }

.acc-trigger__mark {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 5px;
}

.acc-trigger__mark::before,
.acc-trigger__mark::after {
  content: "";
  position: absolute;
  background: var(--gold);
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
}

.acc-trigger__mark::before { left: 0; right: 0; top: 7px; height: 1.5px; }

.acc-trigger__mark::after { top: 0; bottom: 0; left: 7px; width: 1.5px; }

.acc-trigger[aria-expanded="true"] { color: var(--gold-light); }

.acc-trigger[aria-expanded="true"] .acc-trigger__mark::after {
  transform: scaleY(0);
  opacity: 0;
}

.acc-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.34s var(--ease);
}

.acc-item[data-open] .acc-panel { max-height: 900px; }

.acc-panel__inner {
  padding: 0 0 22px 34px;
  color: rgba(244, 235, 220, 0.8);
  font-size: 15px;
}

/* ---------- 16. INDEX LIST ---------- */
.index-list { border-top: var(--rule-soft); }

.index-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: clamp(12px, 2vw, 24px);
  padding: 14px 0;
  border-bottom: var(--rule-soft);
  transition: background-color 0.2s var(--ease), padding-left 0.2s var(--ease);
}

.index-row:hover {
  background: rgba(212, 175, 55, 0.06);
  padding-left: 10px;
}

.index-row__no {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.index-row__title { font-size: 16px; color: var(--ivory); }

.index-row__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--stone);
}

/* ---------- 17. CHIP RING ---------- */
.chip-ring {
  --size: 64px;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 50%;
}

.chip-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(212, 175, 55, 0.4);
  border-radius: 50%;
}

.chip-ring::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(235, 208, 138, 0.5), rgba(230, 0, 126, 0.18));
}

/* ---------- 18. FIGURE ---------- */
.figure { position: relative; margin: 0; }

.figure__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-image:
    radial-gradient(120% 100% at 25% 12%, rgba(212, 175, 55, 0.18), transparent 58%),
    linear-gradient(150deg, #16302A 0%, #0B1714 78%);
  border: 1px solid rgba(212, 175, 55, 0.26);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}

.figure__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, rgba(244, 235, 220, 0.03) 0 2px, transparent 2px 7px);
  pointer-events: none;
}

.figure__frame[data-empty]::before {
  content: attr(data-empty);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-align: center;
  color: rgba(244, 235, 220, 0.34);
}

.figure--wide .figure__frame { aspect-ratio: 21 / 9; }
.figure--tall .figure__frame { aspect-ratio: 4 / 5; }
.figure--square .figure__frame { aspect-ratio: 1 / 1; }

.figure__cap {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--stone);
}

/* ---------- 19. FOOTER ---------- */
.site-foot {
  position: relative;
  margin-top: clamp(48px, 8vw, 110px);
  background: linear-gradient(180deg, rgba(10, 20, 17, 0.5), var(--ink-deep) 62%);
  border-top: 1px solid rgba(212, 175, 55, 0.34);
}

.site-foot__rail {
  height: 8px;
  background: repeating-linear-gradient(90deg, rgba(62, 90, 78, 0.85) 0 24px, rgba(212, 175, 55, 0.6) 24px 26px);
  opacity: 0.65;
}

.site-foot__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3.4vw, 48px);
  padding-block: clamp(36px, 5vw, 64px);
}

.foot-brand {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: 0.04em;
  color: var(--gold-light);
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
}

.foot-brand:hover { color: #fff; }

.foot-brand__note {
  margin-top: 12px;
  max-width: 30ch;
  font-size: 14px;
  color: rgba(244, 235, 220, 0.64);
}

.foot-brand__meta {
  margin-top: 14px;
  max-width: 42ch;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--stone);
}

.foot-col { min-width: 0; }

.foot-col__title {
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: var(--rule-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--gold);
}

.foot-col__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.foot-col__list a,
.foot-col__list span {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(244, 235, 220, 0.72);
  transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}

.foot-col__list a:hover {
  color: var(--gold-light);
  padding-left: 5px;
}

.foot-col__list--plain span {
  color: var(--stone);
  word-break: break-all;
}

.site-foot__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  border-top: var(--rule-soft);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: rgba(244, 235, 220, 0.66);
}

.legal-links a:hover { color: var(--gold-light); }

.site-foot__copy {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--stone);
  max-width: none;
}

/* ---------- 20. TO TOP ---------- */
.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 32px);
  bottom: clamp(14px, 3vw, 32px);
  z-index: 110;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--gold-light);
  background: rgba(8, 17, 14, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.4);
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease),
              visibility 0.24s linear, border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.to-top.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 0 24px -8px rgba(230, 0, 126, 0.9);
}

/* ---------- 21. REVEAL ---------- */
html[data-motion="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

html[data-motion="on"] [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 22. RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .grid--index { grid-template-columns: minmax(0, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-foot__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .masthead__bar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }

  .nav-toggle { display: inline-flex; }

  .masthead__cta {
    grid-column: 2;
    justify-self: end;
    padding: 9px 14px;
    font-size: 13px;
    letter-spacing: 0.1em;
  }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    grid-column: auto;
    padding: 6px var(--gutter) 18px;
    background: linear-gradient(180deg, #0A1411, #08110E);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.95);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.36s var(--ease), opacity 0.24s var(--ease), visibility 0.36s linear;
  }

  .nav[data-open] {
    max-height: min(72vh, 560px);
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    overflow: visible;
  }

  .nav__link {
    display: block;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(244, 235, 220, 0.08);
    font-size: 16px;
  }

  .nav__link::after {
    left: 4px;
    right: auto;
    bottom: 10px;
    width: 26px;
  }

  .searchbar { grid-template-columns: minmax(0, 1fr); gap: 8px; }

  .searchbar__label { letter-spacing: 0.2em; }

  .searchbar__hint { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 15.5px; }

  .masthead__annotation { display: none; }

  .masthead__brandline { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .brand__name { font-size: clamp(28px, 9vw, 40px); }

  .brand__tag { letter-spacing: 0.18em; }

  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }

  .chapter {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .chapter__num { font-size: 26px; }

  .index-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .index-row__meta {
    grid-column: 2;
    color: rgba(92, 107, 102, 0.9);
  }

  .data-strip { gap: 18px; }

  .stat { min-width: 84px; }

  .acc-panel__inner { padding-left: 0; }

  .site-foot__inner { grid-template-columns: minmax(0, 1fr); }

  .site-foot__legal { justify-content: flex-start; }

  .panel { clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
}

/* ---------- 23. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .panel:hover { transform: none; }

  .to-top { transform: none; }
}
