:root {
  --ink: #121211;
  --ink-soft: #1b1a18;
  --paper: #e8e0d2;
  --muted: #aaa095;
  --red: #a83c32;
  --red-bright: #bc4a3e;
  --gold: #b49a72;
  --line: rgba(232, 224, 210, .22);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', Arial, sans-serif;
  --mono: 'DM Mono', monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body { margin: 0; color: var(--paper); background: var(--ink); font-family: var(--sans); }
button, textarea { font: inherit; }
button { cursor: pointer; }

.site-shell { position: relative; max-width: 900px; margin: 0 auto; overflow: hidden; background: var(--ink); }
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .055; z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

/* Top bar */
.topbar {
  height: 74px; padding: 20px clamp(22px, 5vw, 64px);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); position: relative; z-index: 3;
}
.wordmark {
  color: var(--paper); text-decoration: none; display: flex; gap: 10px;
  align-items: baseline; font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
}
.wordmark span:first-child { color: var(--gold); }
.topbar-actions { display: flex; gap: 8px; }
.icon-button {
  background: transparent; color: var(--paper); border: 1px solid var(--line);
  border-radius: 50%; width: 32px; height: 32px; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s;
}
.icon-button:hover { border-color: var(--gold); color: var(--gold); }
.slash { color: var(--muted); margin: 0 2px; }
.lang-zh { color: var(--muted); }
.lang-en.active { color: var(--gold); }
body.zh .lang-zh { color: var(--gold); }
body.zh .lang-en { color: var(--muted); }
body.zh .lang-en.active { color: var(--muted); }

/* Hero */
.hero {
  min-height: 660px; position: relative; display: grid;
  grid-template-columns: 43% 57%;
  padding: 82px clamp(22px, 5vw, 64px) 40px;
  border-bottom: 1px solid var(--line);
}
.hero-copy { position: relative; z-index: 2; align-self: end; padding-bottom: 30px; }
.eyebrow, .section-label, .card-kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  color: var(--gold); line-height: 1.7; margin: 0 0 22px; text-transform: uppercase;
}
h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(48px, 8vw, 92px); line-height: .93;
  letter-spacing: -.055em; margin: 0 0 30px;
}
.hero-note {
  font-family: var(--mono); color: var(--muted);
  font-size: 11px; letter-spacing: .1em; margin: 0 0 26px;
}
.primary-button {
  border: 0; color: var(--paper);
  background: linear-gradient(135deg, var(--red-bright), #86312a);
  border-radius: 8px; min-height: 58px; padding: 0 22px;
  display: inline-flex; align-items: center; justify-content: space-between;
  gap: 38px; font-family: var(--serif); font-size: 18px;
  box-shadow: 0 14px 36px rgba(129, 43, 35, .22);
  transition: transform .2s ease, background .2s ease;
}
.primary-button:hover { transform: translateY(-2px); background: linear-gradient(135deg, #c45246, #96362e); }
.button-arrow { font-family: var(--sans); font-size: 26px; font-weight: 400; }

/* Monument scene */
.monument-scene {
  position: relative; min-height: 540px; overflow: hidden;
  background: radial-gradient(circle at 55% 32%, rgba(173, 60, 47, .22), transparent 32%),
              linear-gradient(180deg, transparent, rgba(0,0,0,.3));
}
.sun {
  position: absolute; width: 290px; height: 290px; border-radius: 50%;
  right: 18%; top: 3%; background: var(--red); opacity: .82; filter: blur(.4px);
}
.horizon {
  position: absolute; left: -8%; right: -8%; bottom: 24%; height: 1px;
  background: rgba(180,154,114,.45); transform: rotate(-7deg);
}
.monument {
  position: absolute; right: 14%; bottom: 11%; width: 150px; height: 370px;
  filter: drop-shadow(10px 12px 12px rgba(0,0,0,.45));
}
.obelisk {
  height: 315px; width: 82px; margin: 50px auto 0;
  background: linear-gradient(90deg, #71695d, #bbb09d 43%, #5c544b);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  display: flex; align-items: center; justify-content: center; padding-top: 50px;
  color: #191817; font-family: 'Songti SC', 'Noto Serif SC', serif;
  font-size: 19px; line-height: 1.2; text-align: center; writing-mode: vertical-rl;
}
.star {
  color: var(--paper); font-size: 29px; text-align: center;
  position: absolute; left: 50%; top: 1px; transform: translateX(-50%);
}
.base { position: absolute; left: 0; right: 0; margin: auto; background: linear-gradient(180deg, #80776a, #403c36); }
.base-one { height: 26px; width: 135px; bottom: 31px; }
.base-two { height: 20px; width: 150px; bottom: 11px; }
.tree {
  position: absolute; bottom: 5%; width: 145px; height: 230px;
  background: #080908; opacity: .85;
  clip-path: polygon(45% 0,55% 0,60% 31%,100% 52%,70% 54%,91% 77%,62% 70%,79% 100%,50% 79%,20% 100%,37% 70%,9% 77%,30% 54%,0 52%,40% 31%);
}
.tree-left { left: -2%; }
.tree-right { right: -2%; transform: scaleX(-1); }

/* Story intro */
.story-intro, .route-section, .reflection, .site-footer { padding: 78px clamp(22px, 5vw, 64px); }
.story-intro { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.story-intro h2, .route-section h2, .reflection h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 5vw, 64px); line-height: .98;
  letter-spacing: -.05em; margin: 0;
}
.section-deck { max-width: 260px; color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 3px; }

/* Story rail */
.story-rail {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.story-card {
  min-height: 430px; padding: 26px clamp(18px, 3vw, 36px) 0;
  position: relative; overflow: hidden; border-right: 1px solid var(--line);
}
.story-card:last-child { border-right: 0; }
.story-card-place { background: linear-gradient(180deg, #22211e, #35312a); }
.story-card-people { background: linear-gradient(180deg, #2b2a26, #201f1b); }
.story-card-present { background: linear-gradient(180deg, #181b1b, #232b2a); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 45px; }
.card-top > span { font-family: var(--serif); color: var(--red-bright); font-size: 54px; line-height: .8; }
.listen-button {
  background: transparent; border: 1px solid var(--line); color: var(--gold);
  border-radius: 50%; width: 28px; height: 28px; font-size: 11px;
  transition: color .2s, background .2s, border-color .2s;
}
.listen-button.playing { color: var(--paper); background: var(--red); border-color: var(--red); }
.card-kicker { font-size: 9px; margin-bottom: 16px; }
.story-card h3 {
  font-family: var(--serif); font-size: clamp(24px, 3vw, 36px);
  line-height: 1.02; letter-spacing: -.04em; font-weight: 500; margin: 0 0 20px;
}
.card-text { position: relative; z-index: 2; color: #c3b9ac; font-size: 13px; line-height: 1.55; max-width: 280px; }
.mini-monument { position: absolute; right: 12%; bottom: -18px; width: 120px; height: 180px; opacity: .5; }
.mini-star { color: #d0c3ad; text-align: center; font-size: 14px; }
.mini-pillar { width: 30px; height: 150px; margin: 0 auto; background: #887d6e; clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); }
.people-silhouette { position: absolute; bottom: -4px; left: 10%; right: 6%; height: 130px; display: flex; align-items: end; gap: 10px; opacity: .45; }
.people-silhouette span { display: block; width: 34px; height: 84px; background: #070808; clip-path: polygon(38% 0,62% 0, 72% 19%, 60% 32%, 90% 100%, 60% 100%,50% 53%,40% 100%,10% 100%,40% 32%,28% 19%); }
.city-line { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: end; gap: 7px; padding: 0 22px; height: 120px; opacity: .38; }
.city-line i { display: block; width: 13%; background: #70736d; }
.city-line i:nth-child(1) { height: 43%; }
.city-line i:nth-child(2) { height: 66%; }
.city-line i:nth-child(3) { height: 82%; }
.city-line i:nth-child(4) { height: 54%; }
.city-line i:nth-child(5) { height: 93%; }
.city-line i:nth-child(6) { height: 72%; }

/* Route section */
.route-section { display: grid; grid-template-columns: 35% 65%; gap: 20px; align-items: center; background: #141716; }
.route-map {
  height: 360px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 48% 50%, rgba(99, 105, 95, .22), transparent 53%), #171a18;
  border: 1px solid var(--line);
}
.route-map::before, .route-map::after {
  content: ''; position: absolute; border: 1px solid rgba(180,154,114,.12);
  border-radius: 48%; transform: rotate(-20deg);
}
.route-map::before { width: 100%; height: 65%; left: -6%; top: 21%; }
.route-map::after { width: 80%; height: 32%; right: -22%; top: 4%; }
.map-line {
  position: absolute; left: 25%; top: 22%; width: 48%; height: 58%;
  border: 4px solid var(--red-bright); border-left-color: transparent; border-bottom-color: transparent;
  border-radius: 50%; transform: rotate(18deg);
}
.map-water { position: absolute; border: 1px solid rgba(107, 145, 140, .24); border-radius: 50%; }
.water-one { width: 250px; height: 70px; bottom: 18px; left: -30px; transform: rotate(23deg); }
.water-two { width: 190px; height: 48px; top: 28px; right: -44px; transform: rotate(-12deg); }
.map-label { position: absolute; left: 13%; bottom: 22%; color: var(--gold); font-family: var(--mono); font-size: 10px; letter-spacing: .16em; line-height: 1.6; }
.map-label span { color: var(--muted); letter-spacing: .06em; }
.route-node { position: absolute; color: var(--paper); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; display: flex; flex-direction: column; gap: 5px; }
.route-node b { display: grid; place-items: center; border: 1px solid var(--paper); width: 32px; height: 32px; border-radius: 50%; font-weight: 500; background: var(--ink-soft); }
.node-one { left: 26%; top: 23%; }
.node-two { left: 54%; top: 46%; }
.node-three { left: 69%; top: 75%; }
.route-heading .section-label { margin-bottom: 25px; }
.route-heading h2 { color: var(--paper); }

/* Reflection */
.reflection {
  text-align: center;
  background: radial-gradient(circle at 50% 0, rgba(163,57,47,.16), transparent 42%), #171615;
  border-top: 1px solid var(--line);
}
.branch-mark { color: var(--gold); font-size: 48px; line-height: .7; transform: rotate(-24deg); margin-bottom: 24px; }
.reflection .section-label { margin-bottom: 18px; }
.reflection h2 { max-width: 720px; margin: 0 auto 18px; }
.reflection > p { color: var(--muted); font-size: 15px; margin: 0 auto 26px; }
.outline-button {
  color: var(--paper); background: transparent; border: 1px solid var(--line);
  padding: 12px 18px; display: inline-flex; align-items: center; gap: 30px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; transition: border .2s, color .2s;
}
.outline-button:hover { color: var(--gold); border-color: var(--gold); }
.memory-form { max-width: 430px; margin: 24px auto 0; text-align: left; }
.memory-form label { display: block; color: var(--gold); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; margin-bottom: 10px; }
.memory-form textarea {
  width: 100%; color: var(--paper); background: rgba(255,255,255,.04);
  border: 1px solid var(--line); padding: 14px; resize: vertical; outline: none; min-height: 90px;
}
.memory-form textarea:focus { border-color: var(--gold); }
.small-button { margin-top: 12px; min-height: 44px; font-size: 14px; }
.saved-note { color: var(--gold); font-family: var(--mono); font-size: 10px; margin-top: 14px !important; }

/* QR section */
.qr-section {
  padding: 78px clamp(22px, 5vw, 64px);
  background: radial-gradient(circle at 50% 100%, rgba(163,57,47,.16), transparent 50%), #171615;
  border-top: 1px solid var(--line);
}
.qr-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
}
.qr-box {
  width: 200px; height: 200px;
  background: var(--paper);
  padding: 14px;
  border-radius: 6px;
  box-shadow: 0 18px 42px rgba(0,0,0,.4);
}
.qr-box img, .qr-box canvas { display: block; width: 100% !important; height: 100% !important; }
.qr-copy h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 4vw, 44px); line-height: 1;
  letter-spacing: -.04em; margin: 0 0 16px;
}
.qr-note { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 380px; margin: 0; }

@media (max-width: 700px) {
  .qr-card { grid-template-columns: 1fr; gap: 28px; justify-items: center; text-align: center; }
  .qr-copy { text-align: center; }
  .qr-note { margin: 0 auto; }
}

/* Footer */
.site-footer {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 22px;
  border-top: 1px solid var(--line); color: var(--muted);
  font-family: var(--mono); font-size: 9px; letter-spacing: .08em;
}
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }
.footer-cn { color: var(--paper); margin-right: 14px; }
.footer-en { color: var(--muted); }
.site-footer p { grid-column: 1 / -1; max-width: 610px; line-height: 1.6; margin: 14px 0 0; }

/* Footer QR — jumps to #guide */
.footer-qr {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
}
.footer-qr-box {
  width: 96px; height: 96px; background: var(--paper);
  padding: 6px; border-radius: 4px; flex-shrink: 0;
}
.footer-qr-box img, .footer-qr-box canvas { display: block; width: 100% !important; height: 100% !important; }
.footer-qr-label { display: flex; flex-direction: column; gap: 3px; line-height: 1.4; }
.footer-qr-label b { color: var(--paper); font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.footer-qr-label span { color: var(--muted); font-size: 9px; letter-spacing: .08em; }

/* Language switching */
.zh-copy, body.zh .en-copy, body.zh .en-title { display: none; }
body.zh .zh-copy, body.zh .zh-title { display: inline; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  opacity: 0; pointer-events: none; background: var(--paper); color: var(--ink);
  padding: 10px 14px; font-family: var(--mono); font-size: 10px;
  z-index: 20; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Scroll reveal */
.reveal-on-scroll { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 700px) {
  .hero { min-height: 760px; grid-template-columns: 1fr; padding-top: 62px; }
  .hero-copy { align-self: start; padding-top: 10px; }
  .monument-scene { min-height: 360px; margin-top: 8px; }
  .sun { width: 250px; height: 250px; right: 8%; top: 10%; }
  .monument { transform: scale(.82); transform-origin: bottom right; right: 8%; bottom: 2%; }
  .tree { transform: scale(.8); transform-origin: bottom; }
  .tree-right { transform: scaleX(-.8) scaleY(.8); }
  .story-intro { display: block; }
  .section-deck { margin-top: 22px; }
  .story-rail { grid-template-columns: 1fr; }
  .story-card { min-height: 390px; border-right: 0; border-bottom: 1px solid var(--line); }
  .story-card:last-child { border-bottom: 0; }
  .route-section { grid-template-columns: 1fr; }
  .route-map { height: 320px; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer p { grid-column: auto; }
  .footer-cn, .footer-en { display: block; margin: 0 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
