/* ==========================================================================
   Ghahreman — design tokens
   Ported 1:1 from the redesigned mobile app (`apps/mobile/src/theme/`): dark
   slate stage, lime-mint actions, gold for prizes/champions, sky blue for
   secondary. Colak Pro type, RTL fa. Names mirror the app's Figma variable
   collection (gray/*, Mint/*, Orange/*, Blue-sky/*) so the two stay in sync —
   when a value moves in `apps/mobile/src/theme/colors.ts`, move it here too.
   This file owns: @font-face, the color scale, gradients, shadows, radii, the
   fluid type scale, motion tokens, and a small element base. Section/component
   styles live in css/styles.css.
   ========================================================================== */

/* ---- Colak Pro (Persian) — the app's face. Two styles at one weight:
   Normal for body, Soft for emphasis/headings. Converted from the mobile TTFs
   (`apps/mobile/src/assets/fonts/colak/`) — no synthetic weights, the family
   simply doesn't ship them. ------------------------------------------------ */
@font-face {
  font-family: 'Colak Pro';
  font-weight: 400 500;
  font-display: swap;
  src: url('../assets/fonts/colak/ColakPro-Normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Colak Pro';
  font-weight: 600 900;
  font-display: swap;
  src: url('../assets/fonts/colak/ColakPro-Soft.woff2') format('woff2');
}

:root {
  /* ---- Brand scale (mirrors apps/mobile/src/theme/colors.ts) ------------ */
  --gray-900: #101119;   /* below the app's range — page floor, footer */
  --gray-800: #1a1b28;   /* backdrop dark stop, panel bg */
  --gray-700: #26283b;   /* text stroke, input/panel face */
  --gray-600: #33364f;   /* gray button bottom inset */
  --gray-500: #404363;   /* backdrop light stop */
  --gray-400: #60637e;
  --gray-300: #808299;
  --gray-200: #a0a2b5;   /* disabled/off text */
  --gray-100: #c0c1d0;   /* secondary/label text */
  --gray-50:  #d0d1dd;

  --mint-100: #e7feda;   /* button top inset (the 3D highlight) */
  --mint-200: #cffdb6;
  --mint-300: #b6fd91;
  --mint-400: #9efc6d;   /* green button gradient start */
  --mint-600: #6dce3a;   /* green button gradient end */
  --mint-700: #54a12c;
  --mint-800: #3c751d;   /* green button border */
  --mint-900: #23480f;   /* ink on mint fills */

  --gold-100: #feedd6;
  --gold-200: #fcdcae;
  --gold-300: #fbca85;
  --gold-400: #ffcd19;   /* gold button gradient start */
  --gold-500: #f8a734;   /* gold button gradient end */
  --gold-600: #c7862a;
  --gold-700: #96651f;
  --gold-800: #664415;
  --gold-900: #35230a;   /* ink on gold fills */

  --sky-200: #a1c7f3;
  --sky-300: #72acec;
  --sky-500: #1474e0;
  --sky-600: #105db3;   /* sky button bottom inset */
  --sky-700: #0c4686;
  --sky-900: #04172d;

  --danger-500: #ff5b32;
  --danger-800: #930f12;

  /* ---- Semantic --------------------------------------------------------- */
  --bg:            var(--gray-800);
  --bg-2:          var(--gray-900);
  --surface:       rgba(255 255 255 / 0.05);
  --surface-2:     rgba(255 255 255 / 0.08);
  --surface-solid: var(--gray-700);
  --border:        rgba(255 255 255 / 0.10);
  --border-strong: rgba(255 255 255 / 0.20);

  --text:        #ffffff;
  --text-muted:  var(--gray-100);
  --text-faint:  var(--gray-300);
  --on-mint:     var(--mint-900);   /* ink for text on lime fills */
  --on-gold:     var(--gold-900);   /* ink for text on gold fills */

  --brand:       var(--mint-600);
  --brand-bright:var(--mint-400);
  --accent:      var(--gold-400);

  /* ---- Gradients (byte-exact copies of the app's fills) ----------------- */
  --grad-backdrop: radial-gradient(307.15% 128.32% at 77.86% 101.66%, #404363 0%, #1a1b28 100%);
  --grad-mint:     linear-gradient(178.1deg, #9efc6d 13.24%, #6dce3a 87.09%);
  --grad-gold:     linear-gradient(178.5deg, #ffcd19 -13.75%, #f8a734 93.59%);
  --grad-sky:      linear-gradient(180.6deg, #72acec 10.83%, #1474e0 98.33%);
  --grad-gray:     linear-gradient(180.42deg, #60637e 23.5%, #404363 97.07%);
  --grad-sheet:    linear-gradient(180deg, #404363 0%, #1a1b28 100%);
  --grad-text-mint: linear-gradient(100deg, var(--mint-300), var(--mint-600));
  --grad-text-gold: linear-gradient(100deg, var(--gold-400), var(--gold-500));
  --glow-hero:
    radial-gradient(60% 55% at 70% 25%, rgba(110 206 58 / 0.16), transparent 70%),
    radial-gradient(45% 45% at 15% 80%, rgba(248 167 52 / 0.14), transparent 70%);

  /* ---- Radii ------------------------------------------------------------ */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 999px;

  /* ---- Shadows ---------------------------------------------------------- */
  --sh-sm: 0 2px 8px rgba(0 0 0 / 0.4);
  --sh-md: 0 12px 30px -8px rgba(0 0 0 / 0.6);
  --sh-lg: 0 30px 70px -18px rgba(0 0 0 / 0.75);
  --glow-mint: 0 14px 40px -12px rgba(110 206 58 / 0.55);
  --glow-gold: 0 14px 40px -12px rgba(248 167 52 / 0.55);

  /* ---- Fluid type scale (clamp: min → max across viewport) -------------- */
  --fs-display: clamp(2.4rem, 1.3rem + 5vw, 5rem);
  --fs-h1:      clamp(1.9rem, 1.25rem + 3vw, 3.2rem);
  --fs-h2:      clamp(1.55rem, 1.15rem + 1.8vw, 2.4rem);
  --fs-h3:      clamp(1.2rem, 1rem + 0.9vw, 1.55rem);
  --fs-lead:    clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  --fs-body:    1.02rem;
  --fs-sm:      0.9rem;

  /* ---- Rhythm ----------------------------------------------------------- */
  --container: 1180px;
  --gutter: clamp(1.1rem, 0.6rem + 2.4vw, 2.4rem);
  --section-y: clamp(4rem, 2.5rem + 6vw, 8rem);

  /* ---- Motion ----------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 0.18s;
  --dur-2: 0.4s;
  --dur-3: 0.7s;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Colak Pro', 'Tahoma', system-ui, sans-serif;
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.35; font-weight: 700; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--mint-400); color: var(--on-mint); }

:focus-visible {
  outline: 3px solid var(--mint-400);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
