/* =========================================================
   靈樞智能 LINGSHU INTELLIGENCE — Design System
   空灵 + 实用主义 / 经络 × 瑞士网格
   ========================================================= */

:root {
  /* --- Color: warm paper, warm ink, one slate-cyan accent --- */
  --paper:        oklch(0.962 0.008 85);
  --paper-2:      oklch(0.935 0.010 84);
  --paper-3:      oklch(0.908 0.012 82);
  --ink:          oklch(0.205 0.006 70);
  --ink-2:        oklch(0.380 0.006 70);
  --ink-3:        oklch(0.560 0.006 75);
  --hair:         oklch(0.205 0.006 70 / 0.14);
  --hair-2:       oklch(0.205 0.006 70 / 0.07);

  --accent:       oklch(0.520 0.072 235);
  --accent-deep:  oklch(0.430 0.070 240);
  --accent-soft:  oklch(0.520 0.072 235 / 0.10);

  /* --- Type --- */
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans:  "Noto Sans SC", -apple-system, "PingFang SC", sans-serif;
  --mono:  "Space Mono", ui-monospace, "SF Mono", monospace;

  /* --- Rhythm --- */
  --mx: clamp(20px, 6vw, 120px);     /* page side margin */
  --maxw: 1360px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 350;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  cursor: none;
}

/* subtle paper grain via background; quiet, not noisy */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 90% at 80% -10%, oklch(0.52 0.072 235 / 0.05), transparent 55%),
    radial-gradient(90% 70% at -10% 100%, oklch(0.52 0.072 235 / 0.035), transparent 55%);
  mix-blend-mode: multiply;
}

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

/* ---------- Custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none; border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
}
.cursor-dot {
  width: 6px; height: 6px; background: var(--ink);
  transition: width .25s var(--ease), height .25s var(--ease), background .25s;
}
.cursor-ring {
  width: 30px; height: 30px; border: 1px solid var(--ink);
  opacity: .35;
  transition: width .3s var(--ease), height .3s var(--ease),
              opacity .3s, border-color .3s, background .3s;
}
.cursor-ring.hot {
  width: 56px; height: 56px; opacity: .9;
  border-color: var(--accent); background: var(--accent-soft);
}
@media (hover: none) { body { cursor: auto; } .cursor-dot, .cursor-ring { display: none; } }

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--mx); position: relative; z-index: 2; }
.grid12 { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(14px, 2vw, 28px); }

/* ---------- Type scale ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 400;
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--accent);
}
.idx {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em;
  color: var(--accent); font-weight: 700;
}
.display {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(40px, 7.2vw, 104px); line-height: 1.04;
  letter-spacing: -0.012em; text-wrap: balance;
}
.h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 4.6vw, 60px); line-height: 1.12;
  letter-spacing: -0.01em; text-wrap: balance;
}
.h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(21px, 2.4vw, 30px); line-height: 1.22;
}
.lead {
  font-size: clamp(16px, 1.45vw, 20px); line-height: 1.78;
  color: var(--ink-2); font-weight: 350; max-width: 56ch; text-wrap: pretty;
}
.en { font-family: var(--mono); font-weight: 400; letter-spacing: 0.02em; }
.muted { color: var(--ink-3); }

/* ---------- Buttons (magnetic) ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--sans); font-size: 15px; font-weight: 450; letter-spacing: 0.02em;
  padding: 16px 28px; border-radius: 2px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  text-decoration: none; overflow: hidden; will-change: transform; white-space: nowrap;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s;
}
.btn .arr { transition: transform .4s var(--ease); }
.btn:hover .arr { transform: translateX(6px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn__fill {
  position: absolute; inset: 0; background: var(--accent);
  transform: scaleY(0); transform-origin: bottom; z-index: -1;
  transition: transform .5s var(--ease);
}
.btn:hover { border-color: var(--accent); }
.btn:hover .btn__fill { transform: scaleY(1); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--mx);
  transition: padding .5s var(--ease), background .5s, backdrop-filter .5s, border-color .5s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding-block: 14px;
  background: oklch(0.962 0.008 85 / 0.72);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--hair-2);
}
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); }
.brand__zh { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: 0.04em; }
.brand__en { font-family: var(--mono); font-size: 10px; letter-spacing: 0.34em; color: var(--ink-3); text-transform: uppercase; }
.nav__links { display: flex; align-items: center; gap: 38px; }
.nav__links a { font-size: 14px; color: var(--ink-2); text-decoration: none; position: relative; transition: color .3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px;
  background: var(--accent); transition: width .35s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  font-size: 14px; color: var(--ink); text-decoration: none;
  padding: 9px 20px; border: 1px solid var(--ink); border-radius: 2px;
  transition: background .35s var(--ease), color .35s;
}
.nav__cta:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ---------- Scroll spine (脉络脊线) ---------- */
.spine {
  position: fixed; left: 28px; top: 50%; transform: translateY(-50%);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 0;
  mix-blend-mode: multiply;
}
.spine__track { position: relative; width: 1px; height: 40vh; background: var(--hair); }
.spine__fill { position: absolute; top: 0; left: 0; width: 1px; height: 0; background: var(--accent); }
.spine__nodes { position: absolute; inset: 0; }
.spine__node {
  position: absolute; left: 50%; width: 7px; height: 7px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--paper);
  border: 1px solid var(--ink-3); cursor: none; transition: all .3s var(--ease);
}
.spine__node.active { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.spine__node::after {
  content: attr(data-label); position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-3);
  white-space: nowrap; opacity: 0; transition: opacity .3s; text-transform: uppercase;
}
.spine__node:hover::after, .spine__node.active::after { opacity: 1; }
@media (max-width: 1100px) { .spine { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
.hero .wrap { padding-block: 140px 80px; }
.hero__inner { max-width: min(92vw, 900px); }
.hero .display .lift { display: block; }
.hero .eyebrow { margin-bottom: 30px; }
.hero .display { margin-bottom: 0; }
.hero__sub { margin-top: 34px; max-width: 50ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 44px; align-items: center; }
.hero__scroll {
  position: absolute; bottom: 30px; left: var(--mx); display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--ink-3); text-transform: uppercase;
}
.hero__scroll .ln { width: 38px; height: 1px; background: var(--ink-3); position: relative; overflow: hidden; }
.hero__scroll .ln::after { content:""; position:absolute; inset:0; width: 40%; background: var(--accent); animation: slide 2.4s var(--ease-io) infinite; }
@keyframes slide { 0%{ transform: translateX(-110%);} 100%{ transform: translateX(260%);} }

/* gloss line accents in hero corner */
.hero__meta {
  position: absolute; right: var(--mx); bottom: 40px; text-align: right;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--ink-3); line-height: 2;
}
@media (max-width: 760px) { .hero__meta { display: none; } }

/* ---------- Section frame ---------- */
.section { position: relative; padding-block: clamp(96px, 14vh, 180px); z-index: 2; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 64px; }
.section__head .left { max-width: 680px; }
.section__head .eyebrow { margin-bottom: 22px; }
.rule { height: 1px; background: var(--hair); width: 100%; }

/* ---------- Pillars (我们做什么) ---------- */
.pillars { border-top: 1px solid var(--hair); }
.pillar {
  display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 30px;
  padding: 52px 0; border-bottom: 1px solid var(--hair); position: relative;
}
.pillar__no { display: flex; align-items: baseline; gap: 16px; }
.pillar__no .idx { font-size: 15px; }
.pillar__zh { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 3vw, 40px); line-height: 1.1; }
.pillar__en { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; color: var(--ink-3); margin-top: 12px; text-transform: uppercase; }
.pillar__body { display: flex; flex-direction: column; gap: 24px; }
.pillar__desc { font-size: clamp(16px, 1.3vw, 19px); color: var(--ink-2); line-height: 1.8; max-width: 54ch; text-wrap: pretty; }
.pillar__tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-2);
  padding: 7px 14px; border: 1px solid var(--hair); border-radius: 100px;
  transition: border-color .3s, color .3s, background .3s;
}
.pillar:hover .tag { border-color: var(--accent); }
.pillar__glow { position: absolute; left: -2vw; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .6s var(--ease); }
.pillar:hover .pillar__glow { transform: scaleY(1); }
@media (max-width: 760px) { .pillar { grid-template-columns: 1fr; gap: 22px; padding: 38px 0; } }

/* ---------- Method flow (脉络流程) ---------- */
.method { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.method .eyebrow { color: oklch(0.962 0.008 85 / 0.6); }
.method .eyebrow::before { background: var(--accent); }
.method .h2 { color: var(--paper); }
.method .lead { color: oklch(0.962 0.008 85 / 0.66); }
.method .idx { color: oklch(0.62 0.09 235); }
#flowfield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0.9; }
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 30px; position: relative; z-index: 2; }
.flow__step { position: relative; padding: 34px 22px 34px 0; }
.flow__step .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); margin-bottom: 22px; box-shadow: 0 0 0 5px oklch(0.52 0.072 235 / 0.18); }
.flow__line { position: absolute; top: 38px; left: 11px; right: -10px; height: 1px; background: oklch(0.962 0.008 85 / 0.18); overflow: hidden; }
.flow__line::after { content:""; position:absolute; inset:0; width: 30%; background: var(--accent); animation: slide 3s linear infinite; }
.flow__step:last-child .flow__line { display: none; }
.flow__num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: oklch(0.962 0.008 85 / 0.45); }
.flow__zh { font-family: var(--serif); font-weight: 600; font-size: clamp(19px, 1.8vw, 24px); margin: 10px 0 12px; }
.flow__txt { font-size: 13.5px; line-height: 1.65; color: oklch(0.962 0.008 85 / 0.6); }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr 1fr; gap: 8px 24px; } .flow__line { display: none; } }
@media (max-width: 500px) { .flow { grid-template-columns: 1fr; } }

/* ---------- Metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.metric { padding: 48px 28px 48px 0; border-right: 1px solid var(--hair); position: relative; }
.metric:last-child { border-right: none; }
.metric__num { font-family: var(--serif); font-weight: 600; font-size: clamp(44px, 5.6vw, 76px); line-height: 1; letter-spacing: -0.02em; display: flex; align-items: baseline; }
.metric__num .unit { font-size: 0.42em; margin-left: 6px; color: var(--accent); font-family: var(--mono); font-weight: 400; }
.metric__label { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.metric__en { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-3); text-transform: uppercase; margin-top: 6px; }
@media (max-width: 860px) { .metrics { grid-template-columns: 1fr 1fr; } .metric:nth-child(2){border-right:none;} .metric{ border-bottom: 1px solid var(--hair);} .metric:nth-last-child(-n+2){border-bottom:none;} }
@media (max-width: 480px) { .metrics { grid-template-columns: 1fr; } .metric{border-right:none;} }

/* ---------- Cases ---------- */
.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 2.5vw, 36px); margin-top: 56px; }
.case {
  position: relative; padding: 34px; border: 1px solid var(--hair); border-radius: 3px;
  background: var(--paper-2); overflow: hidden; transition: transform .5s var(--ease), border-color .5s, box-shadow .5s;
  will-change: transform;
}
.case:hover { border-color: var(--accent); box-shadow: 0 30px 60px -40px oklch(0.205 0.006 70 / 0.4); }
.case__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.case__logo {
  width: 120px; height: 40px; border-radius: 2px;
  background: repeating-linear-gradient(135deg, var(--paper-3) 0 7px, transparent 7px 14px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-3); border: 1px solid var(--hair);
}
.case__logo--img { background: none; border: none; border-radius: 0; width: auto; justify-content: flex-start; }
.case__logo--img img { height: 30px; width: auto; display: block; }
.case__tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
.case__title { font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 2vw, 27px); line-height: 1.28; margin-bottom: 16px; }
.case__desc { font-size: 15px; color: var(--ink-2); line-height: 1.75; text-wrap: pretty; }
.case__foot { display: flex; gap: 30px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--hair); }
.case__stat .v { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--ink); }
.case__stat .v .unit { font-size: 0.5em; color: var(--accent); font-family: var(--mono); margin-left: 2px; }
.case__stat .k { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }

/* ---------- CTA ---------- */
.cta { position: relative; overflow: hidden; }
.cta__inner { text-align: center; padding-block: clamp(60px, 9vh, 120px); position: relative; z-index: 2; }
.cta .eyebrow { justify-content: center; }
.cta .display { margin: 26px auto 0; max-width: 16ch; }
.cta__sub { margin: 30px auto 0; }
.cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 46px; }
#ctafield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0.7; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--hair); padding-block: 70px 40px; position: relative; z-index: 2; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.footer__brand .brand { margin-bottom: 18px; }
.footer__brand p { font-size: 14px; color: var(--ink-3); max-width: 34ch; line-height: 1.7; }
.footer__col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 18px; font-weight: 400; }
.footer__col a, .footer__col p { display: block; font-size: 14px; color: var(--ink-2); text-decoration: none; margin-bottom: 12px; transition: color .3s; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 60px; padding-top: 26px; border-top: 1px solid var(--hair); }
.footer__bottom span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-3); }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: 40px 24px; } .footer__bottom { flex-direction: column; gap: 14px; align-items: flex-start; } }

/* ---------- Mobile refinements ---------- */
/* Keep the brand title on one line everywhere (was wrapping one char per line
   when the wide mono subtitle squeezed the flex row). */
.brand__zh { white-space: nowrap; }
.nav__cta { white-space: nowrap; }

@media (max-width: 600px) {
  /* Drop the wide mono subtitle in the nav so brand + CTA fit on one row */
  .nav .brand__en { display: none; }
}

@media (max-width: 760px) {
  /* Stack section headers so the heading and intro stop fighting for width */
  .section__head { flex-direction: column; align-items: flex-start; gap: 22px; margin-bottom: 44px; }
  .section__head .left { max-width: none; }
}

@media (max-width: 520px) {
  /* Full-width, comfortably tappable buttons */
  .hero__actions, .cta__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn, .cta__actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Reveal animations (progressive enhancement) ----------
   Content is visible by default; only when JS adds `.anim` to <html>
   do we hide it, then JS tweens it in via requestAnimationFrame
   (the document animation timeline is unreliable in some embeds). */
html.anim .reveal { opacity: 0; transform: translateY(28px); }

/* line clip reveal for big serif */
.lift { display: inline-block; overflow: hidden; }
.lift > span { display: inline-block; }
html.anim .lift > span { transform: translateY(110%); }

@media (prefers-reduced-motion: reduce) {
  html.anim .reveal { opacity: 1; transform: none; }
  html.anim .lift > span { transform: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}
