/* ================================================================
   三谋 (Three Kingdoms: Strategize the World) — Guild Design System
   colors_and_type.css

   Loads brand fonts, defines the dark-gold / xuanzhi-paper palette,
   and provides semantic typography helpers used across UI kits
   and slide decks.
   ================================================================ */

/* -------- Brand fonts (local, subsetted woff2) --------
   Subsets cover the 805 CJK chars used in current HTML/JSX/CSS.
   If you add new Chinese text, re-run the subset script or fall back
   to the full .ttf/.otf in _backup_perf/fonts/. */
@font-face {
  font-family: "ChaoZi Haoxia Flash";
  src: url("./fonts/ZiYuYunYou-Shoushu.subset.woff2?v=2") format("woff2");
  font-display: swap;
}
/* Latin display + body fonts (Cinzel + Cormorant Garamond) loaded via
   <link> in index.html / admin.html — moved out of @import to load in
   parallel with this stylesheet instead of waterfalling after it. */
@font-face {
  font-family: "Source Han Serif CN";
  src: url("./fonts/SourceHanSerifCN-Bold.subset.woff2?v=2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Source Han Serif CN";
  src: url("./fonts/SourceHanSerifCN-Regular.subset.woff2?v=2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "FangZheng Lishu";
  src: url("./fonts/FangZheng-Lishu-GBK.subset.woff2?v=2") format("woff2");
  font-display: swap;
}

/* Latin display + body — (Google Fonts now consolidated above with brush fallbacks) */

:root {
  /* -------- Paper / Xuan (宣纸) base -------- */
  --paper-100: #f3efe2;   /* lightest xuan */
  --paper-200: #e9e3d3;
  --paper-300: #dccbaa;
  --paper-400: #c9b48f;   /* aged paper */

  /* -------- Bronze / Gold (古铜 / 金) -------- */
  --bronze-100: #d9c08a;
  --bronze-200: #c9a86a;
  --bronze-300: #a8854a;   /* primary gold */
  --bronze-400: #8b6b35;
  --bronze-500: #6a4f24;
  --bronze-600: #4a3618;

  /* -------- Ink / Charcoal (墨) -------- */
  --ink-100: #7c7a6d;
  --ink-200: #4a4538;
  --ink-300: #2f2a22;
  --ink-400: #1c1812;
  --ink-500: #0e0b08;

  /* -------- Cinnabar / 朱砂 accent -------- */
  --cinnabar-400: #b85240;
  --cinnabar-500: #a64633;
  --cinnabar-600: #8a3527;

  /* -------- Faction banner colors (魏蜀吳群晉) -------- */
  --faction-wei:   #b8983d;   /* 魏 — Yellow */
  --faction-shu:   #8a2f2a;   /* 蜀 — Dark crimson */
  --faction-wu:    #2f5a4a;   /* 吳 — Deep green */
  --faction-qun:   #3b5a82;   /* 群 — Slate blue */
  --faction-jin:   #b88a5a;   /* 晉 — Bronze */

  /* -------- Occupation banner colors (六職) — per the in-game artwork -- */
  --job-qing:  #4f8a7d;   /* 青囊 — Teal / lotus    */
  --job-qi:    #2f3a5e;   /* 奇佐 — Navy / fan      */
  --job-tian:  #9a8a5a;   /* 天工 — Sand / mechanism*/
  --job-si:    #7a6b3d;   /* 司倉 — Olive / grain   */
  --job-zhen:  #a85e64;   /* 鎮軍 — Rose / xiezhi   */
  --job-shen:  #7e6d9e;   /* 神行 — Violet / eagle  */

  /* -------- Semantic surfaces (dark theme = canon) -------- */
  --bg:            var(--ink-500);
  --bg-elev-1:     var(--ink-400);
  --bg-elev-2:     var(--ink-300);
  --bg-paper:      var(--paper-200);   /* for scroll panels */

  --fg:            var(--paper-100);
  --fg-muted:      #b6a987;
  --fg-dim:        #7a6f55;
  --fg-on-paper:   var(--ink-300);
  --fg-on-paper-muted: #5b5142;

  --border:        rgba(168, 133, 74, 0.45);   /* bronze hairline */
  --border-strong: var(--bronze-300);
  --divider:       rgba(217, 192, 138, 0.18);

  --gold-grad:     linear-gradient(180deg, #e5cf94 0%, #b88f49 50%, #6e4f23 100%);
  --gold-grad-soft:linear-gradient(180deg, #d9be86 0%, #a8854a 100%);
  --paper-grad:    linear-gradient(180deg, #f3efe2 0%, #dccbaa 100%);
  --smoke-grad:    radial-gradient(120% 80% at 50% 0%, rgba(217, 192, 138, 0.18) 0%, rgba(0,0,0,0) 60%);

  /* -------- Type families -------- */
  --font-display-flash: "ChaoZi Haoxia Flash", "Ma Shan Zheng", "Liu Jian Mao Cao", "Source Han Serif CN", serif; /* 首字 / brush */
  --font-display:       "Source Han Serif CN", "Noto Serif SC", "Songti SC", serif;
  --font-body:          "Source Han Serif CN", "Noto Serif SC", "Songti SC", serif;
  --font-accent-lishu:  "FangZheng Lishu", "Source Han Serif CN", serif;        /* 副標題隸書 */
  --font-latin-display: "Cinzel", "Cormorant Garamond", serif;                /* SEASON ACTIVITY */
  --font-latin-body:    "Cormorant Garamond", "Source Han Serif CN", serif;

  /* -------- Spacing scale (8-pt with quarter steps) -------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* -------- Radii — small, sharp, ancient -------- */
  --radius-0: 0px;
  --radius-1: 2px;
  --radius-2: 4px;
  --radius-3: 6px;
  --radius-pill: 999px;

  /* -------- Shadows / glows -------- */
  --shadow-card:  0 2px 0 rgba(0,0,0,0.5), 0 18px 40px -18px rgba(0,0,0,0.7);
  --shadow-deep:  0 30px 60px -30px rgba(0,0,0,0.85);
  --glow-gold:    0 0 0 1px rgba(217, 192, 138, 0.35), 0 0 24px -6px rgba(217, 192, 138, 0.45);
  --inset-trough: inset 0 1px 0 rgba(0,0,0,0.55), inset 0 -1px 0 rgba(217, 192, 138, 0.18);

  /* -------- Motion -------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:  cubic-bezier(0.55, 0, 0.7, 0.2);
  --dur-1: 140ms;
  --dur-2: 240ms;
  --dur-3: 420ms;
}

/* ---------- Base ---------- */
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Semantic type helpers ----------
   Use as plain selectors or via .t-hero, .t-h1, etc.
*/

.t-hero,
h1.hero {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 7vw, 112px);
  letter-spacing: 0.04em;
  line-height: 1.05;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* First character treatment for hero — bigger, brush-flash face.
   Inherits the gold-gradient text fill from the parent. */
.t-hero .flash,
h1.hero .flash {
  font-family: var(--font-display-flash);
  font-weight: 400;
  font-size: 2.1em;
  line-height: 0.85;
  margin-right: 0.08em;
  display: inline-block;
  transform: translateY(0.05em);
}

h1, .t-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
h2, .t-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 0.04em;
  line-height: 1.15;
}
h3, .t-h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
h4, .t-h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

/* Body */
p, .t-body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12pt;
  line-height: 1.85;
  letter-spacing: 0.02em;
}
.t-body-lg { font-size: 12pt; line-height: 1.85; }
.t-body-sm { font-size: 12pt; line-height: 1.75; }
.t-caption {
  font-family: var(--font-body);
  font-size: 12pt;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
  text-transform: none;
}

/* Latin eyebrow — small caps in Cinzel for "SEASON ACTIVITY", "FEATURE • 三谋" */
.t-eyebrow {
  font-family: var(--font-latin-display);
  font-weight: 400;
  font-size: 12pt;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Lishu accent — sub-titles and pairs of short phrases */
.t-lishu {
  font-family: var(--font-accent-lishu);
  font-weight: 400;
  font-size: 14pt;
  letter-spacing: 0.35em;
  color: var(--bronze-200);
}

/* Vertical Chinese caption — used down the side of hero illustrations */
.t-vertical {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 12pt;
  letter-spacing: 0.5em;
  color: var(--fg-muted);
}

/* Gold-gradient text utility */
.fg-gold {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Ink-stamp "印" — small red square seal */
.t-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar-500);
  color: var(--paper-100);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12pt;
  padding: 4px 6px;
  letter-spacing: 0.1em;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
