/* ============================================================
   Kiara Design System — Colors & Type
   Source of truth: Brand Bible 2026 §10 + Design System §1–2
   ============================================================ */

/* Fonts — Jost (English/headings, Futura Condensed substitute) and Noto Sans TC
   (Traditional Chinese) both self-hosted from /fonts/.
   Noto Sans TC is subset to the 327 glyphs actually used across this design
   system (regenerable; see comment in README).
   Azonix (logo wordmark) is NOT bundled and is NOT loaded — the logo ships as
   SVG so the font isn't needed for display. `--font-logo` lists 'Azonix' first
   so it's used IF a local copy is ever installed, then falls back to Jost. */

/* Jost — local woff2, latin + latin-ext, weights 400 / 500 / 600 / 700.
   URLs resolve relative to this CSS file (project root → /fonts/...). */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/jost-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/jost-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/jost-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/jost-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/jost-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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: 'Jost';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/jost-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/jost-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, 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: 'Jost';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/jost-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Noto Sans TC — subset to only the Traditional-Chinese glyphs actually used
   in this design system (~70KB/weight vs the full ~5MB/weight family).
   If you add new TC copy, regenerate by re-running the subset script and
   pulling fresh files from Google Fonts. */
@font-face {
  font-family: 'Noto Sans TC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/noto-sans-tc-400-subset.woff') format('woff');
}
@font-face {
  font-family: 'Noto Sans TC';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/noto-sans-tc-500-subset.woff') format('woff');
}
@font-face {
  font-family: 'Noto Sans TC';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/noto-sans-tc-700-subset.woff') format('woff');
}

:root {
  /* ---------- Brand color primitives ---------- */
  --kiara-magenta: #C9338B;  /* Primary brand / all CTAs */
  --kiara-purple:  #3A2F86;  /* Headers, body, premium accents */
  --kiara-pink:    #E56DA1;  /* Secondary highlight */
  --kiara-light:   #F0CFDD;  /* Soft background / accent */
  --kiara-cream:   #FDF8F5;  /* Page bg — warm, never pure white */

  /* On-dark text */
  --kiara-on-dark:        #FDF8F5;
  --kiara-on-dark-muted:  rgba(253, 248, 245, 0.65);

  /* ---------- Gradients ---------- */
  --kiara-grad-primary: linear-gradient(135deg, #3A2F86 0%, #C9338B 100%);
  --kiara-grad-soft:    linear-gradient(135deg, #F0CFDD 0%, #C9338B 100%);
  --kiara-grad-card:    linear-gradient(to bottom right, #FFFFFF, rgba(240,207,221,0.30));
  --kiara-grad-hero:    linear-gradient(to bottom, #1a1040 0%, #3A2F86 25%, #3A2F86 60%, #C9338B 90%, #E56DA1 100%);

  /* ---------- Glass (on-dark surfaces) ---------- */
  --glass-thin:      rgba(255, 255, 255, 0.08);
  --glass-regular:   rgba(255, 255, 255, 0.12);
  --glass-thick:     rgba(255, 255, 255, 0.18);
  --glass-border:    rgba(255, 255, 255, 0.18);
  --glass-border-strong: rgba(255, 255, 255, 0.30);

  /* ---------- Semantic roles ---------- */
  --fg-1:        var(--kiara-purple);                /* primary text */
  --fg-2:        rgba(58, 47, 134, 0.70);            /* secondary text */
  --fg-3:        rgba(58, 47, 134, 0.50);            /* muted text */
  --fg-accent:   var(--kiara-magenta);               /* links / highlight */
  --bg-page:     var(--kiara-cream);                 /* page bg */
  --bg-card:     #FFFFFF;
  --bg-soft:     var(--kiara-light);
  --border-soft: rgba(229, 109, 161, 0.10);          /* pink @ 10% */
  --border-purple: rgba(58, 47, 134, 0.15);

  /* CTA */
  --cta-bg:           var(--kiara-magenta);
  --cta-fg:           var(--kiara-cream);
  --cta-bg-hover:     var(--kiara-purple);
  --cta-fg-hover:     var(--kiara-cream);
  --focus-ring:       0 0 0 3px rgba(240, 207, 221, 0.45);

  /* ---------- Shadows (magenta/purple-tinted) ---------- */
  --shadow-card:        0 4px 20px rgba(201, 51, 139, 0.06);
  --shadow-card-hover:  0 14px 44px rgba(201, 51, 139, 0.14);
  --shadow-cta:         0 8px 24px rgba(201, 51, 139, 0.25);
  --shadow-cta-hover:   0 12px 32px rgba(58, 47, 134, 0.30);
  --shadow-overlay:     0 16px 48px rgba(0, 0, 0, 0.18);
  --shadow-overlay-dark:0 20px 40px rgba(0, 0, 0, 0.35);

  /* ---------- Radius ---------- */
  --radius-input: 14px;
  --radius-card:  20px;
  --radius-panel: 24px;
  --radius-pill:  9999px;

  /* ---------- Spacing (4px base) ---------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --section-y:    80px;
  --section-y-sm: 64px;
  --container-max: 1200px;
  --container-pad: 24px;

  /* ---------- Type families ---------- */
  --font-sans:    'Jost', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --font-display: 'Jost', 'Noto Sans TC', system-ui, sans-serif;
  --font-logo:    'Azonix', 'Jost', system-ui, sans-serif; /* logo wordmark only */

  /* ---------- Type scale (rem) ---------- */
  --fs-display: 2.8rem;   /* hero headline */
  --fs-h1:      2.4rem;
  --fs-h2:      1.6rem;
  --fs-h3:      1.3rem;
  --fs-body-lg: 1.0rem;
  --fs-body:    0.95rem;
  --fs-small:   0.85rem;
  --fs-xs:      0.7rem;

  --lh-tight:   1.1;
  --lh-snug:    1.2;
  --lh-normal:  1.5;
  --lh-relaxed: 1.6;

  --tracking-eyebrow: 0.15em;

  /* ---------- Motion ---------- */
  --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast:  150ms;
  --dur:       250ms;
  --dur-slow:  400ms;
}

/* ---------- Semantic element defaults ---------- */
html, body {
  background: var(--bg-page);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg-1);
  margin: 0;
  font-weight: 700;
}
h1 { font-size: var(--fs-h1);      line-height: var(--lh-snug); }
h2 { font-size: var(--fs-h2);      line-height: 1.25; font-weight: 600; }
h3 { font-size: var(--fs-h3);      line-height: 1.3;  font-weight: 600; }

p  { font-size: var(--fs-body);    line-height: var(--lh-relaxed); color: var(--fg-2); margin: 0; }

small, .text-small { font-size: var(--fs-small); line-height: var(--lh-normal); color: var(--fg-3); }

/* Hero / display */
.display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Eyebrow / uppercase label */
.eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  font-weight: 500;
  color: var(--fg-accent);
}

a { color: var(--fg-accent); text-decoration: none; }
a:hover { color: var(--kiara-purple); }

/* Mobile clamp — scale display/h1 ~30% smaller */
@media (max-width: 768px) {
  :root {
    --fs-display: 2rem;
    --fs-h1:      1.7rem;
    --fs-h2:      1.3rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
