/* =====================================================================
   KoGym design tokens — editorial, sporty, systematic.
   The hero is the only photographic / gradient surface. Everything below it is
   flat: white and light-grey sections, grey cards, ink type, one green accent.
   ===================================================================== */
:root {
  /* ---- Brand mark (one-file logo swap: replace assets/brand/mark.png / mark-green.png) ---- */
  --brand-mark: url("../assets/brand/mark.png");             /* black mark, for light surfaces */
  --brand-mark-light: url("../assets/brand/mark-green.png"); /* green mark, for photo / ink surfaces */
  --brand-mark-ratio: 1024 / 845;

  /* ---- Surfaces ---- */
  --c-bg: #FFFFFF;          /* page + white sections */
  --c-bg-alt: #F5F6F7;      /* alternating grey sections */
  --c-card: #F2F3F5;        /* grey cards on white */
  --c-card-2: #E9EBEE;      /* nested / pressed grey */
  --c-line: #E3E6E9;        /* 1px hairlines */
  --c-line-strong: #CDD2D8; /* inputs, dividers that must read */

  /* ---- Text ---- */
  --c-ink: #0E1110;         /* headings, primary text                   17.9:1 on white */
  --c-body: #4A5058;        /* body copy                                 8.1:1 on white, 7.3:1 on card */
  --c-muted: #626973;       /* secondary text (AA)                       5.6:1 on white, 5.0:1 on card */
  --c-faint: #8A9099;       /* non-text only: icons, rules */

  /* ---- Accent: KoGym green (matches the logo) ---- */
  --c-green: #18EB5C;       /* primary buttons, active states, highlights */
  --c-green-hover: #14D853;
  --c-green-press: #11C24A;
  --c-green-soft: #E2FBEA;  /* tinted chips / success panels */
  --c-green-ink: #0A7D32;   /* green TEXT on light surfaces              5.3:1 on white */
  /* Label colour on solid green buttons. The brand brief asks for white (heavy, >= 18px,
     with a tight dark outline shadow). White on #18EB5C is 1.61:1 (hover 1.91:1, pressed
     2.38:1) and fails WCAG AA. One-token fix if that decision changes: set this to
     #0E1110 (11.82:1) or #06140C (11.75:1) and the shadow in --on-green-shadow to none. */
  --c-on-green: #FFFFFF;
  --on-green-shadow: 0 1px 0 rgba(3, 40, 18, 0.55), 0 0 1px rgba(3, 40, 18, 0.7), 0 0 8px rgba(3, 40, 18, 0.25);
  --c-green-edge: #0A7D32;  /* 1.5px edge on primary buttons so the fill reads on white (5.3:1) */
  --c-on-green-ui: #0E1110;  /* small labels on green inside demo UI (chips, selected days) */

  /* ---- Hero photo palette (sampled from the emerald art) ---- */
  --c-forest: #0B3B2A;
  --c-forest-deep: #06231A;
  --c-on-photo: #FFFFFF;
  --c-on-photo-muted: rgba(255, 255, 255, 0.82);
  --c-photo-line: rgba(255, 255, 255, 0.34);

  /* ---- Feedback ---- */
  --c-danger: #C4291C;      /* 5.6:1 on white */
  --c-danger-soft: #FDECEA;

  /* ---- Typography ---- */
  --font-display: "Archivo", "PingFang HK", "PingFang TC", "Noto Sans HK", "Heiti TC", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang HK", "PingFang TC", "Noto Sans HK", "Microsoft JhengHei", system-ui, sans-serif;
  --font-num: "Archivo", "Inter", -apple-system, system-ui, sans-serif;

  /* Type scale (fluid). Display sizes are uppercase + tight in Latin. */
  --fs-mega: clamp(2.75rem, 1.35rem + 5.2vw, 6.75rem);      /* 44 → 108  section titles */
  --fs-h3: clamp(1.375rem, 1.15rem + 0.8vw, 1.75rem);        /* 22 → 28   card titles */
  --fs-h4: clamp(1.125rem, 1.06rem + 0.25vw, 1.25rem);       /* 18 → 20 */
  --fs-lead: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);    /* 17 → 20 */
  --fs-body: 1rem;                                           /* 16 */
  --fs-small: 0.875rem;                                      /* 14 */
  --fs-xs: 0.75rem;                                          /* 12 */
  --fs-stat: clamp(2.75rem, 1.9rem + 2.6vw, 4.5rem);        /* 44 → 72   hero stat numerals */
  --fs-kicker: 0.8125rem;                                    /* 13 */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;
  --fw-display: 900;

  --lh-display: 0.9;
  --lh-tight: 1.1;
  --lh-body: 1.65;
  --tracking-display: -0.035em;
  --tracking-tight: -0.02em;
  --tracking-caps: 0.08em;

  /* ---- Spacing: 8px grid ---- */
  --sp-0: 4px;
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 80px;
  --sp-9: 96px;
  --sp-10: 128px;
  --section-y: clamp(80px, 3.5rem + 5vw, 144px);
  --gutter: clamp(16px, 3.6vw, 48px);
  --container: 1240px;
  --container-wide: 1440px;
  --grid-gap: clamp(16px, 1.8vw, 24px);
  --header-h: 72px;

  /* ---- Radii: editorial, nearly square ---- */
  --r-btn: 4px;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-card: 12px;
  --r-pill: 999px;

  /* ---- Borders ---- */
  --bw: 1px;
  --bw-strong: 1.5px;
  --border: var(--bw) solid var(--c-line);

  /* ---- Icons ---- */
  --icon-stroke: 2px;

  /* ---- Motion: subtle only ---- */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 700ms;
  --dur-hero: 700ms;
  --rise: 20px;
  --press-scale: 0.98;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
    --dur-hero: 0ms;
    --rise: 0px;
  }
  /* Catch-all for keyframes with fixed durations (slot pop, macro pop, counter tick, shake). */
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
