/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ===== Tokens ===== */
:root {
  --deep: #0E3B3E;
  --deep-2: #124A4E;
  --sand: #E8D8B5;
  --cream: #F7F1E3;
  --red: #C8352B;
  --blue: #1F6FEB;
  --ink: #2B1E16;
  --amber: #D97A2B;
  --mist: #A8C3C0;
  --grass: #5B7A4A;
  --clay: #B9956A;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bd: 3px solid var(--ink);
  --shadow-hard: 6px 6px 0 var(--ink);
  --shadow-soft: 6px 6px 0 var(--clay);
  --shell: 1440px;
  --gutter: clamp(18px, 4vw, 56px);
}

/* ===== Base ===== */
body {
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: var(--scroll, 0%);
  background: linear-gradient(90deg, var(--amber), var(--red) 62%, var(--blue));
  z-index: 200;
  pointer-events: none;
}

h1, .h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 7.6vw, 104px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.03em;
}
h2, .h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 52px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
h3, .h3 {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h4 { font-size: 17px; font-weight: 800; line-height: 1.35; }

p { text-wrap: pretty; }

.lede {
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.75;
  color: #3B2C22;
  max-width: 64ch;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0.04em;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  top: -120px;
  left: 14px;
  z-index: 300;
  display: inline-block;
  padding: 10px 18px;
  background: var(--red);
  color: var(--cream);
  border: 3px solid var(--ink);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
}
.skip-link:focus { top: 14px; }

/* ===== Header frame ===== */
.site-frame {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--deep);
  color: var(--cream);
  border-left: 12px solid var(--red);
  border-right: 12px solid var(--amber);
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 10px 0 rgba(43, 30, 22, 0.16);
}
.site-frame :focus-visible { outline-color: var(--amber); }

.frame-bar {
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  padding: 14px var(--gutter);
  border-bottom: 2px solid rgba(232, 216, 181, 0.18);
}

.frame-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  min-width: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-size: clamp(17px, 1.7vw, 23px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--cream);
  line-height: 1.15;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--mist);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-search { display: flex; align-items: center; min-width: 0; }
.search-input {
  width: 100%;
  min-width: 0;
  padding: 11px 15px;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 0;
  font-size: 15px;
  box-shadow: 4px 4px 0 var(--blue);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.search-input::placeholder { color: #7A6A5C; }
.search-input:focus {
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--red);
}

.cta-version {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--red);
  color: var(--cream);
  border: 3px solid var(--ink);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 4px 4px 0 var(--ink);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.cta-version:hover {
  background: var(--amber);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  background: var(--sand);
  color: var(--deep);
  border: 3px solid var(--ink);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}
.nav-toggle-bars {
  position: relative;
  display: block;
  width: 20px;
  height: 3px;
  background: var(--deep);
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 3px;
  background: var(--deep);
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.frame-nav { background: linear-gradient(90deg, var(--deep) 0%, var(--deep-2) 62%, var(--deep) 100%); }
.nav-list {
  display: flex;
  flex-wrap: wrap;
  padding: 0 var(--gutter);
}
.nav-item { display: flex; }
.nav-link {
  position: relative;
  display: block;
  padding: 13px 20px;
  color: var(--sand);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  border-right: 1px solid rgba(168, 195, 192, 0.18);
  transition: color 0.16s ease, background 0.16s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 0;
  background: var(--amber);
  transition: width 0.22s ease;
}
.nav-link:hover { color: var(--cream); background: rgba(31, 111, 235, 0.18); }
.nav-link:hover::after { width: 100%; }
.nav-link[aria-current="page"] {
  color: var(--cream);
  background: var(--red);
}
.nav-link[aria-current="page"]::after { width: 100%; background: var(--cream); }

/* ===== Footer ===== */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 9vw, 140px);
  background: var(--ink);
  color: var(--sand);
  border-top: 8px solid var(--deep);
}
.site-footer::before {
  content: "";
  display: block;
  height: 7px;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 32px,
    var(--amber) 32px 64px,
    var(--grass) 64px 96px,
    var(--blue) 96px 128px
  );
}
.footer-grid {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) var(--gutter);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.25fr 1.5fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
.footer-col { min-width: 0; }
.footer-col-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(232, 216, 181, 0.25);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--cream);
  line-height: 1.2;
}
.footer-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 6px 0 14px;
}
.footer-text {
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(232, 216, 181, 0.82);
  margin-bottom: 8px;
}
.footer-text--mono {
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--sand);
  word-break: break-word;
}
.footer-text--note {
  font-size: 13px;
  color: var(--mist);
  margin-bottom: 0;
}
.footer-links {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.footer-links--sub { margin-top: 12px; }
.footer-links--contact { gap: 6px; }
.footer-links a {
  display: inline-block;
  color: var(--sand);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.footer-links a:hover {
  color: var(--cream);
  border-bottom-color: var(--red);
}
.footer-bottom {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 20px var(--gutter) 28px;
  border-top: 2px solid rgba(232, 216, 181, 0.22);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
  justify-content: space-between;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(232, 216, 181, 0.7);
  margin: 0;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-legal a {
  font-size: 13px;
  color: var(--mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.footer-legal a:hover { color: var(--cream); border-bottom-color: var(--amber); }

/* ===== Layout helpers ===== */
.page-shell {
  width: min(var(--shell), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}
.section { padding: clamp(40px, 6.5vw, 96px) 0; }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(24px, 4vw, 48px); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
}
.eyebrow::before {
  content: "";
  width: 36px;
  height: 3px;
  background: var(--amber);
  flex: none;
}
.rule {
  height: 3px;
  border: 0;
  background: var(--ink);
  margin: clamp(24px, 4vw, 48px) 0;
}

.grid { display: grid; gap: clamp(18px, 2.6vw, 32px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ===== Cards & chips ===== */
.card {
  background: var(--cream);
  border: var(--bd);
  box-shadow: var(--shadow-soft);
  padding: clamp(18px, 2.4vw, 28px);
}
.card-title {
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 10px;
}
.card-text { font-size: 15.5px; line-height: 1.75; color: #3B2C22; }

.chip {
  display: inline-block;
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--sand);
  color: var(--deep);
  border: 2px solid var(--ink);
}
.chip--red { background: var(--red); color: var(--cream); border-color: var(--red); }
.chip--blue { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  background: var(--cream);
  color: var(--ink);
  border: var(--bd);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.btn--primary { background: var(--red); color: var(--cream); }
.btn--primary:hover { background: var(--amber); }
.btn--blue { background: var(--blue); color: #fff; }
.btn--ghost { background: transparent; color: var(--deep); }

/* ===== Breadcrumbs ===== */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.crumbs li {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--deep);
}
.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--clay);
}
.crumbs a { text-decoration: none; border-bottom: 2px solid transparent; }
.crumbs a:hover { color: var(--red); border-bottom-color: var(--red); }

/* ===== Media containers ===== */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--deep);
  border: var(--bd);
  box-shadow: var(--shadow-hard);
}
.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }
.media-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  text-align: center;
  color: var(--sand);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background-color: var(--deep);
  background-image:
    repeating-linear-gradient(135deg, rgba(232, 216, 181, 0.1) 0 14px, transparent 14px 28px),
    linear-gradient(165deg, var(--deep) 0%, var(--deep-2) 58%, var(--grass) 100%);
}
.media-figure { display: grid; gap: 0; margin: 0; }
.media-caption {
  padding: 10px 14px;
  background: var(--cream);
  border: var(--bd);
  border-top: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--deep);
}

/* ===== Accordion ===== */
.accordion {
  background: var(--cream);
  border: var(--bd);
  box-shadow: var(--shadow-soft);
}
.acc-item + .acc-item { border-top: 3px solid var(--ink); }
.acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 800;
  color: var(--deep);
  cursor: pointer;
  transition: background 0.16s ease;
}
.acc-trigger::after {
  content: "＋";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--red);
  flex: none;
}
.acc-trigger:hover { background: rgba(232, 216, 181, 0.6); }
.acc-trigger[aria-expanded="true"] { background: var(--sand); }
.acc-trigger[aria-expanded="true"]::after { content: "－"; color: var(--deep); }
.acc-panel {
  padding: 0 20px 20px;
  font-size: 15.5px;
  line-height: 1.8;
  color: #3B2C22;
}
.acc-panel[hidden] { display: none; }

/* ===== Tabs ===== */
.tabs {
  background: var(--cream);
  border: var(--bd);
  box-shadow: var(--shadow-soft);
}
.tab-list {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--ink);
}
.tab {
  padding: 12px 20px;
  background: var(--sand);
  color: var(--deep);
  border: 0;
  border-right: 3px solid var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.tab:hover { background: var(--clay); color: var(--cream); }
.tab[aria-selected="true"] { background: var(--deep); color: var(--cream); }
.tab-panel { padding: clamp(18px, 2.4vw, 28px); font-size: 15.5px; line-height: 1.8; }
.tab-panel[hidden] { display: none; }

/* ===== Timeline ===== */
.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: linear-gradient(180deg, var(--amber), var(--grass));
}
.tl-item {
  position: relative;
  padding: 0 0 30px 52px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: 2px;
  top: 6px;
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  transition: background 0.3s ease, transform 0.3s ease;
}
.tl-item.is-lit .tl-dot { background: var(--amber); transform: scale(1.12); }
.tl-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.tl-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 6px;
}
.tl-text { font-size: 15.5px; line-height: 1.75; color: #3B2C22; }

/* ===== Legend ===== */
.legend { display: grid; gap: 10px; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink);
}
.legend-swatch {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--ink);
  background: var(--mist);
}

/* ===== Reveal ===== */
[data-reveal] { transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].reveal-init { opacity: 0; transform: translateY(20px); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.3fr; }
  .footer-grid > .footer-col:last-child { grid-column: 1 / -1; border-top: 2px solid rgba(232, 216, 181, 0.18); padding-top: 24px; }
}

@media (max-width: 980px) {
  .site-frame { border-left-width: 6px; border-right-width: 6px; }
  .frame-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 12px;
    padding: 12px 16px;
  }
  .frame-brand { grid-area: 1 / 1 / 2 / 2; }
  .nav-toggle { grid-area: 1 / 2 / 2 / 3; display: inline-flex; }
  .frame-search { grid-area: 2 / 1 / 3 / 3; }
  .cta-version { grid-area: 3 / 1 / 4 / 3; justify-content: center; }

  .frame-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease;
  }
  .site-frame[data-open] .frame-nav { max-height: 72vh; overflow-y: auto; }
  .nav-list { flex-direction: column; padding: 0 16px; }
  .nav-item { display: block; border-bottom: 1px solid rgba(168, 195, 192, 0.2); }
  .nav-item:last-child { border-bottom: 0; }
  .nav-link { padding: 16px 6px; font-size: 17px; border-right: 0; }
  .nav-link::after { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid > .footer-col:last-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .media { aspect-ratio: 4 / 3; }
  .media--wide { aspect-ratio: 16 / 9; }
  .media--tall { aspect-ratio: 1 / 1; }
  .tab { flex: 1 1 auto; border-right: 0; border-bottom: 3px solid var(--ink); }
}

@media (max-width: 420px) {
  .frame-bar { padding: 10px 12px; }
  .cta-version { font-size: 13px; padding: 10px 12px; }
  .nav-toggle-text { display: none; }
}

@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].reveal-init { opacity: 1; transform: none; }
  body::before { transition: none; }
}
