/* =========================================================================
   KORE design tokens
   Brand colours come straight from the Resources Pack and must not change:
   cream #FAF7F2 / #F1E9DC, Training #D6E3EC, Nutrition #DEEAE0,
   Recovery #E9C6C1, text #000000.
   Everything else (spacing, type scale, motion) follows the reference-site
   recommendations: 4px spacing base, fluid type, 150/250/600ms motion,
   600/960/1440 breakpoints.
   ========================================================================= */

@font-face {
  font-family: "Quicksand";
  src: url("../fonts/Quicksand-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* ---- Brand palette (fixed) ---- */
  --kore-cream-light: #FAF7F2;
  --kore-cream: #F1E9DC;
  --kore-training: #D6E3EC;
  --kore-nutrition: #DEEAE0;
  --kore-recovery: #E9C6C1;
  --kore-ink: #000000;

  /* ---- Supporting tones (derived, for borders, hover and muted text) ---- */
  --kore-cream-deep: #E6DBC9;
  --kore-training-deep: #C3D5E1;
  --kore-nutrition-deep: #C9DDCD;
  --kore-recovery-deep: #DEB2AB;
  --kore-charcoal: #2A2724;

  /* ---- Semantic roles (light theme) ---- */
  --bg: var(--kore-cream);
  --surface: var(--kore-cream-light);
  --surface-sunken: var(--kore-cream-deep);
  --text: var(--kore-ink);
  --text-soft: #3B3732;
  --text-muted: #5E574F;
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.28);
  --btn-bg: #1E1C1A;
  --btn-text: var(--kore-cream-light);
  --btn-bg-hover: #000000;
  --overlay: rgba(42, 39, 36, 0.38);
  --focus: #1E1C1A;
  --success: #3E6B4A;
  --error: #8E3B33;
  --emblem-filter: none;

  /* ---- Typography ---- */
  --font-cjk: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Hiragino Sans GB", "Source Han Sans SC";
  --font-display: "Quicksand", "Manrope", var(--font-cjk), system-ui, sans-serif;
  --font-heading: "General Sans", "Manrope", var(--font-cjk), system-ui, sans-serif;
  --font-body: "Manrope", var(--font-cjk), system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-display: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  --fs-h1: clamp(2.125rem, 1.7rem + 2vw, 3.25rem);
  --fs-h2: clamp(1.75rem, 1.45rem + 1.3vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --fs-h4: 1.125rem;
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-small: 0.875rem;
  --fs-xs: 0.8125rem;
  --lh-tight: 1.15;
  --lh-body: 1.6;

  /* ---- Spacing (4px base) ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;
  --section-pad: clamp(4rem, 3rem + 5vw, 8rem);
  --gutter: clamp(16px, 4vw, 48px);
  --content-max: 1200px;
  --text-max: 40rem;

  /* ---- Shape ---- */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-soft: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(60, 45, 30, .06);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.05), 0 16px 40px rgba(60, 45, 30, .10);
  --shadow-deboss: inset 0 1px 2px rgba(0,0,0,.08), inset 0 -1px 0 rgba(255,255,255,.6);

  /* ---- Motion ---- */
  --dur-fast: 150ms;
  --dur-ui: 250ms;
  --dur-reveal: 600ms;
  --ease-ui: cubic-bezier(.25, .1, .25, 1);
  --ease-reveal: cubic-bezier(0, 0, .3, 1);

  /* ---- Layers ---- */
  --z-header: 50;
  --z-bottombar: 60;
  --z-overlay: 80;
  --z-menu: 90;
  --z-dialog: 100;
  --z-toast: 110;

  color-scheme: light;
}

/* Dark theme: uses the charcoal logo variant from the colour templates.
   Pillar colours stay exactly the same; text on pillar colours stays black. */
:root[data-theme="dark"] {
  --bg: #24221F;
  --surface: #2E2B28;
  --surface-sunken: #1D1B19;
  --text: var(--kore-cream);
  --text-soft: #E2D9CB;
  --text-muted: #B9AF9F;
  --line: rgba(241, 233, 220, 0.14);
  --line-strong: rgba(241, 233, 220, 0.32);
  --btn-bg: var(--kore-cream);
  --btn-text: #1E1C1A;
  --btn-bg-hover: #FFFFFF;
  --overlay: rgba(0, 0, 0, 0.55);
  --focus: var(--kore-cream);
  --success: #9BC6A5;
  --error: #E6A59C;
  --emblem-filter: invert(93%) sepia(8%) saturate(300%) hue-rotate(345deg);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.25);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.35);
  --shadow-deboss: inset 0 1px 2px rgba(0,0,0,.4), inset 0 -1px 0 rgba(255,255,255,.04);
  color-scheme: dark;
}
