:root {
  --ink: #0d1512;
  --moss: #1a2e26;
  --sand: #efe6d6;
  --mist: #b9c7bc;
  --amber: #c9a15b;
  --bark: #2a2218;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--sand);
  background: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— Hero: one composition, full-bleed —— */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  padding-bottom: clamp(3rem, 12vh, 5.5rem);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-img {
  transform: scale(1.08);
  animation: hero-drift 22s var(--ease) infinite alternate;
}

@keyframes hero-drift {
  from { transform: scale(1.08) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); }
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, rgba(13, 21, 18, 0.92) 0%, rgba(13, 21, 18, 0.45) 42%, rgba(13, 21, 18, 0.15) 70%, transparent 100%),
    linear-gradient(120deg, rgba(26, 46, 38, 0.35), transparent 50%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 28rem;
}

.brand {
  font-family: "ZCOOL XiaoWei", "Songti SC", serif;
  font-size: clamp(3.6rem, 15vw, 7rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1;
  color: var(--sand);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
  animation: brand-in 1.1s var(--ease) both;
}

.lede {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--mist);
  font-weight: 400;
  animation: brand-in 1.1s var(--ease) 0.12s both;
}

.cta {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.9rem 1.5rem;
  background: var(--amber);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: transform 0.2s var(--ease), background 0.2s;
  animation: brand-in 1.1s var(--ease) 0.22s both;
}

.cta:hover {
  background: #d9b36a;
  transform: translateY(-2px);
}

.cta:active {
  transform: scale(0.98);
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Chapters: photo + text, not cards —— */
.chapter {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: min(88vh, 52rem);
  background: var(--ink);
}

.chapter-flip {
  direction: rtl;
}

.chapter-flip > * {
  direction: ltr;
}

.chapter-visual {
  position: relative;
  min-height: 22rem;
  overflow: hidden;
}

.chapter-visual img {
  transition: transform 1.4s var(--ease);
}

.chapter.reveal.is-in .chapter-visual img {
  transform: scale(1.04);
}

.chapter-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4.5rem);
  background:
    radial-gradient(ellipse 80% 60% at 0% 50%, rgba(42, 74, 60, 0.35), transparent 60%),
    var(--moss);
}

.chapter[data-tone="cool"] .chapter-text {
  background:
    radial-gradient(ellipse 80% 60% at 100% 40%, rgba(40, 60, 72, 0.45), transparent 55%),
    #152328;
}

.chapter[data-tone="earth"] .chapter-text {
  background:
    radial-gradient(ellipse 70% 50% at 10% 80%, rgba(90, 70, 40, 0.35), transparent 55%),
    #1c1914;
}

.chapter[data-tone="leaf"] .chapter-text {
  background:
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(55, 90, 50, 0.4), transparent 55%),
    #14241a;
}

.chapter.night .chapter-text {
  background:
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(80, 90, 40, 0.2), transparent 50%),
    #0a1210;
}

.chapter.night .chapter-visual img {
  filter: brightness(0.72) saturate(0.85) hue-rotate(-8deg);
}

.chapter[data-tone="bark"] .chapter-text {
  background: #1a1510;
}

.chapter[data-tone="field"] .chapter-text {
  background:
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(110, 95, 40, 0.28), transparent 55%),
    #171a12;
}

.idx {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: 2rem;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.chapter-text h2 {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.chapter-text p:not(.idx) {
  color: var(--mist);
  max-width: 22rem;
  font-size: 1.02rem;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* —— ESP demo panel (interactive → panel ok) —— */
.esp-lab {
  padding: clamp(3.5rem, 10vw, 6rem) clamp(1.5rem, 5vw, 3.5rem);
  max-width: 40rem;
  margin: 0 auto;
  text-align: left;
}

.esp-lab h2 {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.esp-lead {
  color: var(--mist);
  margin-bottom: 1.75rem;
}

.esp-panel {
  padding: 1.5rem;
  background: rgba(20, 32, 26, 0.85);
  border: 1px solid rgba(197, 212, 203, 0.14);
}

.esp-status {
  font-size: 0.9rem;
  color: var(--mist);
  min-height: 1.4em;
  margin-bottom: 1rem;
}

.esp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.esp-btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.85rem 1.35rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.esp-btn:active {
  transform: scale(0.98);
}

.esp-primary {
  background: var(--amber);
  color: var(--ink);
}

.esp-primary:hover {
  background: #d9b36a;
}

.esp-ghost {
  background: transparent;
  color: #e8a090;
  border-color: rgba(232, 160, 144, 0.4);
}

.esp-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.esp-hint {
  margin-top: 1.15rem;
  font-size: 0.82rem;
  color: rgba(185, 199, 188, 0.7);
}

.esp-hint strong {
  color: var(--sand);
  font-weight: 500;
}

.site-foot {
  padding: 2.5rem clamp(1.5rem, 5vw, 3.5rem) 3.5rem;
  text-align: center;
  color: rgba(185, 199, 188, 0.55);
  font-size: 0.82rem;
  border-top: 1px solid rgba(197, 212, 203, 0.08);
}

.site-foot .credits {
  margin-top: 0.4rem;
}

.site-foot a {
  color: var(--amber);
  text-decoration: none;
}

.site-foot a:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .chapter,
  .chapter-flip {
    grid-template-columns: 1fr;
    direction: ltr;
    min-height: auto;
  }

  .chapter-visual {
    min-height: 55vw;
    max-height: 22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-img,
  .brand,
  .lede,
  .cta,
  .reveal,
  .chapter-visual img {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
