/* ==========================================================================
   GaugePlay Design System — tokens.css  (v1.2 · 2026-10-04)
   Concept: "한 칸씩 차오른다" (Fill the gauge, one cell at a time).
   Every step a person takes — watch, tap, play, store — fills one cell.
   Load order: fonts/fonts.css -> tokens.css -> base.css -> components.css
   Brand colors are fixed by BUILD_BRIEF §1 (landing v3). Do not add new hues.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ---- Brand (fixed, landing v3) ---- */
  --bg: #0b1012;
  --bg-2: #0f1518;
  --surface: #141b1e;
  --line: #273036;
  --ink: #f5f7f5;
  --muted: #a7b0b0;
  --faint: #6f7b7c;       /* 4.38 (bg) .. 3.27 (surface-3): borders, icons, disabled, large text (>=24px / 18.66px bold) ONLY.
                             Never small text -> use --faint-text. */
  --primary: #c6ff3d;     /* lime: progress, measured truth, primary action */
  --secondary: #ff7a59;   /* coral: hot, decline, plan, warning */

  /* ---- Derived neutrals (same hue family as brand bg) ---- */
  --surface-2: #1a2327;   /* raised: sheets, modals, toasts */
  --surface-3: #212c31;   /* hover on surface, skeleton base */
  --line-2: #3a4650;      /* strong border, hover border */
  --ink-2: #cfd6d6;       /* secondary emphasis text */
  --faint-text: #8a9697;  /* --faint's hue (184.6deg), lightened for small text: 6.28 (bg) .. 4.69 (surface-3), AA on every surface */
  --void: #05080a;        /* phone bezel, deepest shade */

  /* ---- Derived brand shades ---- */
  --on-primary: #0b1012;
  --on-secondary: #0b1012;
  --primary-press: #74a61c;    /* hard bottom edge of lime buttons (game-key depth) */
  --secondary-press: #b4472a;
  --primary-a08: rgba(198, 255, 61, .08);
  --primary-a16: rgba(198, 255, 61, .16);
  --primary-a32: rgba(198, 255, 61, .32);
  --primary-a60: rgba(198, 255, 61, .60);
  --secondary-a10: rgba(255, 122, 89, .10);
  --secondary-a24: rgba(255, 122, 89, .24);
  --scrim: rgba(5, 8, 10, .72);
  --glass: rgba(11, 16, 18, .80);
  --on-media: rgba(11, 16, 18, .72);   /* label plates on top of video/thumbnails */

  /* ---- Semantic aliases ---- */
  --text: var(--ink);
  --text-2: var(--muted);
  --text-3: var(--faint-text);         /* tertiary TEXT must pass AA at any size; --faint stays for non-text */
  --focus: var(--primary);
  --ok: var(--primary);
  --warn: var(--secondary);
  --danger: var(--secondary);          /* errors = coral + icon + words, never color alone */

  /* ---- Type families ---- */
  /* GP Sans = Pretendard Variable subset (wght 400-930), renamed per OFL. A page normally downloads one
     core file (~166 KB); syllables outside it come from small 128-codepoint blocks. See fonts/fonts.css. */
  --font-sans: "GP Sans", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --font-pixel: "GP Pixel 11", "GP Sans", ui-monospace, monospace;
  --font-num: "GP Pixel 14", "GP Pixel 11", ui-monospace, monospace;
  /* "GP Sans" before the generic: Korean inside code runs would otherwise fall to GulimChe on Windows. */
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", "GP Sans", monospace;
  /* Unbounded third-party / user text (YouTube titles, LFG posts): syllables outside the core pull extra
     GP Sans blocks (~19 KB each), so long runs may use the OS Korean font instead. Opt-in via .gp-text-system. */
  --font-system: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;

  /* ---- Type scale (fluid 390 -> 1440) ---- */
  --fs-display: clamp(2.75rem, 1.9rem + 4.4vw, 5.5rem);   /* ~48 -> 88 */
  --fs-h1: clamp(2.125rem, 1.6rem + 2.6vw, 4rem);         /* ~36 -> 63 */
  --fs-h2: clamp(1.625rem, 1.25rem + 1.8vw, 2.875rem);    /* ~27 -> 46 */
  --fs-h3: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);         /* 20 -> 24 */
  --fs-lead: clamp(1.0625rem, 1rem + .3vw, 1.25rem);      /* 17 -> 20 */
  --fs-body: 1rem;        /* 16 — inputs never below this (iOS zoom) */
  --fs-sm: .875rem;       /* 14 */
  --fs-xs: .8125rem;      /* 13 */
  --fs-2xs: .75rem;       /* 12 — captions min */

  /* Pixel fonts render crisp only on their grid: GP Pixel 11 = 12px multiples, GP Pixel 14 = 15px multiples */
  --fs-px-1: 12px;
  --fs-px-2: 24px;
  --fs-px-3: 36px;
  --fs-num-1: 15px;
  --fs-num-2: 30px;
  --fs-num-3: 45px;
  --fs-num-4: 60px;
  --fs-num-5: 90px;
  --fs-num-6: 120px;
  --tr-px: .0834em;       /* = 1px at 12px; keeps pixel glyph spacing on the grid */

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-body: 1.6;
  --tr-display: -.04em;
  --tr-head: -.03em;
  --tr-tight: -.01em;

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

  /* ---- Space (n x 4px) ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-30: 120px;

  /* ---- Layout ---- */
  --container: 1200px;
  --container-narrow: 760px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-y: clamp(64px, 8vw, 120px);
  --nav-h: 60px;
  --tabbar-h: 64px;
  --tap: 44px;            /* minimum touch target */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* ---- Radius ---- */
  --r-0: 0;
  --r-1: 2px;     /* pixel cells */
  --r-2: 4px;     /* badges */
  --r-3: 8px;     /* chips (square), small tiles */
  --r-4: 12px;    /* buttons, inputs, toasts */
  --r-5: 16px;    /* cards */
  --r-6: 24px;    /* sheets, big frames */
  --r-pill: 999px;

  /* ---- Elevation (dark UI: inner top highlight + deep drop) ---- */
  --sh-1: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .5);
  --sh-2: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 28px -8px rgba(0, 0, 0, .65);
  --sh-3: inset 0 1px 0 rgba(255, 255, 255, .06), 0 28px 72px -16px rgba(0, 0, 0, .8);
  --glow-1: 0 0 0 1px var(--primary-a32), 0 8px 28px -6px rgba(198, 255, 61, .30);
  --glow-2: 0 0 0 1px var(--primary-a60), 0 0 44px rgba(198, 255, 61, .35);
  --glow-coral: 0 0 0 1px var(--secondary-a24), 0 8px 28px -6px rgba(255, 122, 89, .35);

  /* ---- Texture & light ---- */
  --light-top: radial-gradient(900px 420px at 50% 0, rgba(198, 255, 61, .10), transparent 70%);
  --light-bottom: radial-gradient(700px 300px at 50% 100%, rgba(198, 255, 61, .12), transparent 70%);
  --tex-grid: linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px) 0 0 / 24px 24px,
              linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px) 0 0 / 24px 24px;

  /* ---- Z-index ---- */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-nav: 200;
  --z-tabbar: 210;
  --z-scrim: 900;
  --z-sheet: 1000;
  --z-modal: 1100;
  --z-toast: 1200;
  --z-tooltip: 1300;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --dur-instant: 80ms;    /* press */
  --dur-fast: 140ms;      /* hover, color */
  --dur-base: 220ms;      /* fade, small move */
  --dur-slow: 360ms;      /* sheet, modal */
  --dur-fill: 900ms;      /* gauge fill */
  --dur-charge: 2400ms;   /* light sweep loop */
}
