/*
 * 刘成 · 对外视觉 v1（石墨荧绿 · 深色）网页版
 * 基准：legal-article/docs/视觉系统_v1.md（v1.1 色值，第八节）+ 宣传片 v3 的动态元素。
 * 规矩：不用纯白字；纯黑只给标题块 / 重点卡；荧绿只做点缀，不当正文字色、不大面积铺
 *（例外：整块荧绿底黑字的结尾 CTA，对应公众号「结尾金句」）。
 */
/* 标题字体：思源黑体 Black 截字版（SIL OFL 1.1，见 fonts/OFL.txt）。改了标题文字要重跑 scripts/build-display-font.py */
@font-face {
  font-family: "LC Display";
  src: url("./fonts/lc-display.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #121212;            /* 页面底 */
  --bg-deep: #000000;       /* 只给标题块 / 重点卡 */
  --surface: #1e1e1e;       /* 卡片 / 旁注底 */
  --surface-2: #242424;     /* 金句块底、hover */
  --line: #2e2e2e;          /* 细线 */
  --line-2: #3e3e3e;        /* 稍重的线 */

  --text-hi: #ebebe8;       /* 标题、加粗、亮字 */
  --text: #c9c9c4;          /* 正文 */
  --text-mute: #8a8a85;     /* 次要字 */

  --lime: #c6f36b;          /* 荧绿：点缀、按钮、黑底上的字 */
  --lime-ink: #4d6b1c;      /* 深色版荧光笔 */
  --lime-dot: #8cba46;      /* 二维码绿 */

  --font-display: "LC Display", "Lantinghei SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: "Avenir Next Condensed", "Avenir Next", "DIN Condensed", "Arial Narrow", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-italic: Georgia, "Times New Roman", serif;

  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;

  /* 宣传片底纹：极淡的手绘曲线 */
  --texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720' viewBox='0 0 720 720'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.035'%3E%3Cpath d='M-20 120C80 60 160 210 270 140S450 40 560 110 700 230 740 160'/%3E%3Cpath d='M-40 340C70 270 210 410 310 330S490 230 600 300 720 390 760 340'/%3E%3Cpath d='M-20 560C110 500 190 640 320 570S520 470 640 550 740 600 760 580'/%3E%3Cpath d='M130 -20C70 90 210 170 150 280S50 440 120 540 230 680 170 740'/%3E%3Cpath d='M480 -20C420 110 560 190 500 310S400 470 470 570 580 690 520 740'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- 通用小件 ---------- */

/* 等宽小标：01 — IDENTITY / LIU CHENG · 2026 */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.lime { color: var(--lime); }

/* 荧光笔（深色版 H1）：墨绿只涂文字下半截；有 brand.js 时一笔涂出来 */
.mk {
  color: var(--text-hi);
  background: linear-gradient(var(--lime-ink), var(--lime-ink)) no-repeat 0 100% / 100% 0.32em;
  border-radius: 3px 9px 4px 11px;
  padding: 0 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.js .mk { background-size: 0% 0.32em; transition: background-size .9s cubic-bezier(.65,0,.35,1) .2s; }
.js .mk.in { background-size: 100% 0.32em; }

/* 浮现：只有 brand.js 在时才先藏起来 */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.22,.61,.36,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* 标题逐行升起（brand.js 给 [data-split] 拆行） */
.is-split .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.is-split .line-inner { display: inline-block; transform: translateY(108%); transition: transform 1s cubic-bezier(.22, .61, .36, 1); }
.is-split.in .line-inner { transform: none; }

/* 点击涟漪（brand.js 在按下时插入） */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(198, 243, 107, .22); transform: translate(-50%, -50%) scale(0);
  animation: ripple .55s ease-out forwards;
}
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* 第一次进站的荧绿帘幕 */
.curtain {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center;
  background: var(--lime); color: #0d0d0d; pointer-events: none;
  clip-path: inset(0 0 0 0);
  transition: clip-path .8s cubic-bezier(.76, 0, .24, 1);
}
.curtain.out { clip-path: inset(0 0 100% 0); }
.curtain-text { font: 700 clamp(14px, 1.6vw, 18px)/1 var(--font-mono); letter-spacing: .3em; text-transform: uppercase; }

/* 帘幕接手前先把屏幕涂成荧绿（<head> 里的小脚本加 .curtain-pending）；脚本失效时 2.5 秒后自己褪掉 */
.curtain-pending body::before {
  content: ""; position: fixed; inset: 0; z-index: 399; background: var(--lime);
  animation: pending-out .3s ease 2.5s forwards;
}
@keyframes pending-out { to { opacity: 0; visibility: hidden; } }

/* 右侧章节指针 */
.chapter-pointer {
  position: fixed; right: 22px; top: 50%; z-index: 40; transform: translate(12px, -50%);
  display: grid; justify-items: center; gap: 8px; pointer-events: none;
  opacity: 0; transition: opacity .4s ease, transform .4s ease;
}
.chapter-pointer.is-on { opacity: 1; transform: translate(0, -50%); }
.cp-num { font: 700 26px/1 var(--font-num); color: var(--lime); }
.cp-total { font: 500 10px/1 var(--font-mono); letter-spacing: .14em; color: var(--text-mute); }
.cp-track { position: relative; width: 2px; height: 120px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.cp-track i { position: absolute; inset: 0; background: var(--lime); transform-origin: top; transform: scaleY(0); }
.cp-name { writing-mode: vertical-rl; font: 500 11px/1 var(--font-body); letter-spacing: .3em; color: var(--text-mute); }
.chapter-pointer.flash .cp-name { animation: cp-flash .6s ease; }
@keyframes cp-flash { from { color: var(--lime); opacity: 0; transform: translateY(-8px); } }
@media (max-width: 1240px) { .chapter-pointer { display: none; } }

/* 荧绿伴随光标 */
.cursor-follow { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.cursor-follow.is-on { opacity: 1; }
.cf-dot, .cf-ring { position: fixed; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cf-dot { width: 6px; height: 6px; margin: 14px 0 0 14px; background: var(--lime); }
.cf-ring { width: 30px; height: 30px; border: 1.5px solid rgba(198, 243, 107, .55); transition: width .25s ease, height .25s ease, border-color .25s ease, background-color .25s ease; }
.cursor-follow.is-link .cf-ring { width: 54px; height: 54px; border-color: var(--lime); background: rgba(198, 243, 107, .08); }
.cursor-follow.is-down .cf-ring { width: 22px; height: 22px; }

/* 光晕跟随 */
[data-glow] { position: relative; }
[data-glow]::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(600px circle at var(--gx, 70%) var(--gy, 40%), rgba(198, 243, 107, .09), transparent 60%);
  transition: background-position .2s ease;
}

/* 斜体衬线点缀：宣传片里的「LOCAL AI」「Law. And AI.」 */
.it {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* 荧绿药丸：宣传片右上角「关注 · FOLLOW ↗」 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: #0d0d0d;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(198, 243, 107, 0.18); }

/* 荧绿跑马灯横条：宣传片「LOCAL-FIRST • GB10 × 2 • 本地运行 …」 */
.marquee {
  overflow: hidden;
  background: var(--lime);
  color: #0d0d0d;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  animation: marquee 38s linear infinite;
}
.marquee-track span {
  padding: 11px 0;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.marquee-track span::after { content: "•"; margin: 0 18px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 截图框：深色截图加圆角 + 1px 线，hover 时线变荧绿 */
.frame {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.frame img { display: block; width: 100%; height: auto; }
.frame figcaption {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-mute);
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .mk { background-size: 100% 0.32em; transition: none; }
  .curtain, .chapter-pointer, .cursor-follow { display: none; }
}
