:root {
  --obsidian: #0E0D12;
  --graphite: #1A1820;
  --gold: #C9962E;
  --gold-light: #E3BE72;
  --bronze: #8A6117;
  --terracotta: #A8452F;
  --jade: #2F8F7A;
  --teal: #103F45;
  --indigo: #3B1F3A;
  --ivory: #F3EDE3;
  --mauve: #9A93A6;
  --rail-width: 220px;
  --shadow: 6px 6px 0 rgba(0, 0, 0, .45);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--obsidian);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-left: 0;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: var(--gold-light); text-decoration-color: rgba(201, 150, 46, .45); text-underline-offset: .18em; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--obsidian); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 900; line-height: 1.08; letter-spacing: -.02em; }
p { margin: 0 0 1em; max-width: 68ch; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-size: .84em; letter-spacing: .08em; }
@media (min-width: 1024px) { body { padding-left: var(--rail-width); } }
@media (max-width: 1023px) { body { padding-top: 64px; } }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  transform: translateY(-180%);
  background: var(--gold);
  color: var(--obsidian);
  padding: 10px 14px;
  border: 2px solid var(--obsidian);
  box-shadow: var(--shadow);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  z-index: 100;
  background: var(--graphite);
  border-right: 2px solid var(--bronze);
}
.header-rail {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  overflow-y: auto;
}
.brand {
  display: block;
  color: var(--ivory);
  text-decoration: none;
  padding: 0 0 20px;
  border-bottom: 1px solid rgba(201, 150, 46, .35);
}
.brand-mark {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--gold-light);
  text-shadow: 3px 3px 0 rgba(168, 69, 47, .45);
}
.brand-name {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--mauve);
  letter-spacing: .12em;
}
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--obsidian);
  border: 2px solid var(--bronze);
  color: var(--ivory);
  cursor: pointer;
}
.nav-toggle-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; }
.nav-toggle-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 2px;
  background: var(--gold);
}
.primary-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 22px;
  visibility: visible;
}
.nav-index-label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--bronze);
  max-width: none;
}
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-list a {
  position: relative;
  display: block;
  padding: 10px 12px 10px 16px;
  color: var(--ivory);
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 15px;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}
.nav-list a:hover {
  color: var(--gold-light);
  border-left-color: var(--bronze);
  background: rgba(201, 150, 46, .07);
  transform: translateX(3px);
}
.nav-list a[aria-current="page"] {
  color: var(--gold-light);
  border-left-color: var(--jade);
  background: linear-gradient(90deg, rgba(47, 143, 122, .18), transparent);
  font-weight: 700;
}
.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px rgba(47, 143, 122, .2);
}
.utility-actions {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(201, 150, 46, .22);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.utility-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--mauve);
  text-align: left;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.utility-link:hover {
  color: var(--gold-light);
  border-color: rgba(201, 150, 46, .35);
  background: rgba(201, 150, 46, .06);
}
.utility-favorite { justify-content: flex-start; }
.favorite-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bronze);
  box-shadow: 0 0 0 2px rgba(138, 97, 23, .25);
  flex: 0 0 auto;
}
.utility-favorite[aria-pressed="true"] {
  color: var(--jade);
  border-color: rgba(47, 143, 122, .45);
  background: rgba(47, 143, 122, .08);
}
.utility-favorite[aria-pressed="true"] .favorite-dot {
  background: var(--jade);
  box-shadow: 0 0 0 3px rgba(47, 143, 122, .25);
}
.rail-status {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(201, 150, 46, .22);
  color: var(--mauve);
  font-size: 12px;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--jade);
  margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(47, 143, 122, .16);
}
.rail-status-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ivory);
}
.rail-meta { margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: var(--mauve); max-width: none; }

@media (max-width: 1023px) {
  body { padding-left: 0; padding-top: 64px; }
  .site-header {
    inset: 0 0 auto 0;
    width: 100%;
    height: 64px;
    border-right: 0;
    border-bottom: 2px solid var(--bronze);
  }
  .header-rail {
    height: 64px;
    flex-direction: row;
    align-items: center;
    padding: 0 16px;
    overflow: visible;
  }
  .brand {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0;
  }
  .brand-mark {
    font-size: 22px;
    text-shadow: 2px 2px 0 rgba(168, 69, 47, .45);
    white-space: nowrap;
  }
  .brand-name {
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: .08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-toggle { display: inline-flex; flex: 0 0 auto; }
  .primary-nav {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: min(84vw, 340px);
    margin: 0;
    padding: 22px 16px;
    background: var(--graphite);
    border-right: 2px solid var(--bronze);
    box-shadow: 14px 0 0 rgba(0, 0, 0, .35);
    transform: translateX(-104%);
    transition: transform .24s ease, visibility .24s ease;
    visibility: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .site-header[data-open] .primary-nav {
    transform: translateX(0);
    visibility: visible;
  }
  .nav-list { gap: 2px; }
  .nav-list a { font-size: 16px; padding: 12px 14px 12px 18px; }
  .utility-actions { margin-top: 24px; }
  .rail-status { display: none; }
}

.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 140px);
  background: linear-gradient(180deg, var(--graphite), var(--obsidian));
  border-top: 2px solid var(--bronze);
  color: var(--ivory);
}
.footer-inner {
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 96px) 0 28px;
}
.footer-brand {
  border-left: 4px solid var(--gold);
  padding-left: 18px;
  margin-bottom: 40px;
}
.footer-mark {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
  color: var(--gold-light);
  letter-spacing: -.02em;
  text-shadow: 4px 4px 0 rgba(168, 69, 47, .35);
}
.footer-brand-line { margin: 0; color: var(--ivory); font-size: 15px; }
.footer-note { margin: 8px 0 0; color: var(--mauve); font-size: 13px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid rgba(201, 150, 46, .25);
  border-bottom: 1px solid rgba(201, 150, 46, .25);
}
.footer-column { min-width: 0; }
.footer-column-title {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--gold-light);
}
.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-list a {
  display: inline-block;
  color: var(--ivory);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.footer-list a:hover {
  color: var(--gold-light);
  border-bottom-color: var(--bronze);
  transform: translateX(3px);
}
.footer-contact {
  padding: 26px 0;
  border-bottom: 1px solid rgba(201, 150, 46, .25);
  color: var(--mauve);
}
.footer-contact-line { margin: 0 0 6px; font-size: 13px; max-width: none; }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  color: var(--mauve);
  font-size: 12px;
}
.footer-copy { margin: 0; max-width: none; }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-legal-links a { color: var(--gold-light); text-decoration: none; }
.footer-legal-links a:hover { color: var(--gold); text-decoration: underline; }
.footer-icp { margin: 0; max-width: none; font-family: var(--font-mono); letter-spacing: .08em; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
}

.content-wrap { width: min(100% - 40px, 1180px); margin-inline: auto; }
.section { position: relative; padding-block: clamp(56px, 9vw, 120px); }
.section--teal { background: linear-gradient(180deg, var(--teal), rgba(16, 63, 69, .2)); }
.section--indigo { background: linear-gradient(180deg, var(--indigo), rgba(59, 31, 58, .15)); }
.section--terracotta { background: linear-gradient(180deg, var(--terracotta), rgba(168, 69, 47, .25)); color: var(--ivory); }
.section--graphite { background: var(--graphite); }
.section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
  margin-bottom: clamp(28px, 5vw, 56px);
}
.section-number {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--gold);
  border: 2px solid var(--bronze);
  padding: 4px 8px;
  background: var(--graphite);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .35);
}
.section-title { font-size: clamp(30px, 5vw, 72px); color: var(--ivory); }
.section-lede { grid-column: 2; margin: 6px 0 0; color: var(--mauve); font-size: 16px; max-width: 62ch; }
@media (max-width: 640px) {
  .section-head { grid-template-columns: 1fr; }
  .section-lede { grid-column: 1; }
}

.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
@media (max-width: 900px) {
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 6; }
}
@media (max-width: 620px) {
  .grid-12 { grid-template-columns: 1fr; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: span 1; }
}

.index-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px;
  background: var(--bronze);
  border: 2px solid var(--bronze);
}
.index-cell {
  min-height: 160px;
  padding: 22px;
  background: var(--graphite);
  color: var(--ivory);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background .2s ease, color .2s ease;
}
.index-cell:hover { background: var(--teal); color: var(--gold-light); }
.index-no { font-family: var(--font-mono); color: var(--gold); font-size: 12px; letter-spacing: .08em; }
.index-title { font-family: var(--font-display); font-weight: 900; font-size: 24px; line-height: 1.1; }
.index-desc { margin-top: auto; color: var(--mauve); font-size: 13px; }

.card {
  position: relative;
  background: var(--graphite);
  border: 2px solid var(--bronze);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
  color: var(--ivory);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  border-color: var(--gold);
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 rgba(0, 0, 0, .5);
}
.card--anchor {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201, 150, 46, .12), var(--graphite) 60%);
}
.card--anchor::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 42px;
  height: 42px;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.card-title { margin: 0 0 8px; font-size: clamp(20px, 2.4vw, 28px); color: var(--ivory); }
.card-meta { margin: 0 0 12px; font-family: var(--font-mono); font-size: 12px; color: var(--gold-light); letter-spacing: .08em; }
.card-body { color: var(--mauve); font-size: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--terracotta);
  color: var(--ivory);
  border: 2px solid var(--obsidian);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
}
.badge--jade { background: var(--jade); }
.badge--gold { background: var(--gold); color: var(--obsidian); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--graphite);
  border: 2px solid var(--bronze);
  color: var(--ivory);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .4);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:hover {
  transform: translate(-2px, -2px);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .5);
}
.btn--primary { background: var(--gold); color: var(--obsidian); border-color: var(--gold-light); }
.btn--primary:hover { background: var(--gold-light); color: var(--obsidian); }
.btn--ghost { background: transparent; color: var(--gold-light); }

.breadcrumbs {
  padding: 18px 0;
  color: var(--mauve);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}
.breadcrumbs a { color: var(--gold-light); text-decoration: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--bronze); }

.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--gold), var(--bronze));
  transform-origin: top;
}
.timeline-item { position: relative; padding: 0 0 28px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--obsidian);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 150, 46, .15);
}
.timeline-date { font-family: var(--font-mono); font-size: 12px; color: var(--gold-light); letter-spacing: .08em; }
.timeline-title { margin: 4px 0 8px; font-size: 20px; }
.timeline-body { color: var(--mauve); font-size: 14px; }

.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.compare-column {
  background: var(--graphite);
  border: 2px solid var(--bronze);
  box-shadow: var(--shadow);
  padding: 22px;
}
.compare-column[data-collapsed="true"] .compare-body { display: none; }
.compare-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compare-toggle {
  border: 2px solid var(--bronze);
  background: var(--obsidian);
  color: var(--gold-light);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  cursor: pointer;
}
.compare-body { margin-top: 14px; color: var(--mauve); }
@media (max-width: 800px) { .compare-grid { grid-template-columns: 1fr; } }

.track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 22px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--bronze) var(--graphite);
}
.track > * { flex: 0 0 min(78vw, 360px); scroll-snap-align: start; }
.track::-webkit-scrollbar { height: 8px; }
.track::-webkit-scrollbar-track { background: var(--graphite); }
.track::-webkit-scrollbar-thumb { background: var(--bronze); }
@media (max-width: 640px) { .track > * { flex-basis: 82vw; } }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.filter-button {
  border: 2px solid var(--bronze);
  background: var(--graphite);
  color: var(--ivory);
  padding: 8px 12px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.filter-button:hover { border-color: var(--gold); color: var(--gold-light); }
.filter-button[aria-pressed="true"] {
  background: var(--gold);
  color: var(--obsidian);
  border-color: var(--gold-light);
  transform: translate(-2px, -2px);
}
[data-filter-tag].is-filtered-out { display: none; }

.panel-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  background: var(--teal);
  border: 2px solid var(--gold);
  box-shadow: var(--shadow);
  padding: 18px;
  color: var(--ivory);
}
.status-line { border-left: 2px solid rgba(243, 237, 227, .25); padding-left: 12px; }
.status-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: .08em;
}
.status-value { font-family: var(--font-mono); font-size: 16px; color: var(--ivory); }

.image-frame {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--teal), var(--indigo) 50%, var(--graphite));
  border: 2px solid var(--bronze);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85) contrast(1.05) brightness(.9);
}
.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 45%, rgba(14, 13, 18, .82));
}
.image-frame--wide { aspect-ratio: 16 / 9; }
.image-frame--portrait { aspect-ratio: 4 / 5; }
.image-frame--square { aspect-ratio: 1; }
.image-frame--slant { clip-path: polygon(0 4%, 100% 0, 96% 100%, 0 96%); }
@media (max-width: 640px) {
  .image-frame--slant { clip-path: polygon(0 2%, 100% 0, 98% 100%, 0 98%); }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

.scroll-progress {
  position: fixed;
  top: 0;
  left: var(--rail-width);
  right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
  background: linear-gradient(90deg, var(--gold) var(--progress, 0%), rgba(201, 150, 46, .08) var(--progress, 0%));
}
@media (max-width: 1023px) {
  .scroll-progress { left: 0; top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .scroll-progress { display: none; }
}
