/* ==========================================================================
   四川凯尔化工 · 第四十届中国植保双交会邀请函
   基于 creative-agency-cinematic-landing 模板骨架，仅做 ADAPTIVE 主题适配：
   - theme_tokens：深黑 #0B0B0D / #121212 + 米白 #F2EFE6 + 金 #C8973E / #D4AF37
   - copy_fit：中文行高/字距调整，避免 title-mask 裁切与负字距叠字
   - media_fit：去除灰度/降饱和滤镜，保留产品包装原色与金色氛围
   - 布局结构、动效 selector、DOM 骨架保持模板 LOCKED 原样
   ========================================================================== */

:root {
  --ink: #0B0B0D;
  --ink-soft: #121212;
  --paper: #F2EFE6;
  --gold: #C8973E;
  --gold-bright: #D4AF37;
  --line: rgba(200, 151, 62, .30);
  --pad: clamp(1.25rem, 4vw, 5rem);
  /* 字体：标题衬线（Playfair Display 处理拉丁/数字 + Noto Serif SC 处理中文），
     正文无衬线（Inter + Noto Sans SC）。字体 CSS 由 main.js 动态注入，
     不可达时落入本地宋体/黑体回退栈。 */
  --display: "Playfair Display", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --body: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --num: "Playfair Display", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: .72rem;
  line-height: 1.5;
  letter-spacing: .2em;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--ink);
}
.preloader p {
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 700;
  letter-spacing: .12em;
}
.preloader__rule {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
}
#preloader-count {
  position: absolute;
  right: var(--pad);
  bottom: 2rem;
  color: var(--gold-bright);
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 1.6rem var(--pad);
  font-size: .78rem;
  letter-spacing: .15em;
}
.brand { color: var(--paper); font-weight: 700; }
.header-link { color: var(--gold-bright); }

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ink);
}
.hero__media, .hero__veil { position: absolute; inset: 0; }
/* 性能：大图不挂常驻 transform/scale（软件渲染下滚动重绘过贵）；
   gsap scrub 视差仍由 runtime 提供，静态视觉差异极小 */
.hero__media img { opacity: .58; }
.hero__veil {
  background:
    radial-gradient(circle at 72% 45%, transparent 0 10%, rgba(0,0,0,.13) 45%),
    linear-gradient(180deg, rgba(0,0,0,.72), transparent 34%, rgba(0,0,0,.78));
}
.hero__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 8rem var(--pad) 3rem;
}
.hero__copy > .eyebrow { margin: 0 0 2rem .5vw; color: var(--gold-bright); }
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 9.6vw, 9.5rem);
  font-weight: 900;
  line-height: .98;          /* CJK 衬线需要更高行高，避免 title-mask 裁切 */
  letter-spacing: .04em;    /* 中文标题禁用负字距 */
}
.title-mask { display: block; overflow: hidden; padding-bottom: .12em; }
.hero-line { display: block; will-change: transform; }
.title-line--offset { margin-left: 10vw; }
.title-line--outline {
  margin-left: 25vw;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gold-bright);  /* 描边行用金色（theme token） */
}
.hero__foot {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-top: 3rem;
}
.hero__foot p { max-width: 34rem; margin: 0; color: rgba(242,239,230,.75); font-size: .95rem; line-height: 1.8; }
.scroll-cue {
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: .72rem;
  letter-spacing: .16em;
  white-space: nowrap;
}

/* about 区：模板原为浅色反白，整体风格为深色+金色 → 反转为深色（ADAPTIVE theme_tokens） */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  min-height: 100svh;
  color: var(--paper);
  background: var(--ink-soft);
}
.about__media { position: relative; min-height: 100svh; overflow: hidden; }
.about__media img { }  /* 去灰度去常驻 scale，保留金色麦穗原色；视差由 gsap scrub 提供 */
.media-index {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: .55rem .7rem;
  color: var(--gold-bright);
  border: 1px solid var(--line);
  background: rgba(11,11,13,.82);
  font-family: var(--num);
  font-size: .62rem;
  letter-spacing: .15em;
}
.about__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(4rem, 9vw, 9rem) var(--pad);
}
.about__copy .eyebrow { color: var(--gold-bright); }
.about h2 {
  margin: 2rem 0;
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.4vw, 3.8rem);
  font-weight: 700;
  line-height: 1.28;        /* CJK 标题行高 */
  letter-spacing: .02em;
}
.about__body { max-width: 36rem; margin: 0; color: rgba(242,239,230,.76); font-size: clamp(.95rem, 1.2vw, 1.15rem); line-height: 1.9; }
.text-link {
  align-self: start;
  margin-top: 3rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: .8rem;
  letter-spacing: .14em;
}
.text-link span { margin-left: 1.2rem; color: var(--gold); }

.work {
  position: relative;
  height: 100svh;
  overflow: hidden;
  background: var(--ink);
}
.work__label { position: absolute; top: 2rem; left: var(--pad); z-index: 3; color: var(--gold); }
.work__track {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  width: max-content;
  height: 100%;
  padding: 5rem var(--pad) 2rem;
  /* 性能：不设常驻 will-change（否则含 5 张大图的整条横轨被提升为单一永久合成层，
     全页捕获时一次性光栅化导致超时）；gsap 动画期间浏览器仍会自动提升 */
}
.work-intro {
  width: min(31rem, 37vw);
  flex: none;
}
.work-intro > p { color: var(--gold); font-size: .72rem; letter-spacing: .16em; }
.work-intro h2 {
  margin: 1.5rem 0;
  font-family: var(--display);
  font-size: clamp(3rem, 5.4vw, 6.2rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .03em;
}
.work-intro em { color: transparent; font-style: normal; -webkit-text-stroke: 1.5px var(--gold-bright); }
.work-intro__line { display: block; width: 5rem; height: 1px; margin-top: 3rem; background: var(--gold); }
.project-card {
  position: relative;
  width: min(44rem, 46vw);
  height: 68vh;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-soft);
}
.project-card__media { position: absolute; inset: 0; overflow: hidden; }
.project-card__media img { object-position: center; }  /* 竖版包装居中，保留标签主体，不拉伸 */
.project-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 44%, rgba(0,0,0,.88));
}
.project-card img { transition: transform .8s cubic-bezier(.2,.75,.2,1); }  /* 去降饱和滤镜，保留包装原色 */
.project-card:hover img { transform: scale(1.045); }
.project-card__meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  padding: 2rem;
}
.project-card__meta span { grid-row: span 2; color: var(--gold-bright); font-family: var(--num); font-size: .9rem; }
.project-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.8vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
}
.project-card p { margin: .7rem 0 0; color: rgba(242,239,230,.66); font-size: .74rem; letter-spacing: .1em; line-height: 1.6; }
.work__end { width: 10rem; flex: none; color: var(--gold); font-family: var(--num); font-size: .65rem; letter-spacing: .2em; transform: rotate(-90deg); }

.experiment {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ink-soft);
}
#particle-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.experiment__copy { position: relative; z-index: 1; max-width: 56rem; padding: var(--pad); text-align: center; pointer-events: none; }
.experiment__copy .eyebrow { color: var(--gold-bright); }
.experiment h2 {
  margin: 2rem 0;
  font-family: var(--display);
  font-size: clamp(3.2rem, 8.4vw, 8.4rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: .04em;
}
.experiment h2 span { color: transparent; -webkit-text-stroke: 1.5px var(--gold-bright); }
.experiment__copy > p:last-child { max-width: 35rem; margin: 0 auto; color: rgba(242,239,230,.66); font-size: .95rem; line-height: 1.9; }

.footer {
  min-height: 78svh;
  padding: 7rem var(--pad) 2rem;
  border-top: 1px solid var(--line);
  background: var(--ink);
}
.footer > .eyebrow { color: var(--gold-bright); }
.footer__headline {
  display: inline-block;
  margin: 2rem 0 6rem;
  font-family: var(--display);
  font-size: clamp(3rem, 9.6vw, 9.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .03em;
}
.footer__details {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: rgba(242,239,230,.58);
  font-size: .78rem;
  line-height: 1.7;
}
.footer__details a { color: var(--gold-bright); }
.footer__details p { margin: 0; }
.footer__details p:last-child { text-align: right; }

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 11000;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.cursor--inner { width: 9px; height: 9px; border: 1px solid var(--gold-bright); }
.cursor--outer {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(200,151,62,.72);
  transition: width .25s, height .25s, background-color .25s;
}
.cursor--outer span { opacity: 0; color: var(--ink); font-size: .52rem; font-weight: 700; letter-spacing: .1em; transition: opacity .2s; }
.cursor--outer.is-active { width: 70px; height: 70px; background: var(--gold-bright); }
.cursor--outer.is-active span { opacity: 1; }

@media (pointer: fine) and (min-width: 769px) {
  body, a { cursor: none; }
}

@media (max-width: 768px) {
  .site-header { position: absolute; }
  .header-link { display: none; }
  .hero__copy { justify-content: end; padding-bottom: 2rem; }
  .hero h1 { font-size: clamp(2.9rem, 14vw, 6rem); line-height: 1.02; }
  .hero-line { white-space: nowrap; }
  .title-line--offset { margin-left: 0; }
  .title-line--outline { margin-left: 0; }
  .hero__foot { display: block; }
  .hero__foot p { font-size: .9rem; }
  .scroll-cue { display: inline-block; margin-top: 2rem; }
  .about { grid-template-columns: 1fr; }
  .about__media { min-height: 64svh; }
  .about__copy { min-height: auto; }
  .work {
    height: auto;
    overflow: visible;
    padding: 7rem var(--pad) 5rem;
  }
  .work__label { top: 3rem; }
  .work__track {
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    transform: none !important;
  }
  .work-intro { width: 100%; margin-bottom: 4rem; }
  .project-card { width: 100%; height: auto; aspect-ratio: 4 / 5; margin-bottom: 2rem; }
  .project-card__media img { object-position: center; }
  .work__end { display: none; }
  .experiment h2 { font-size: clamp(2.8rem, 15vw, 6rem); }
  .footer { min-height: 70svh; }
  .footer__headline { margin-bottom: 5rem; font-size: clamp(2.6rem, 13vw, 6rem); }
  .footer__details { grid-template-columns: 1fr; }
  .footer__details p:last-child { text-align: left; }
  .cursor { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .hero-line, .hero-reveal, .reveal { opacity: 1 !important; transform: none !important; }
  .hero__media img, .about__media img { transform: none !important; }
  .cursor { display: none !important; }
}
