/* ==========================================================================
   FUYAO PACKAGING · demos/_shared/tokens-a.css
   --------------------------------------------------------------------------
   Demo A · 精品画廊（Editorial Gallery）

   事实源
     · 颜色 / 字体 / 动效 —— docs/04-设计/三套Demo差异化设计.md §1.2 §1.4
     · 字号 / 间距 / 栅格 —— docs/04-设计/设计系统.md §4.1 §5

   引入顺序（三个 demo 都一样，只是换成自己的 token 文件）
     <link rel="stylesheet" href="../_shared/tokens-a.css">   ← 变量
     <link rel="stylesheet" href="../_shared/base.css">       ← reset + 排版基线
     <link rel="stylesheet" href="./styles.css">              ← 本页组件

   三套的变量名**完全一致**（见 README 的对照表），只有值不同 ——
   所以把 tokens-a 换成 tokens-b，页面结构不用改。

   A 的纪律（照抄设计文档，不要"顺手优化"）
     1. 只有一个强调色（陶土棕）。全站不出现第二种彩色。
     2. 禁止纯白 #fff —— 用 --bg。
     3. 禁止纯黑 #000 —— 用 --ink。
     4. 强调色每屏最多出现 2 次。
     5. 全直角：--radius-* 全为 0。
     6. 慢：区块进入 900ms，图片揭开 1200ms。
   ========================================================================== */

/* ---------- 字体（自托管 woff2，OFL，零第三方请求） ----------
   Playfair Display  —— Display 标题（衬线，700）
   Inter              —— 正文 400 / 小标 600 / 数字 300
   IBM Plex Mono      —— 画册编号与图注（01 — Dropper bottle, 30ml）
   说明：三个字体文件都是可变字体（wght 一个文件覆盖全部字重），
   所以下面一个 @font-face 就能同时提供 300 / 400 / 700。
   -------------------------------------------------------------------- */
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-latin-var-normal.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-latin-var-italic.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ======================================================================
     1. 色彩
     ====================================================================== */
  --bg: #F5F2EC;                     /* 米白纸底（禁止 #fff） */
  --bg-sub: #EDE8DF;                 /* 次级背景 */
  --bg-elev: #F7F3EC;                /* 抬升层：卡片 / 抽屉 */
  --bg-glass: rgba(245, 242, 236, 0.82); /* 半透明纸面（A 不用毛玻璃，仅备用） */

  --ink: #1A1815;                    /* 主文字（禁止 #000）；实测 14.7:1 on --bg */
  --ink-soft: #4A453D;               /* 次要文字；实测 8.51 / 7.79 / 8.59（--bg / --bg-sub / --bg-elev），三层均达 AA */
  /* 实测 3.21 / 2.94 / 3.24 —— 连 3:1 都不到（原注释写 "3.4:1" 偏乐观，2026-10-22 复算修正）。
     **不可承载任何正文小字**，只能做装饰（发丝线、禁用态图标）。
     A 套真实的元信息色由 demos/a/styles.css 派生 --ink-meta: #6B665C（实测 5.11:1，达 AA）；
     builder 正是据此派生的，本文件不改值以免影响 B/C 两套。 */
  --ink-faint: #8C8779;

  --accent: #B5835A;                 /* 陶土棕：唯一强调色 */
  --accent-hover: #9A6A45;           /* hover 态（底色 / 描边） */
  --accent-strong: #8A5F3C;          /* 小字链接用（5.0:1，可承载文字） */
  --accent-dim: rgba(181, 131, 90, 0.16);  /* 强调色的淡底 */
  --accent-soft: #F0E7DA;            /* 强调色的纸面浅底 */
  --accent-2: var(--accent);         /* A 没有第二强调色（保持变量名对齐） */

  --border: rgba(26, 24, 21, 0.12);  /* 发丝线 */
  --border-strong: rgba(26, 24, 21, 0.28); /* 表单控件边界 */
  --line: var(--border);             /* 设计文档里的旧名，保留别名 */

  /* ----------------------------------------------------------------------
     文档同名别名（★ 三份 tokens 都提供同一批名字，共 89 个变量名）
     ----------------------------------------------------------------------
     为什么需要：三份设计文档各用各的叫法 ——
       §1.2 A 配色写 --paper / --paper-warm
       §2.2 B 配色写 --brand / --brand-hover
       §3.2 C 配色写 --accent / --accent-dim
     而 base.css 与三个生产成员的组件只认一套通用名（--bg / --accent …）。
     做法：通用名（--bg / --bg-sub / --accent / --accent-hover / --accent-soft）
     是本套的**主 token**，文档名一律用 var() 指过去当别名 ——
     绝不改名，避免已写好的页面引用断裂。
     所以页面里写 --paper 还是 --bg 都能拿到同一个值；
     改颜色仍然只需改主 token 一处。
     注意：别名用 var() 而不是抄字面量，Chrome 在 computed 阶段会解析，
     审核脚本 ops/design-review/check.mjs 读到的仍是最终色值。
     ---------------------------------------------------------------------- */
  --paper: var(--bg);                /* = 米白纸底（§1.2） */
  --paper-warm: var(--bg-sub);       /* = 次级背景（§1.2） */
  --brand: var(--accent);            /* A 没有"品牌蓝"：--brand 即唯一强调色 */
  --brand-hover: var(--accent-hover);
  --brand-tint: var(--accent-soft);

  --success: #45694D;                /* 静默绿（压低彩度，不抢强调色） */
  --warning: #8A6A2E;                /* 静默金褐 */
  --danger: #8C3B2E;                 /* 表单错误（唯一允许的第二种暖色，仅错误态） */

  /* ======================================================================
     2. 字体
     ====================================================================== */
  --font-display: "Playfair Display", "Songti SC", "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fw-display: 700;   /* Playfair Display 700 */
  --fw-body: 400;
  --fw-strong: 600;
  --fw-numeral: 300;   /* A 的数字用超细 300 */
  --fw-button: 600;    /* A 的按钮是等宽大写小字 + 宽字距 */

  /* ======================================================================
     3. 字号（设计系统 §4.1 编辑式阶梯，比率 ≈1.30）
     ====================================================================== */
  --fs-hero: clamp(2.5rem, 6vw, 5rem);       /* 40 → 80（diff doc §1.2） */
  --fs-display-xl: clamp(5rem, 12vw, 8rem);  /* 80 → 128，仅首屏全出血标题 */
  --fs-h1: clamp(2.25rem, 4.2vw, 3.25rem);   /* 36 → 52 */
  --fs-h2: clamp(1.75rem, 3vw, 2.25rem);     /* 28 → 36 */
  --fs-h3: clamp(1.5rem, 2.2vw, 1.75rem);    /* 24 → 28 */
  --fs-body: 1.0625rem;                      /* 17px（diff doc：17/1.75） */
  --fs-small: 0.9375rem;                     /* 15px */
  --fs-micro: 0.75rem;                       /* 12px：图注 / 序号 */
  --fs-eyebrow: 0.6875rem;                   /* 11px 小标（大写 + 0.18em） */

  --lh-display: 1.02;
  --lh-tight: 1.2;
  --lh-body: 1.75;
  --lh-small: 1.55;
  --lh-row: 1.6;                             /* A 不用表格行高压缩 */

  --tracking-display: -0.02em;
  --tracking-eyebrow: 0.18em;
  --tracking-mono: 0.12em;
  --tracking-body: 0;

  /* ======================================================================
     4. 间距（4px 基数，1.618 呼吸阶梯 · 设计系统 §5.1）
        4 · 8 · 12 · 20 · 32 · 52 · 84 · 136 · 220
        xs=4  sm=8  md=20  lg=32  xl=52  2xl=84
     ====================================================================== */
  --space-xs: 0.25rem;   /*   4 */
  --space-sm: 0.5rem;    /*   8 */
  --space-md: 1.25rem;   /*  20 */
  --space-lg: 2rem;      /*  32 */
  --space-xl: 3.25rem;   /*  52 */
  --space-2xl: 5.25rem;  /*  84 */

  --section-gap: 160px;            /* diff doc §1.2：区块垂直间距 160px */
  --section-gap-mobile: 52px;      /* 设计系统 §5.1：手机 52 */
  --measure: 68ch;                 /* 长文可读行宽 */

  /* ======================================================================
     5. 圆角 / 阴影 / 容器
     ====================================================================== */
  --radius-sm: 0;        /* A 全直角，一条曲线都不许有 */
  --radius-md: 0;
  --radius-lg: 0;

  /* 阴影：有光源方向（右上），暖褐 —— 不是中性灰 */
  --shadow-sm: 0 2px 8px rgba(37, 29, 20, 0.05);
  --shadow-md: 0 18px 40px -24px rgba(37, 29, 20, 0.18);
  --shadow-lg: 0 40px 90px -48px rgba(37, 29, 20, 0.28);

  --container-max: 1320px;                  /* diff doc §1.2 */
  --container-pad: clamp(20px, 5vw, 80px);  /* 桌面 80px */

  /* 版式辅助 */
  --nav-h: 96px;                 /* diff doc §五：96 → 滚动后 72 */
  --nav-h-compact: 72px;
  --hairline: 1px;
  --underline-weight: 1px;
  --row-h: 56px;                 /* A 没有表格，给到呼吸感行高 */
  --glass-blur: 0px;             /* A 不用毛玻璃 */
  --pixel-ratio-max: 2;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-strong);

  /* ======================================================================
     6. 动效（diff doc §1.4：慢、克制、优雅）
        hover 240ms · 图版揭示 900–1200ms · 页面 720ms
     ====================================================================== */
  --dur-fast: 240ms;
  --dur-med: 600ms;
  --dur-slow: 900ms;
  --dur-reveal: 900ms;   /* 区块进入 */
  --dur-clip: 1200ms;    /* clip-path 揭开 */
  --dur-count: 1600ms;   /* 数字滚动 */
  --dur-camera: 1200ms;  /* 相机 / 场景预设切换（A/B 无 3D，保留变量名对齐） */
  --stagger: 0.08s;      /* 子元素间隔 */
  --reveal-y: 24px;      /* 进入位移 */
  --parallax-factor: 0.15;  /* A 允许轻微视差，仅 Hero 与 About */
  --parallax-max: 40px;     /* 设计系统 §9：视差最大 40px */

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);      /* expo-out */
  --ease-inout: cubic-bezier(0.77, 0, 0.175, 1);  /* clip 揭开专用 */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);   /* A 禁止弹跳 → 与 ease-out 同值 */
}
