:root {
  --paper: #F4F1E6;
  --paper-warm: #E7E1D0;
  --ink: #0E1B2C;
  --green: #1F7A5A;
  --green-bright: #34B27B;
  --orange: #FF6A2B;
  --gold: #E9B44C;
  --mist: #A8AFB8;
  --deep: #123B2E;
  --white: #FDFCF7;

  --shell: 1280px;
  --gutter: clamp(18px, 4vw, 40px);
  --radius: 16px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }

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

::selection { background: var(--green-bright); color: var(--ink); }

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

.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}

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

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* ---------- type ---------- */
.display {
  font-weight: 900;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.display-slant {
  display: inline-block;
  transform: skewX(-2deg);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.prose { max-width: 34em; }
.prose p + p { margin-top: 1.1em; }
.prose h3 {
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 800;
  line-height: 1.35;
}
.prose ul {
  margin-top: 1em;
  display: grid;
  gap: 0.5em;
}
.prose li {
  position: relative;
  padding-left: 1.2em;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 1px;
  transform: rotate(45deg);
}
.prose a {
  border-bottom: 2px solid var(--green-bright);
  padding-bottom: 1px;
}
.prose a:hover { color: var(--green); }

/* ---------- breadcrumb ---------- */
.breadcrumb {
  margin-bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(14, 27, 44, 0.62);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--mist);
}
.breadcrumb a:hover { color: var(--green); }

/* ---------- buttons / chips / cards ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--green);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--green-bright);
  color: var(--ink);
}

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border: 1.5px solid rgba(14, 27, 44, 0.35);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover {
  border-color: var(--green);
  color: var(--green);
}
.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.card {
  background: var(--paper-warm);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 28px);
}
.card-dark {
  background: var(--ink);
  border-color: rgba(253, 252, 247, 0.18);
  color: var(--white);
}

/* ---------- media frames ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-warm);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--dark {
  border-color: rgba(253, 252, 247, 0.2);
  background: var(--ink);
}
.media-caption {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(14, 27, 44, 0.6);
}
.ratio-21x9 { aspect-ratio: 21 / 9; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-3x4 { aspect-ratio: 3 / 4; }
.ratio-1x1 { aspect-ratio: 1 / 1; }

/* ---------- reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 20px;
  border-radius: 0 0 12px 12px;
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: top 0.2s var(--ease);
}
.skip-link:focus-visible { top: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid rgba(14, 27, 44, 0.14);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green) 0 46%, var(--gold) 46% 78%, var(--orange) 78% 100%);
}
.site-header[data-scrolled] {
  box-shadow: 0 12px 32px rgba(14, 27, 44, 0.12);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  z-index: 2;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--green), var(--green-bright) 45%, var(--orange));
  transition: transform 0.12s linear;
}

.header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  padding-block: 8px;
  transition: min-height 0.3s var(--ease);
}

/* brand */
.brand {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "glyph stack"
    "note note";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  flex: 0 0 auto;
}
.brand-glyph {
  grid-area: glyph;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  transition: height 0.3s var(--ease);
}
.brand-bar {
  width: 5px;
  border-radius: 2px 2px 0 0;
  transform: skewX(-8deg);
  transition: height 0.3s var(--ease), width 0.3s var(--ease);
}
.brand-bar:nth-child(1) { height: 20px; background: var(--green); }
.brand-bar:nth-child(2) { height: 34px; background: var(--ink); }
.brand-bar:nth-child(3) { height: 26px; background: var(--gold); }

.brand-stack {
  grid-area: stack;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.12;
  transition: flex-direction 0.3s var(--ease);
}
.brand-cn {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--ink);
  transition: font-size 0.3s var(--ease), color 0.3s var(--ease);
}
.brand-en {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--green);
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
}
.brand-note {
  grid-area: note;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(14, 27, 44, 0.55);
}

/* compact header */
.site-header[data-scrolled] .header-shell { min-height: 56px; }
.site-header[data-scrolled] .brand-glyph { height: 24px; }
.site-header[data-scrolled] .brand-bar { width: 4px; }
.site-header[data-scrolled] .brand-bar:nth-child(1) { height: 14px; }
.site-header[data-scrolled] .brand-bar:nth-child(2) { height: 24px; }
.site-header[data-scrolled] .brand-bar:nth-child(3) { height: 18px; }
.site-header[data-scrolled] .brand-stack { flex-direction: row; align-items: baseline; gap: 10px; }
.site-header[data-scrolled] .brand-cn { font-size: 17px; letter-spacing: 0.12em; }
.site-header[data-scrolled] .brand-note { display: none; }

/* navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
}
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 26px);
}
.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 2px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s var(--ease);
}
.nav-link:hover { color: var(--green); }
.nav-link:hover::after { transform: scaleX(0.6); }
.nav-link[aria-current="page"] { color: var(--green); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.fav-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.fav-button:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-1px);
}
.fav-icon {
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
  transition: background 0.25s var(--ease);
}
.fav-label { white-space: nowrap; }
.fav-button[aria-pressed="true"] {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.fav-button[aria-pressed="true"] .fav-icon { background: currentColor; }
.fav-button[aria-pressed="true"]:hover {
  background: var(--orange);
  color: var(--white);
}

.nav-contact { display: none; }

/* nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease), background 0.25s var(--ease);
}
.nav-toggle-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 8vw, 96px);
  background: var(--deep);
  color: var(--white);
  padding-bottom: 28px;
  overflow: hidden;
}
.site-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: radial-gradient(circle at 1px 1px, var(--white) 1px, transparent 0);
  background-size: 7px 7px;
}
.footer-band {
  height: 10px;
  background: linear-gradient(100deg, var(--gold) 0%, var(--green-bright) 52%, var(--green) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 100%);
}
.footer-shell {
  position: relative;
  z-index: 1;
  padding-top: clamp(40px, 5vw, 60px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
  gap: clamp(24px, 3vw, 48px);
}
.footer-col { min-width: 0; }
.footer-col-brand { padding-right: 8px; }

.footer-brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--white);
}
.footer-brand-en {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--green-bright);
}
.footer-lede {
  margin-top: 14px;
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(253, 252, 247, 0.74);
}
.footer-note {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(253, 252, 247, 0.5);
}
.footer-title {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.footer-links li + li { margin-top: 10px; }
.footer-links a {
  font-size: 15px;
  color: rgba(253, 252, 247, 0.86);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-links a:hover {
  color: var(--white);
  border-bottom-color: var(--gold);
}
.footer-contact li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.footer-key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--mist);
}
.footer-value {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(253, 252, 247, 0.9);
  word-break: break-word;
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: clamp(36px, 4vw, 48px);
  padding-top: 18px;
  border-top: 1px solid rgba(253, 252, 247, 0.16);
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(253, 252, 247, 0.62);
}
.footer-copy { letter-spacing: 0.04em; }
.footer-icp { letter-spacing: 0.04em; }
.footer-meta a {
  color: rgba(253, 252, 247, 0.8);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-meta a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .header-shell { gap: 16px; }
  .nav-list { gap: 14px; }
  .nav-link { font-size: 14px; }
}

/* ---------- mobile / tablet nav ---------- */
@media (max-width: 960px) {
  html.nav-locked { overflow: hidden; }

  .header-shell {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    grid-template-areas: "toggle brand gap";
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding-block: 6px;
  }
  .nav-toggle {
    grid-area: toggle;
    justify-self: start;
    display: inline-flex;
  }
  .brand {
    grid-area: brand;
    justify-self: center;
    grid-template-columns: auto;
    grid-template-areas: "stack";
    text-align: center;
  }
  .brand-glyph,
  .brand-note { display: none; }
  .brand-stack { align-items: center; }
  .brand-cn { font-size: 18px; letter-spacing: 0.12em; }
  .brand-en { font-size: 9px; letter-spacing: 0.24em; }

  .site-header[data-scrolled] .header-shell { min-height: 64px; }
  .site-header[data-scrolled] .brand-stack { flex-direction: column; align-items: center; gap: 0; }
  .site-header[data-scrolled] .brand-cn { font-size: 18px; }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(22px, 5vh, 40px);
    padding: 92px var(--gutter) 40px;
    background: var(--ink);
    color: var(--white);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s var(--ease);
  }
  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .nav-link {
    display: block;
    width: 100%;
    padding: 15px 2px;
    font-size: 21px;
    font-weight: 700;
    color: var(--white);
    border-bottom: 1px solid rgba(253, 252, 247, 0.14);
  }
  .nav-link::after { display: none; }
  .nav-link:hover,
  .nav-link:focus-visible,
  .nav-link[aria-current="page"] { color: var(--gold); }

  .nav-actions { justify-content: flex-start; }
  .fav-button {
    border-color: rgba(253, 252, 247, 0.55);
    color: var(--white);
  }
  .fav-button:hover {
    border-color: var(--gold);
    color: var(--gold);
  }
  .fav-button[aria-pressed="true"] {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--white);
  }

  .nav-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: rgba(253, 252, 247, 0.62);
  }
  .nav-contact-key {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--gold);
  }
  .nav-contact-value {
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
  }

  html.nav-locked .site-header {
    background: var(--ink);
    border-bottom-color: rgba(253, 252, 247, 0.16);
    box-shadow: none;
  }
  html.nav-locked .brand-cn { color: var(--white); }
  html.nav-locked .brand-en { color: var(--green-bright); }
  html.nav-locked .nav-toggle {
    border-color: rgba(253, 252, 247, 0.55);
    color: var(--white);
  }
  html.nav-locked .nav-toggle-bar { background: var(--white); }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col-brand { grid-column: 1 / -1; }
}

/* ---------- small mobile ---------- */
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
  }
  .display { font-size: clamp(32px, 9vw, 44px); }
}

@media (max-width: 900px) {
  .col-3, .col-4, .col-5, .col-6,
  .col-7, .col-8, .col-9 { grid-column: span 12; }
}

/* ---------- 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;
    transform: none;
  }
  .btn:hover,
  .fav-button:hover { transform: none; }
}
