/* ==========================================================================
   B9 GAME — playb9.pk
   tokens.css — Design tokens for the "Royal Bronze" light theme
   Load order: tokens.css -> main.css -> pages/*.css
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------------
     Colour — warm, no pure white / pure black anywhere
     --------------------------------------------------------------------- */
  --color-bg-primary: #FBF6EE;
  --color-bg-surface: #F5EDE0;
  --color-bg-sunken: #F0E5D4;
  --color-bg-elevated: #FDFAF4;

  --color-bronze-deep: #6B4226;
  --color-bronze-mid: #8C5A34;
  --color-bronze-soft: #A87A50;

  --color-gold-royal: #C9A24B;
  --color-gold-light: #E8CE8F;
  --color-gold-pale: #F2E3BE;
  --color-gold-deep: #A8842F;

  --color-text-primary: #3B2A1E;
  --color-text-secondary: #7A6653;
  --color-text-muted: #9A8770;
  --color-text-on-dark: #F7EFE1;

  --color-border: #E3D4BC;
  --color-border-strong: #D6C2A2;
  --color-border-gold: rgba(201, 162, 75, 0.42);

  --color-success: #4C7A5A;
  --color-success-soft: #E4EFE7;
  --color-warning: #B07C2E;
  --color-danger: #A34B39;

  /* Dark "plate" tones — used for the logo lockup, ribbons and inverted panels */
  --color-plate-900: #241811;
  --color-plate-800: #2E1F15;
  --color-plate-700: #3B2A1E;
  --color-plate-600: #4A3524;

  /* ---------------------------------------------------------------------
     Gradients & foil effects
     --------------------------------------------------------------------- */
  --grad-gold-foil: linear-gradient(
    100deg,
    rgba(201, 162, 75, 0) 0%,
    rgba(201, 162, 75, 0.55) 18%,
    rgba(232, 206, 143, 0.95) 42%,
    rgba(168, 132, 47, 0.85) 58%,
    rgba(201, 162, 75, 0.5) 82%,
    rgba(201, 162, 75, 0) 100%
  );
  --grad-gold-fill: linear-gradient(135deg, #E8CE8F 0%, #C9A24B 45%, #A8842F 100%);
  --grad-gold-fill-hover: linear-gradient(135deg, #F2E3BE 0%, #D8B563 45%, #C9A24B 100%);
  --grad-bronze-fill: linear-gradient(135deg, #8C5A34 0%, #6B4226 60%, #4A3524 100%);
  --grad-plate: linear-gradient(150deg, #4A3524 0%, #2E1F15 45%, #3B2A1E 100%);
  --grad-surface-card: linear-gradient(170deg, #FDFAF4 0%, #F7F0E4 100%);
  --grad-ivory-fade: linear-gradient(180deg, rgba(251, 246, 238, 0) 0%, #FBF6EE 92%);

  /* Large, soft ambient glows (light-mode appropriate — never neon) */
  --glow-gold-ambient: radial-gradient(
    closest-side,
    rgba(201, 162, 75, 0.28) 0%,
    rgba(232, 206, 143, 0.16) 45%,
    rgba(232, 206, 143, 0) 100%
  );
  --glow-bronze-ambient: radial-gradient(
    closest-side,
    rgba(140, 90, 52, 0.2) 0%,
    rgba(140, 90, 52, 0.08) 50%,
    rgba(140, 90, 52, 0) 100%
  );

  /* Warm paper / linen grain — inline SVG so there is no extra request */
  --texture-linen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");

  /* ---------------------------------------------------------------------
     Typography
     --------------------------------------------------------------------- */
  --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-eyebrow: 0.72rem;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.1875rem;
  --fs-xl: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem);
  --fs-h4: clamp(1.15rem, 1rem + 0.6vw, 1.375rem);
  --fs-h3: clamp(1.35rem, 1.1rem + 1.05vw, 1.75rem);
  --fs-h2: clamp(1.75rem, 1.35rem + 1.85vw, 2.75rem);
  --fs-h1: clamp(2.25rem, 1.6rem + 3.1vw, 4rem);
  --fs-display: clamp(2.75rem, 1.8rem + 4.4vw, 5rem);
  --fs-stat: clamp(2.25rem, 1.6rem + 2.9vw, 3.75rem);

  --lh-tight: 1.08;
  --lh-heading: 1.18;
  --lh-snug: 1.45;
  --lh-body: 1.72;
  --lh-loose: 1.85;

  --ls-eyebrow: 0.22em;
  --ls-label: 0.1em;
  --ls-tight: -0.02em;

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

  /* ---------------------------------------------------------------------
     Spacing scale (8pt-ish, with fluid section rhythm)
     --------------------------------------------------------------------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-7: 2rem;
  --sp-8: 2.5rem;
  --sp-9: 3rem;
  --sp-10: 4rem;
  --sp-11: 5rem;
  --sp-12: 6.5rem;

  --section-y: clamp(3.5rem, 2.5rem + 4.2vw, 6.5rem);
  --section-y-lg: clamp(4.5rem, 3rem + 5.5vw, 8rem);

  /* Layout — deliberately generous left/right breathing room */
  --container-max: 1180px;
  --container-wide: 1360px;
  --container-narrow: 780px;
  --gutter: clamp(1.25rem, 5.5vw, 5rem);
  --gutter-wide: clamp(1.25rem, 4vw, 3.5rem);

  /* ---------------------------------------------------------------------
     Radii
     --------------------------------------------------------------------- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-pill: 999px;

  /* ---------------------------------------------------------------------
     Shadows — warm bronze, never harsh black
     --------------------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(107, 66, 38, 0.07);
  --shadow-sm: 0 2px 8px -2px rgba(107, 66, 38, 0.12);
  --shadow-md: 0 10px 26px -12px rgba(107, 66, 38, 0.26), 0 2px 6px -2px rgba(107, 66, 38, 0.1);
  --shadow-lg: 0 22px 48px -20px rgba(107, 66, 38, 0.34), 0 4px 12px -4px rgba(107, 66, 38, 0.12);
  --shadow-xl: 0 38px 80px -32px rgba(74, 53, 36, 0.42), 0 8px 22px -10px rgba(107, 66, 38, 0.16);
  --shadow-gold: 0 12px 34px -14px rgba(201, 162, 75, 0.62);
  --shadow-gold-strong: 0 18px 44px -14px rgba(201, 162, 75, 0.78), 0 0 0 1px rgba(232, 206, 143, 0.5);
  --shadow-inset-foil: inset 0 1px 0 rgba(255, 251, 240, 0.7), inset 0 -1px 0 rgba(201, 162, 75, 0.22);

  /* ---------------------------------------------------------------------
     Motion
     --------------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  --dur-fast: 160ms;
  --dur-base: 250ms;
  --dur-slow: 420ms;
  --dur-reveal: 720ms;

  /* ---------------------------------------------------------------------
     Elevation / stacking
     --------------------------------------------------------------------- */
  --z-base: 1;
  --z-decor: 0;
  --z-sticky-bar: 60;
  --z-header: 70;
  --z-fab: 80;
  --z-drawer: 90;
  --z-modal: 100;
  --z-skip: 120;

  /* Chrome heights (referenced by scroll-padding + sticky offsets) */
  --header-h: 68px;
  --mobilebar-h: 62px;
}

@media (min-width: 768px) {
  :root {
    --header-h: 80px;
    --mobilebar-h: 0px;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion — mandatory global opt-out
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-base: 1ms;
    --dur-slow: 1ms;
    --dur-reveal: 1ms;
  }
}
