/* ═══════════════════════════════════════════════
   寻音实验室 XUNYIN LAB — styles
   Palette: 墨 ink / 绢纸 paper / 朱砂 cinnabar / 鎏金 gold
   ═══════════════════════════════════════════════ */

:root {
  --ink: #0b0b0d;
  --ink-2: #121215;
  --paper: #f4efe6;
  --paper-dim: rgba(244, 239, 230, 0.62);
  --paper-faint: rgba(244, 239, 230, 0.34);
  --line: rgba(244, 239, 230, 0.14);
  --gold: #d4a24e;
  --cinnabar: #c8452c;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Space Grotesk", "Noto Sans SC", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
@media (hover: none) { body { cursor: auto; } .cursor, .cursor-dot { display: none !important; } }

::selection { background: var(--cinnabar); color: var(--paper); }

a { color: inherit; text-decoration: none; cursor: none; }
img { display: block; max-width: 100%; }

/* ─────────── Grain ─────────── */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 200;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) }
  40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-2%) }
  80% { transform: translate(3%,3%) }
}

/* ─────────── Cursor ─────────── */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1px solid var(--paper-faint);
  border-radius: 50%;
  pointer-events: none; z-index: 300;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease),
              border-color 0.35s, background 0.35s;
  display: grid; place-items: center;
}
.cursor::after {
  content: attr(data-label);
  font-size: 10px; letter-spacing: 0.2em;
  color: var(--ink); opacity: 0;
  transition: opacity 0.25s;
}
.cursor.is-link { width: 56px; height: 56px; border-color: var(--gold); }
.cursor.is-view {
  width: 84px; height: 84px;
  background: var(--gold); border-color: var(--gold);
}
.cursor.is-view::after { opacity: 1; }
.cursor-dot {
  position: fixed; top: 0; left: 0;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  pointer-events: none; z-index: 301;
  transform: translate(-50%, -50%);
}

/* ─────────── Preloader ─────────── */
.preloader {
  position: fixed; inset: 0; z-index: 400;
  background: var(--ink);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
}
.preloader-inner { display: flex; overflow: hidden; }
.preloader-char {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(44px, 8vw, 96px);
  color: var(--paper);
  transform: translateY(110%);
  display: inline-block;
}
.preloader-char:nth-child(2) { color: var(--gold); }
.preloader-sub {
  font-size: 11px; letter-spacing: 0.55em;
  color: var(--paper-faint); opacity: 0;
}
.preloader-bar {
  width: min(320px, 60vw); height: 1px;
  background: var(--line); overflow: hidden;
}
.preloader-bar i {
  display: block; height: 100%; width: 0%;
  background: var(--gold);
}

/* ─────────── Nav ─────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(24px, 5vw, 64px);
  transition: transform 0.5s var(--ease), background 0.5s, backdrop-filter 0.5s;
}
.nav.is-scrolled {
  background: rgba(11, 11, 13, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-seal {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif); font-weight: 600; font-size: 18px;
  border-radius: 4px;
}
.nav-word { display: flex; flex-direction: column; line-height: 1.25; }
.nav-word b { font-family: var(--serif); font-weight: 600; font-size: 16px; letter-spacing: 0.1em; }
.nav-word small { font-size: 9px; letter-spacing: 0.4em; color: var(--paper-faint); }
.nav-links { display: flex; gap: 34px; }
.nav-links a {
  font-size: 13px; letter-spacing: 0.14em;
  color: var(--paper-dim);
  transition: color 0.3s;
  display: flex; align-items: baseline; gap: 6px;
}
.nav-links a i { font-style: normal; font-size: 9px; color: var(--gold); }
.nav-links a:hover { color: var(--paper); }
.nav-cta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: 0.1em;
  padding: 11px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.4s, color 0.4s, border-color 0.4s;
}
.nav-cta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.nav-cta:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
@media (max-width: 900px) { .nav-links { display: none; } }

/* ─────────── Hero ─────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 0 clamp(24px, 6vw, 80px);
  overflow: hidden;
}
#gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 65% at 50% 42%, transparent 40%, rgba(11,11,13,0.75) 100%),
    linear-gradient(to bottom, rgba(11,11,13,0.5), transparent 25%, transparent 70%, var(--ink));
}
.hero-inner { position: relative; z-index: 2; max-width: 1200px; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: clamp(20px, 3.5vh, 40px);
}
.hero-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cinnabar);
  box-shadow: 0 0 12px var(--cinnabar);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.hero-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(72px, 15vw, 208px);
  line-height: 1.02; letter-spacing: 0.04em;
  display: flex; flex-direction: column;
}
.hero-line { display: flex; overflow: hidden; }
.hero-line em {
  font-style: normal; display: inline-block;
  transform: translateY(115%);
  background: linear-gradient(160deg, var(--paper) 55%, rgba(212,162,78,0.85));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-en {
  margin-top: clamp(14px, 2.5vh, 28px);
  font-size: clamp(13px, 1.6vw, 20px);
  letter-spacing: 1.1em;
  color: var(--gold);
}
.hero-copy {
  margin-top: clamp(18px, 3vh, 32px);
  max-width: 520px;
  font-size: clamp(14px, 1.2vw, 17px);
  color: var(--paper-dim);
}
.hero-actions { display: flex; gap: 18px; margin-top: clamp(26px, 4vh, 46px); flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 34px;
  font-size: 14px; letter-spacing: 0.14em;
  border-radius: 999px;
  transition: transform 0.4s var(--ease), background 0.4s, color 0.4s, border-color 0.4s;
  will-change: transform;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn-solid { background: var(--paper); color: var(--ink); }
.btn-solid:hover { background: var(--gold); }
.btn-ghost { border: 1px solid var(--line); color: var(--paper-dim); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.hero-side {
  position: absolute; right: clamp(20px, 4vw, 56px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 20px;
  z-index: 2;
  writing-mode: vertical-rl;
  font-size: 10px; letter-spacing: 0.4em;
  color: var(--paper-faint);
}
.hero-scroll {
  position: absolute; left: clamp(24px, 6vw, 80px); bottom: 34px; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  font-size: 10px; letter-spacing: 0.4em;
  color: var(--paper-faint);
}
.hero-scroll i {
  width: 56px; height: 1px; background: var(--line);
  position: relative; overflow: hidden;
}
.hero-scroll i::after {
  content: ""; position: absolute; inset: 0;
  background: var(--gold);
  animation: scrollLine 2.2s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: translateX(-100%) } 60%,100% { transform: translateX(100%) }
}
@media (max-width: 900px) { .hero-side { display: none; } }

/* ─────────── Marquee ─────────── */
.marquee {
  display: flex; overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  background: var(--ink);
}
.marquee-track {
  display: flex; align-items: center; flex: none;
  gap: 44px; padding-right: 44px;
  animation: marquee 30s linear infinite;
}
.marquee-track span {
  font-family: var(--serif); font-size: 18px;
  letter-spacing: 0.2em; white-space: nowrap;
  color: var(--paper-dim);
}
.marquee-track b { color: var(--gold); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ─────────── Sections shared ─────────── */
.section { padding: clamp(100px, 14vw, 190px) clamp(24px, 6vw, 80px); position: relative; }
.section-head {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.section-index {
  font-size: 12px; color: var(--gold); letter-spacing: 0.2em;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px;
}
.section-kicker { font-size: 11px; letter-spacing: 0.42em; color: var(--paper-faint); }
.section-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 5.5vw, 72px);
  line-height: 1.3; letter-spacing: 0.02em;
  margin-bottom: clamp(50px, 7vw, 90px);
}
.accent { color: var(--gold); }

.split-text .word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.split-text .word > span { display: inline-block; transform: translateY(110%); }

/* ─────────── About ─────────── */
.about { background: var(--ink); }
.about-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 4.8vw, 62px);
  line-height: 1.45;
  max-width: 1100px;
  margin-bottom: clamp(50px, 7vw, 90px);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  margin-bottom: clamp(60px, 8vw, 110px);
}
.about-lead { font-size: clamp(15px, 1.35vw, 19px); color: var(--paper-dim); max-width: 560px; }
.about-lead strong { color: var(--paper); font-weight: 500; }
.about-facts { display: flex; flex-direction: column; gap: 4px; }
.fact {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.fact:first-child { border-top: 1px solid var(--line); }
.fact b {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 3.4vw, 46px);
  color: var(--gold);
}
.fact span { font-size: 13px; color: var(--paper-faint); letter-spacing: 0.08em; }

.about-figure { position: relative; overflow: hidden; border-radius: 10px; }
.about-figure img { width: 100%; height: 480px; object-fit: cover; transform: scale(1.15); }
.about-figure figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between;
  padding: 20px 26px;
  font-size: 11px; letter-spacing: 0.3em;
  color: var(--paper-dim);
  background: linear-gradient(transparent, rgba(11,11,13,0.8));
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

/* ─────────── Research ─────────── */
.research { background: var(--paper); color: var(--ink); }
.research .section-index { border-color: rgba(11,11,13,0.2); color: var(--cinnabar); }
.research .section-kicker { color: rgba(11,11,13,0.45); }
.research-list { border-top: 1px solid rgba(11,11,13,0.14); }
.research-item {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr 1.2fr;
  gap: clamp(20px, 4vw, 60px);
  align-items: start;
  padding: clamp(34px, 4.5vw, 56px) 10px;
  border-bottom: 1px solid rgba(11,11,13,0.14);
  overflow: hidden;
  transition: padding 0.5s var(--ease);
}
.research-item::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--ink);
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.55s var(--ease);
  z-index: 0;
}
.research-item:hover::before { transform: scaleY(1); }
.research-item > * { position: relative; z-index: 1; transition: color 0.4s; }
.research-item:hover { padding-left: 26px; }
.research-item:hover h3, .research-item:hover p { color: var(--paper); }
.research-item:hover .research-no { color: var(--gold); }
.research-no { font-size: 13px; letter-spacing: 0.2em; color: var(--cinnabar); padding-top: 8px; }
.research-item h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: 0.02em;
}
.research-item p { font-size: 15px; color: rgba(11,11,13,0.62); max-width: 560px; }
.research-tags { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 3; margin-top: 14px; }
.research-tags i {
  font-style: normal; font-size: 11px; letter-spacing: 0.1em;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(11,11,13,0.2);
  color: rgba(11,11,13,0.55);
  transition: border-color 0.4s, color 0.4s;
}
.research-item:hover .research-tags i { border-color: var(--line); color: var(--paper-faint); }
@media (max-width: 900px) {
  .research-item { grid-template-columns: 1fr; gap: 12px; }
  .research-tags { grid-column: auto; }
}

/* ─────────── Project ─────────── */
.project {
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(200, 69, 44, 0.12), transparent 60%),
    var(--ink-2);
}
.project-hero { margin-bottom: clamp(50px, 7vw, 90px); }
.project-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(44px, 8.5vw, 118px);
  line-height: 1.12; letter-spacing: 0.03em;
  background: linear-gradient(150deg, var(--paper) 50%, var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.project-sub {
  margin-top: 26px;
  font-size: 12px; letter-spacing: 0.28em; line-height: 2.1;
  color: var(--paper-faint);
}
.project-visual {
  position: relative;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: clamp(50px, 7vw, 90px);
}
.project-visual img { width: 100%; height: clamp(320px, 55vw, 620px); object-fit: cover; transform: scale(1.12); }
.visual-chip {
  position: absolute;
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 20px;
  background: rgba(11, 11, 13, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: float 5s ease-in-out infinite;
}
.visual-chip span { font-size: 9px; letter-spacing: 0.3em; color: var(--paper-faint); }
.visual-chip b { font-family: var(--serif); font-size: 22px; color: var(--gold); }
.visual-chip.c1 { top: 12%; left: 6%; animation-delay: 0s; }
.visual-chip.c2 { top: 45%; right: 8%; animation-delay: 1.2s; }
.visual-chip.c3 { bottom: 14%; left: 14%; animation-delay: 2.4s; }
.visual-chip.c3 b { color: #7fce8a; font-size: 16px; letter-spacing: 0.2em; }
@keyframes float { 50% { transform: translateY(-12px); } }

.project-cols {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  margin-bottom: clamp(50px, 7vw, 90px);
}
.project-desc p { font-size: clamp(15px, 1.3vw, 18px); color: var(--paper-dim); max-width: 600px; }
.project-desc b { color: var(--paper); font-weight: 500; }
.project-stack {
  list-style: none; margin-top: 30px;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.project-stack li {
  font-size: 12px; letter-spacing: 0.1em;
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--paper-dim);
}
.project-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
.metric {
  padding: 28px 24px;
  border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.4s, background 0.4s;
}
.metric:hover { border-color: var(--gold); background: rgba(212, 162, 78, 0.05); }
.metric b { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 38px); color: var(--gold); font-weight: 600; }
.metric span { font-size: 12px; color: var(--paper-faint); letter-spacing: 0.08em; }

.project-strip { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.project-strip img { width: 100%; height: 340px; object-fit: cover; transform: scale(1.1); }
.strip-caption {
  position: absolute; inset: auto 0 0 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 18px 24px;
  font-size: 11px; letter-spacing: 0.24em;
  color: var(--paper-dim);
  background: linear-gradient(transparent, rgba(11,11,13,0.85));
}
@media (max-width: 900px) {
  .project-cols { grid-template-columns: 1fr; }
  .visual-chip.c2 { right: 4%; }
}

/* ─────────── Vision ─────────── */
.vision { background: var(--ink); }
.vision-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 5vw, 64px);
  line-height: 1.4;
  margin-bottom: clamp(60px, 8vw, 110px);
}
.vision-roadmap {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.road-item {
  padding: 40px 32px 48px;
  border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.road-item:hover { transform: translateY(-8px); border-color: var(--gold); }
.road-phase {
  font-size: 10px; letter-spacing: 0.4em; color: var(--gold);
}
.road-item h4 { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.road-item p { font-size: 14px; color: var(--paper-dim); }
.road-item::after {
  content: ""; position: absolute; left: 32px; right: 32px; bottom: 0;
  height: 2px; background: linear-gradient(90deg, var(--cinnabar), var(--gold));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.road-item:hover::after { transform: scaleX(1); }
@media (max-width: 900px) { .vision-roadmap { grid-template-columns: 1fr; } }

/* ─────────── Contact ─────────── */
.contact {
  position: relative;
  min-height: 92svh;
  display: grid; place-items: center;
  text-align: center;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
#gl2 { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }
.contact-inner { position: relative; z-index: 2; padding: 120px 24px; }
.contact-kicker { font-size: 11px; letter-spacing: 0.5em; color: var(--gold); margin-bottom: 30px; }
.contact-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(40px, 7.5vw, 104px);
  line-height: 1.25;
  margin-bottom: clamp(40px, 6vh, 64px);
}
.contact-mail {
  display: inline-flex; align-items: center; gap: 16px;
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vw, 44px);
  color: var(--paper);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  transition: color 0.4s, border-color 0.4s;
  will-change: transform;
}
.contact-mail svg {
  width: clamp(20px, 2.6vw, 34px); height: clamp(20px, 2.6vw, 34px);
  fill: none; stroke: currentColor; stroke-width: 1.4;
  transition: transform 0.5s var(--ease);
}
.contact-mail:hover { color: var(--gold); border-color: var(--gold); }
.contact-mail:hover svg { transform: translate(4px, -4px); }
.contact-note { margin-top: 34px; font-size: 13px; color: var(--paper-faint); letter-spacing: 0.12em; }

/* ─────────── Footer ─────────── */
.footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
  padding: 34px clamp(24px, 6vw, 80px);
  border-top: 1px solid var(--line);
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand b { font-family: var(--serif); font-weight: 600; font-size: 15px; display: block; }
.footer-brand small { font-size: 11px; color: var(--paper-faint); letter-spacing: 0.1em; }
.footer-meta { display: flex; align-items: center; gap: 28px; font-size: 12px; color: var(--paper-faint); }
.footer-meta a { letter-spacing: 0.14em; transition: color 0.3s; }
.footer-meta a:hover { color: var(--gold); }

/* ─────────── Reveal defaults (JS animated) ─────────── */
.reveal, .reveal-line { opacity: 0; }
.no-js .reveal, .no-js .reveal-line { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
