/* ==========================================================================
   AYC KCL · tokens.css
   设计令牌 + 字体 + 基础排版。工业风深色底 + 橙色信号色。
   改动这里会全站生效；页面级样式一律不要写死颜色/字号。
   ========================================================================== */

/* --- 自托管字体（latin 子集，variable font，离线可用） ------------------- */
@font-face {
  font-family: "Big Shoulders Display";
  src: url("../fonts/big-shoulders.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Share Tech Mono";
  src: url("../fonts/share-tech-mono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
/* 品牌字标专用：LOGO 里的「AYC KCL」是粗斜体方切科技字（倾向 ~13°）。
   Chakra Petch italic 700 是对得最准的自由字体，与 Big Shoulders 相比多了斜度
   与切角，更贴近 LOGO 本身。只用于品牌字标，正文不引用。 */
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- 令牌 ---------------------------------------------------------------- */
:root {
  /* 字体栈：中文回落到系统中文字体，避免豆腐块 */
  --font-display: "Big Shoulders Display", "PingFang SC", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
  /* 品牌字标字体：LOGO 的斜体方切科技字，只给 .brand__name / .intro__title 用 */
  --font-wordmark: "Chakra Petch", "Big Shoulders Display", "PingFang SC",
    "Microsoft YaHei", sans-serif;

  /* 品牌：工业橙（信号色），深底高对比 */
  --accent: #ff6a1a;
  --accent-hover: #ff8340;
  --accent-press: #e35a0f;
  --accent-ink: #14100d; /* 橙底上的文字色，对比 6.63:1 */
  --accent-soft: rgba(255, 106, 26, 0.12);
  --accent-line: rgba(255, 106, 26, 0.42);

  /* 中性面（深色为默认主题）
     v0.4 NASA-punk：底色压到近黑，让地形线（发丝级白线）与底之间拉开层次。
     原来 #0b0c0e 偏灰，等高线放上去发闷；#08090b 才接近参考图的真空黑。 */
  --bg: #08090b;
  --bg-1: #0f1114;
  --bg-2: #16181c;
  --bg-3: #1e2126;
  --ink: #eef1f4; /* 18.4:1 on --bg */
  --ink-2: #c2c8d0;
  --ink-3: #8d949d; /* 8.0:1，可作正文次要色 */
  --ink-4: #5a616a; /* 仅用于装饰/禁用，不承载文本信息 */
  --line: #262b31;
  --line-strong: #383f47;

  /* --- NASA-punk 技术铬层（v0.4）------------------------------------------
     参考图（NASA 朋克 / 等高线地形图）的语言：1px 发丝线、角标括号、等宽小字、
     数据读数。这套令牌只描述「非彩色」的技术线条，彩色一律走 --accent。 */
  --tech-line: rgba(255, 255, 255, 0.14); /* 常规发丝线 */
  --tech-line-strong: rgba(255, 255, 255, 0.28); /* 需要立起来的框线 */
  --tech-fill: rgba(255, 255, 255, 0.03); /* 面板微填充，几乎只是「不是纯色」 */
  --tech-dim: rgba(255, 255, 255, 0.38); /* 技术标注文字 */
  --tech-chamfer: 10px; /* 切角尺寸（clip-path 用） */
  /* 读数底的散射遮罩：把等宽小字背后的地形线压下去一档，但不足以变成实心色块。
     必须是「背景色 + 透明度」而不是写死的黑，浅色主题才有对应的浅底。 */
  --tech-scrim: rgba(8, 9, 11, 0.72);

  /* 等高线三层颜色：主曲线（亮）/ 间曲线（中）/ 助曲线（暗）。
     维度分开是为了让「明暗层次」由颜色本身承担，而不是只靠 opacity。 */
  --topo-major: #d2d9e0;
  --topo-minor: #79818a;
  --topo-faint: #454c55;
  --topo-accent: var(--accent);

  /* 语义色 */
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --warn: #e5b23a;
  --warn-soft: rgba(229, 178, 58, 0.14);
  --bad: #f13400;
  --bad-soft: rgba(241, 52, 0, 0.14);
  --info: #38ccca;
  --info-soft: rgba(56, 204, 202, 0.14);

  /* 字号（流体） */
  --fs-display: clamp(2.75rem, 8.5vw, 7rem);
  --fs-h1: clamp(2rem, 5vw, 3.75rem);
  --fs-h2: clamp(1.625rem, 3.4vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 2.1vw, 1.625rem);
  --fs-h4: 1.125rem;
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
  --fs-2xs: 0.6875rem;

  /* 行高 / 字距 */
  --lh-tight: 0.95;
  --lh-snug: 1.15;
  --lh-body: 1.65;
  --ls-display: -0.02em;
  --ls-label: 0.14em;

  /* 间距（4px 基准） */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3rem;
  --sp-9: 4rem;
  --sp-10: 5rem;
  --sp-11: 6.5rem;
  --sp-12: 8rem;

  /* 段落节奏 */
  --section-y: clamp(3.5rem, 7vw, 7rem);
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --container: 1280px;
  --container-narrow: 880px;

  /* 形状：工业风以直角为主 */
  --r-0: 0;
  --r-1: 2px;
  --r-2: 4px;
  --r-pill: 999px;

  /* 层级 */
  --z-base: 0;
  --z-sticky: 100;
  --z-drawer: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* 动效 */
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 340ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* 阴影（深色底用极暗、无模糊的重影，而不是柔和投影） */
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 8px 24px -12px rgba(0, 0, 0, 0.8);
  --shadow-2: 0 24px 60px -28px rgba(0, 0, 0, 0.95);

  /* 布局常量 */
  --header-h: 64px;
  color-scheme: dark;
}

/* --- 浅色主题（工业厂房白 + 同一橙色） ---------------------------------- */
[data-theme="light"] {
  --bg: #f4f4f2;
  --bg-1: #ffffff;
  --bg-2: #ebebe8;
  --bg-3: #e0e0dc;
  --ink: #14161a;
  --ink-2: #3c424a;
  --ink-3: #5f666e;
  --ink-4: #9aa1a8;
  --line: #d8d8d4;
  --line-strong: #b9b9b4;

  --accent: #c43f00; /* 白底上加深以保证 4.5:1 */
  --accent-hover: #a83500;
  --accent-press: #8f2c00;
  --accent-ink: #ffffff;
  --accent-soft: rgba(196, 63, 0, 0.09);
  --accent-line: rgba(196, 63, 0, 0.35);

  /* NASA-punk 技术铬层：深色主题下是「白线压黑底」，浅色主题必须反过来
     「黑线压白底」，否则 #ffffff 画布上 14% 白线完全不可见。 */
  --tech-line: rgba(20, 22, 26, 0.16);
  --tech-line-strong: rgba(20, 22, 26, 0.32);
  --tech-fill: rgba(20, 22, 26, 0.04);
  --tech-dim: rgba(20, 22, 26, 0.46);
  --tech-scrim: rgba(244, 244, 242, 0.78);

  /* 等高线的明暗三级在浅色主题下要整体压深，否则 #d2d9e0 在白底上是一片空白 */
  --topo-major: #55606c;
  --topo-minor: #8b939c;
  --topo-faint: #b4babf;
  --topo-accent: var(--accent);

  --ok: #0f7a52;
  --warn: #8a6100;
  --bad: #b32500;
  --info: #0d6f6e;

  --shadow-1: 0 1px 2px rgba(20, 22, 26, 0.06),
    0 8px 24px -16px rgba(20, 22, 26, 0.24);
  --shadow-2: 0 24px 60px -30px rgba(20, 22, 26, 0.35);
  color-scheme: light;
}

/* --- 重置 ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
/* 底色画在 html 上、body 保持透明 —— 这是全站等高线背景能显示出来的前提。
   原因（层叠顺序）：`.page-bg` 是 position:fixed 且 z-index:-1，它落在「负
   z-index 子层」，绘制顺序在**根元素背景之后、body 背景之前**。若底色仍留在
   body 上，body 的不透明背景会整片盖住等高线。把底色上移到 html（根元素背景
   在第 1 步绘制）之后，顺序变成：html 底色 → .page-bg 等高线 → body 内容，
   三者恰好正确。详见 assets/css/backdrop.css 顶部注释。 */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-5));
  background: var(--bg);
}
body {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}
img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
  padding: 0;
}
table {
  border-collapse: collapse;
  width: 100%;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
}
:target {
  scroll-margin-top: calc(var(--header-h) + var(--sp-5));
}

/* --- 排版基元 ------------------------------------------------------------ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: var(--fs-h4);
  letter-spacing: 0;
}
p {
  max-width: 68ch;
  text-wrap: pretty;
}
strong,
b {
  font-weight: 600;
  color: var(--ink);
}
small {
  font-size: var(--fs-sm);
}
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* 技术标签：等宽、大写、宽字距，是本设计的“工业编号”语言 */
.mono,
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-3);
}
.mono--accent {
  color: var(--accent);
}
.tech-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

/* 显示级大标题 */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
  text-wrap: balance;
}

.lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  color: var(--ink-2);
  max-width: 60ch;
}
.muted {
  color: var(--ink-3);
}
.text-accent {
  color: var(--accent);
}
.text-center {
  text-align: center;
}
.text-center p,
.text-center .lead {
  margin-inline: auto;
}
.nowrap {
  white-space: nowrap;
}

/* --- 无障碍 -------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: calc(var(--z-modal) + 1);
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--sp-3) var(--sp-5);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus {
  top: var(--sp-4);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* JS 关闭时也不该出现「点不动」的动画初始态 */
.no-js [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}
