/* ============================================================
   ACE² Lab — Design Tokens & Typography System
   Kyungpook National University (KNU)
   Inspired by AMTL & Classic Academic Editorial Principles
   ============================================================ */

:root {
  /* ------------------------------------------------------------
     Brand Palette (Dual Hybrid: KNU Crimson + ACE² Navy)
     ------------------------------------------------------------ */
  --color-knu-crimson: #a3123a;
  --color-knu-crimson-hover: #820e2e;
  --color-knu-crimson-soft: rgba(163, 18, 58, 0.08);

  --color-ace2-navy: #1e3a5f;
  --color-ace2-navy-light: #2d5584;
  --color-ace2-navy-soft: rgba(30, 58, 95, 0.08);

  /* Neutrals & Surfaces (Light Mode) */
  --color-ground: #ffffff;
  --color-surface: #f8fafc;
  --color-surface-hover: #f1f5f9;
  --color-ink: #1e293b;
  --color-ink-muted: #64748b;
  --color-line: #e2e8f0;
  --color-line-strong: #cbd5e1;

  /* AMTL-Style Hero Banner */
  --banner-bg: #2d282a;
  --banner-gradient: radial-gradient(1100px 300px at 12% 130%, rgba(163, 18, 58, 0.42), transparent 70%);
  --banner-text: #ffffff;
  --banner-text-muted: rgba(255, 255, 255, 0.78);

  /* Typography Font Families */
  --font-serif-editorial:
    "Newsreader", "Pretendard Variable", Pretendard, "Hiragino Mincho ProN", "Noto Serif JP", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-sans-body:
    "Pretendard Variable", Pretendard, "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans",
    "Noto Sans JP", "PingFang SC", "Noto Sans SC", "Malgun Gothic", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono-meta: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  /* ------------------------------------------------------------
     Type Scale SSOT (14px floor for any readable text)
     ------------------------------------------------------------ */
  --fs-label: 0.875rem; /* 14px — badges, chips, tags, counts */
  --fs-meta: 0.875rem; /* 14px — dates, bylines, secondary meta */
  --fs-body-sm: 0.9375rem; /* 15px — dense body copy */
  --fs-body: 1rem; /* 16px — body copy, form inputs (no iOS zoom) */
  --fs-lg: 1.125rem; /* 18px */
  --fs-xl: 1.375rem; /* 22px — section titles */
  --fs-2xl: 1.75rem; /* 28px */

  /* ------------------------------------------------------------
     High-Contrast Text Tokens (WCAG ratios vs #ffffff)
     ------------------------------------------------------------ */
  --c-ink: #0f172a; /* titles          17.9:1 */
  --c-text: #334155; /* body            10.4:1 */
  --c-muted: #4b5a70; /* meta, labels     7.0:1 (6.4:1 on --c-surface-alt) */
  --c-subtle: #64748b; /* non-essential    4.8:1 */
  --c-accent: #1e3a5f; /* links, accents   11.6:1 */
  --c-accent-fill: #a3123a; /* filled crimson chip: white text 7.8:1 */
  --c-surface-alt: #f1f5f9;

  /* Bridge aliases: legacy page-scoped names resolve to the SSOT above */
  --ed-muted: var(--c-muted);
  --tm-muted: var(--c-muted);
  --ed-surface-alt: var(--c-surface-alt);
  --ed-crimson: var(--color-knu-crimson);

  /* Sector highlight tokens (WCAG >= 4.5:1 AA vs #ffffff; vs #f1f5f9 sunken >= 5.0:1) */
  --sector-current: #a3123a; /* KNU Crimson: 7.8:1 */
  --sector-industry: #0047ab; /* Samsung Corporate Blue: 8.4:1 */
  --sector-institute: #0f766e; /* Academic / Institute Teal: 5.5:1 */

  /* Institutional Brand Tokens (WCAG AA >= 4.5:1 vs #ffffff; vs #f1f5f9 sunken >= 4.5:1) */
  --brand-knu: #a3123a; /* KNU Crimson: 7.8:1 */
  --brand-samsung: #0047ab; /* Samsung Corporate Blue: 8.4:1 */
  --brand-postech: #9b1136; /* POSTECH Burgundy: 7.5:1 */
  --brand-rist: #0075a8; /* RIST Deep Cerulean Sky: 4.8:1 */
  --brand-calgary: #b45309; /* Calgary Deep Amber: 5.2:1 */
  --brand-kitech: #0f766e; /* KITECH Slate Teal: 5.5:1 */

  /* Motion */
  --ed-dur-fast: 150ms;

  /* Sticky stack: fixed al-folio navbar + in-page tab bar */
  --sticky-navbar: 3.5rem;
  --sticky-tabnav: 3.0625rem; /* 48px tab + 1px hairline */
}

/* ------------------------------------------------------------
   Dark Mode Overrides
   ------------------------------------------------------------ */
html[data-theme="dark"] {
  --color-knu-crimson: #f0708f;
  --color-knu-crimson-hover: #f7a0b5;
  --color-knu-crimson-soft: rgba(240, 112, 143, 0.12);

  --color-ace2-navy: #9db7d9;
  --color-ace2-navy-light: #b8cde4;
  --color-ace2-navy-soft: rgba(157, 183, 217, 0.14);

  --color-ground: #141011;
  --color-surface: #1c1719;
  --color-surface-hover: #262022;
  --color-ink: #f1f5f9;
  --color-ink-muted: #94a3b8;
  --color-line: #2d2628;
  --color-line-strong: #453a3d;

  --banner-bg: #1c1719;
  --banner-gradient: radial-gradient(1100px 300px at 12% 130%, rgba(240, 112, 143, 0.28), transparent 70%);
  --banner-text: #f1f5f9;
  --banner-text-muted: rgba(241, 245, 249, 0.76);

  /* Text tokens vs #1c1c1d page / #2a2e35 sunken surface.
     --c-accent-fill stays crimson: the light #f0708f fails with white text (2.8:1). */
  --c-ink: #f1f5f9;
  --c-text: #cbd5e1;
  --c-muted: #94a3b8; /* 6.6:1 page · 5.3:1 sunken */
  --c-subtle: #7c8aa0; /* 4.9:1 page */
  --c-accent: #9db7d9;
  --c-accent-fill: #a3123a;
  --c-surface-alt: #2a2e35;

  /* Sector highlight tokens vs #1c1c1d page / #23262b card surface (>= 4.5:1; 5.4 / 7.4 / 10.3:1 on card) */
  --sector-current: #f0708f; /* Light Crimson */
  --sector-industry: #60a5fa; /* Samsung Soft Blue: 6.5:1 */
  --sector-institute: #5eead4; /* Mint / Teal */

  /* Institutional Brand Tokens (WCAG AA >= 4.5:1 vs dark surface) */
  --brand-knu: #f0708f; /* Light Crimson: 5.4:1 */
  --brand-samsung: #60a5fa; /* Samsung Soft Blue: 6.5:1 */
  --brand-postech: #fb7185; /* POSTECH Rose: 5.5:1 */
  --brand-rist: #38bdf8; /* RIST Sky Cyan: 6.8:1 */
  --brand-calgary: #fbbf24; /* Calgary Warm Gold/Amber: 8.2:1 */
  --brand-kitech: #5eead4; /* KITECH Mint Teal: 10.3:1 */
}

/* ------------------------------------------------------------
   CJK Language-Specific Font Overrides (JA / ZH)
   Prevents Han-unification glyph mismatch on Shinjitai / Simplified Hanzi
   ------------------------------------------------------------ */
html[data-lang="ja"] {
  --font-sans-body:
    "Pretendard Variable", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", -apple-system, BlinkMacSystemFont,
    sans-serif;
}

html[data-lang="zh"] {
  --font-sans-body:
    "Pretendard Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
}
