/* ==========================================================================
   S9 Game — Design Tokens
   s9apk.pk · Obsidian & Gold luxury system
   All primitive values live here. Components consume these only.
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------------
     1. COLOR — Obsidian base
     --------------------------------------------------------------------- */
  --color-obsidian-900: #05050a;
  --color-obsidian-800: #08080f;
  --color-obsidian-700: #0c0c15;
  --color-obsidian-600: #12121d;
  --color-obsidian-500: #191926;
  --color-obsidian-400: #212130;
  --color-obsidian-300: #2c2c3d;

  /* Gold — foil / leaf / stamp */
  --color-gold-100: #fdf3d4;
  --color-gold-200: #f7e3a8;
  --color-gold-300: #f0cf78;
  --color-gold-400: #e6b94f;
  --color-gold-500: #d4a238;
  --color-gold-600: #b3862a;
  --color-gold-700: #8a6620;

  /* Crimson — royal accent (matches S9 brand mark) */
  --color-crimson-400: #f0455c;
  --color-crimson-500: #d81f3c;
  --color-crimson-600: #ab1730;
  --color-crimson-700: #7d1023;

  /* Jade — success / verified */
  --color-jade-400: #4bd6a0;
  --color-jade-500: #29b483;
  --color-jade-700: #128a63;

  /* Telegram brand */
  --color-telegram: #29a9eb;
  --color-telegram-dark: #1c88c2;

  /* ---------------------------------------------------------------------
     2. SEMANTIC SURFACES
     --------------------------------------------------------------------- */
  --color-bg: var(--color-obsidian-900);
  --color-bg-alt: var(--color-obsidian-800);
  --color-surface: var(--color-obsidian-700);
  --color-surface-raised: var(--color-obsidian-600);
  --color-surface-hover: var(--color-obsidian-500);
  --color-frame: rgba(230, 185, 79, 0.16);
  --color-frame-strong: rgba(230, 185, 79, 0.42);
  --color-hairline: rgba(255, 255, 255, 0.07);

  /* ---------------------------------------------------------------------
     3. TEXT — contrast-checked on obsidian
     --------------------------------------------------------------------- */
  --color-text-primary: #ece9e3;   /* ~14.8:1 on --color-bg  */
  --color-text-secondary: #b7b2a8; /* ~8.4:1  on --color-bg  */
  --color-text-muted: #8d8880;     /* ~5.1:1  on --color-bg  */
  --color-text-gold: var(--color-gold-300); /* large text / accents only */
  --color-text-on-gold: #17140b;

  /* ---------------------------------------------------------------------
     4. GRADIENTS & FOIL EFFECTS
     --------------------------------------------------------------------- */
  --gradient-foil: linear-gradient(
    100deg,
    #8a6620 0%,
    #e6b94f 18%,
    #fdf3d4 34%,
    #f0cf78 48%,
    #b3862a 62%,
    #f7e3a8 80%,
    #d4a238 100%
  );
  --gradient-gold-btn: linear-gradient(155deg, #f7e3a8 0%, #e6b94f 42%, #b3862a 100%);
  --gradient-crimson: linear-gradient(155deg, #f0455c 0%, #d81f3c 48%, #7d1023 100%);
  --gradient-surface: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.012) 40%,
    rgba(0, 0, 0, 0.2) 100%
  );
  --gradient-veil: linear-gradient(180deg, rgba(5, 5, 10, 0) 0%, rgba(5, 5, 10, 0.94) 88%);
  --gradient-hairline: linear-gradient(
    90deg,
    transparent 0%,
    rgba(230, 185, 79, 0.5) 50%,
    transparent 100%
  );

  /* ---------------------------------------------------------------------
     5. SHADOW & GLOW
     --------------------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.62);
  --shadow-xl: 0 40px 110px rgba(0, 0, 0, 0.72);
  --glow-gold-sm: 0 0 0 1px rgba(230, 185, 79, 0.28), 0 6px 24px rgba(230, 185, 79, 0.14);
  --glow-gold-md: 0 0 0 1px rgba(230, 185, 79, 0.42), 0 10px 44px rgba(230, 185, 79, 0.22);
  --glow-crimson: 0 10px 44px rgba(216, 31, 60, 0.28);
  --glow-candle: radial-gradient(
    420px circle at var(--cursor-x, 50%) var(--cursor-y, 50%),
    rgba(230, 185, 79, 0.13) 0%,
    rgba(216, 31, 60, 0.05) 42%,
    transparent 72%
  );

  /* ---------------------------------------------------------------------
     6. TYPOGRAPHY
     --------------------------------------------------------------------- */
  --font-display: "Cinzel", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  /* Fluid type scale (mobile-first, clamps to desktop) */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: clamp(0.9375rem, 0.9rem + 0.18vw, 1.0625rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --text-xl: clamp(1.1875rem, 1.1rem + 0.45vw, 1.375rem);
  --text-2xl: clamp(1.375rem, 1.24rem + 0.7vw, 1.75rem);
  --text-3xl: clamp(1.625rem, 1.4rem + 1.15vw, 2.25rem);
  --text-4xl: clamp(2rem, 1.6rem + 1.9vw, 3rem);
  --text-5xl: clamp(2.375rem, 1.8rem + 2.9vw, 4rem);
  --text-hero: clamp(2.5rem, 1.7rem + 3.9vw, 4.75rem);

  --leading-tight: 1.12;
  --leading-snug: 1.28;
  --leading-normal: 1.62;
  --leading-relaxed: 1.78;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.06em;
  --tracking-wider: 0.14em;
  --tracking-widest: 0.24em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 900;

  /* ---------------------------------------------------------------------
     7. SPACE (8px rhythm)
     --------------------------------------------------------------------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 5.5rem;
  --space-4xl: 7.5rem;

  /* Section rhythm */
  --section-pad-y: clamp(3.5rem, 2rem + 7vw, 7rem);
  --section-gap: clamp(2rem, 1.2rem + 3vw, 3.5rem);

  /* ---------------------------------------------------------------------
     8. LAYOUT — generous side gutters (extra breathing room L/R)
     --------------------------------------------------------------------- */
  --container-max: 1240px;
  --container-wide: 1440px;
  --container-narrow: 820px;
  --gutter: clamp(1.25rem, 0.4rem + 4.6vw, 5rem);
  --page-inset: clamp(0rem, -1rem + 2.4vw, 2rem);
  --header-h: 74px;
  --header-h-scrolled: 64px;

  /* ---------------------------------------------------------------------
     9. RADIUS
     --------------------------------------------------------------------- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-2xl: 34px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* ---------------------------------------------------------------------
     10. BORDERS
     --------------------------------------------------------------------- */
  --border-hairline: 1px solid var(--color-hairline);
  --border-frame: 1px solid var(--color-frame);
  --border-gold: 1px solid var(--color-frame-strong);

  /* ---------------------------------------------------------------------
     11. MOTION
     --------------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur-base: 280ms;
  --dur-slow: 520ms;
  --dur-slower: 900ms;
  --stagger-step: 70ms;

  /* ---------------------------------------------------------------------
     12. Z-INDEX
     --------------------------------------------------------------------- */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 100;
  --z-header: 200;
  --z-drawer: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;

  /* ---------------------------------------------------------------------
     13. COMPONENT TOKENS
     --------------------------------------------------------------------- */
  --card-bg: linear-gradient(165deg, rgba(25, 25, 38, 0.92) 0%, rgba(8, 8, 15, 0.96) 100%);
  --card-border: 1px solid rgba(230, 185, 79, 0.14);
  --card-radius: var(--radius-lg);
  --card-pad: clamp(1.25rem, 1rem + 1vw, 2rem);

  --btn-pad-y: 0.875rem;
  --btn-pad-x: 1.75rem;
  --btn-radius: var(--radius-pill);
  --btn-font: var(--weight-bold) 0.9375rem/1 var(--font-body);

  --focus-ring: 0 0 0 3px rgba(5, 5, 10, 1), 0 0 0 5px var(--color-gold-400);
}

/* Reduced-motion: neutralise every decorative duration at the token level. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-base: 1ms;
    --dur-slow: 1ms;
    --dur-slower: 1ms;
    --stagger-step: 0ms;
  }
}
