/* Spotimy · tokens v3
   Drop-in replacement for the Taraz token files (colors.css, brand.css, components.css).
   Same token names, same three tiers: base → semantic → component.
   Load AFTER the Taraz token files; Taraz components re-theme with no code change.
   Comment on each semantic token: what it replaces / old value in Taraz. */

/* ───────── Tier 1 · base (raw values, never used directly in components) ───────── */
:root {
  /* paper / ink neutrals (warm) */
  --paper-95: #F2EEE5;   /* light canvas */
  --paper-91: #E8E2D5;   /* light card */
  --paper-86: #DDD6C8;   /* light hairline */
  --paper-78: #C9C2B3;   /* muted text on dark band */
  --paper-72: #B8B1A2;   /* section numbers on band */
  --paper-68: #B3AC9D;   /* dark-theme muted text */
  --paper-40: #5B5548;   /* light-theme muted text */
  --paper-25: #3A362D;   /* hairline on dark band */
  --ink-20: #2E2B24;     /* dark hairline */
  --ink-14: #1F1D18;     /* dark card */
  --ink-9:  #16140F;     /* light ink, light band */
  --ink-8:  #14130F;     /* dark canvas */
  --ink-4:  #0A0908;     /* dark band */
  --white: #FFFFFF;

  /* v3 bands used by the G35 home and header */
  --band-card: #23201A;  /* raised card inside a dark band */
  --note-card: #154838;  /* card inside the founder note */
  --note-line: #2C5A4B;  /* hairline inside the founder note */

  /* accent options (one is active as --accent) */
  --orange-60: #FF5A1F;  /* default accent */
  --orange-40: #B23A0A;  /* accent as text on light paper */
  --yellow-80: #FFC53D;
  --mint-75:   #3DDC97;
  --violet-65: #9580FF;

  /* forest (founder note) */
  --forest-25: #0F3B2E;
  --forest-32: #1C4A3C;
  --forest-75: #9DBFAF;
  --forest-90: #D7E5DE;

  /* status ramps: unchanged from Taraz (kept separate from accent) */
}

/* ───────── Tier 2 · semantic · light (default) ───────── */
:root, [data-theme="light"] {
  --bg-canvas: var(--paper-95);        /* was neutral-98 (#f7f8f8-ish) · page background */
  --bg-surface: var(--paper-95);       /* was neutral-100 white · v3 has no separate white surface */
  --bg-raised: var(--white);           /* was neutral-100 · selection pill, floating */
  --bg-sunken: var(--paper-91);        /* was neutral-96 · = v3 "card" */
  --bg-hover: var(--paper-91);         /* was neutral-96 */
  --bg-active: var(--paper-86);        /* was neutral-92 */
  --bg-inverse: var(--ink-9);          /* was neutral-23 · dark pill buttons */
  --bg-inverse-hover: var(--orange-60);/* was neutral-30 · v3: dark button turns accent on hover */
  --bg-inverse-active: var(--orange-60);/* was neutral-35 */
  --on-inverse: var(--paper-95);       /* was neutral-100 */
  --line-subtle: var(--paper-86);      /* was neutral-92 */
  --line-default: var(--paper-86);     /* was neutral-86 */
  --line-control: var(--ink-9);        /* was neutral-62 · v3 outlined controls use 1.5px ink */
  --text-primary: var(--ink-9);        /* was neutral-23 */
  --text-secondary: var(--paper-40);   /* was neutral-46 · 6.4:1 on paper, 5.7:1 on card */
  --text-tertiary: var(--paper-40);    /* was neutral-52 · merged with secondary */
  --text-disabled: #9A9384;            /* was neutral-72 · non-essential text only */
  --brand: var(--accent);              /* was teal-52 / indigo #5E48C8 */
  --brand-hover: var(--ink-9);         /* was derived darker brand · v3: accent → ink on hover */
  --brand-active: var(--ink-9);
  --brand-soft: var(--paper-91);       /* was teal-95 */
  --brand-text: var(--orange-40);      /* was teal-52 · accent as small text on light (5.2:1) */
  --on-brand: var(--ink-9);            /* was neutral-100 · text on accent is always ink (5.9:1) */
  --focus: var(--accent);              /* was teal-52 · 3px ring */
  --scrim: #16140F80;                  /* was #191e2066 */
  --plaque: #F2EEE5E0;                 /* was #ffffffb8 */
  --shadow-raised: 0 1px 3px #16140F26;                    /* was 0 1px 2px … */
  --shadow-floating: 0 24px 48px -24px #16140F59;          /* menus, mega menu */
  --shadow-overlay: 0 12px 32px -12px #16140F80;           /* fixed bars, dialogs */

  /* v3 additions */
  --accent: var(--orange-60);          /* NEW · the "spot" colour; tweakable */
  --band: var(--ink-9);                /* NEW · dark band sections, footer, fixed bars (always dark) */
  --on-band: var(--paper-95);          /* NEW */
  --on-band-muted: var(--paper-78);    /* NEW · 10.4:1 on band */
  --on-band-dim: var(--paper-72);      /* NEW · section numbers on band */
  --band-line: var(--paper-25);        /* NEW */
  --note: var(--forest-25);            /* NEW · founder note / testimonial block */
  --on-note: var(--forest-90);         /* NEW · 9.6:1 */
  --on-note-muted: var(--forest-75);   /* NEW · 6.2:1 */
}

/* ───────── Tier 2 · semantic · dark ───────── */
[data-theme="dark"] {
  --brand: var(--accent);
  --accent: var(--orange-60);
  --focus: var(--accent);
  --bg-canvas: var(--ink-8);
  --bg-surface: var(--ink-8);
  --bg-raised: var(--ink-14);
  --bg-sunken: var(--ink-14);
  --bg-hover: var(--ink-14);
  --bg-active: var(--ink-20);
  --bg-inverse: var(--paper-95);
  --bg-inverse-hover: var(--orange-60);
  --bg-inverse-active: var(--orange-60);
  --on-inverse: var(--ink-9);
  --line-subtle: var(--ink-20);
  --line-default: var(--ink-20);
  --line-control: var(--paper-95);
  --text-primary: var(--paper-95);
  --text-secondary: var(--paper-68);   /* 8.2:1 on canvas, 7.5:1 on card */
  --text-tertiary: var(--paper-68);
  --text-disabled: #6E685B;
  --brand-hover: var(--paper-95);
  --brand-active: var(--paper-95);
  --brand-soft: var(--ink-14);
  --brand-text: var(--accent);         /* orange on dark canvas 6.0:1 */
  --on-brand: var(--ink-9);
  --scrim: #0A090899;
  --plaque: #14130FE0;
  --shadow-raised: 0 1px 3px #00000066;
  --shadow-floating: 0 24px 48px -24px #000000B3;
  --shadow-overlay: 0 12px 32px -12px #000000CC;
  --band: var(--ink-4);
  --band-line: var(--paper-25);
}

/* ───────── Spacing, radius, type (overrides of Taraz scale) ───────── */
:root {
  --radius-frame: 24px;      /* unchanged · cards */
  --radius-band: 32px;       /* NEW · large bands (CTA, cover, hero media) */
  --radius-control: 9999px;  /* was 12px · v3 buttons, chips, segmented, search are pills */
  --radius-field: 14px;      /* NEW · text inputs */
  --radius-indicator: 4px;   /* unchanged */
  --gutter: clamp(16px, 4vw, 40px);           /* NEW · page side padding */
  --section-y: clamp(56px, 8vw, 104px);       /* NEW · vertical section padding */
  --content-max: 1200px;                       /* was ~1040px */
  --font-sans: "Peyda", system-ui, sans-serif; /* was Instrument Sans + Vazirmatn */
  --font-mono: "Geist Mono", Peyda, ui-monospace, monospace;
}

/* ───────── Tier 3 · component ───────── */
:root, [data-theme] {
  --frame-pad: 24px;
  --frame-radius: var(--radius-frame);
  --frame-bg: var(--bg-sunken);            /* v3 cards are "card" colour, no border */
  --frame-line: transparent;
  --selection-bg: var(--bg-raised);        /* unchanged role · segmented / tabs / radio cards keep text-primary on top */
  --selection-line: var(--line-control);   /* was line-default · v3 1.5px ink outline */
  --selection-shadow: var(--shadow-raised);
  --chip-selected-bg: var(--bg-inverse);   /* NEW · filter chips, category pills, pagination: ink pill */
  --chip-selected-fg: var(--on-inverse);   /* NEW */
  --selection-radius: var(--radius-control);
  --button-primary-bg: var(--accent);      /* was bg-inverse · v3 primary CTA = accent pill */
  --button-primary-bg-hover: var(--bg-inverse);
  --button-primary-bg-active: var(--bg-inverse);
  --button-primary-fg: var(--on-brand);
  --button-dark-bg: var(--bg-inverse);     /* NEW · secondary emphasis (header CTA, add to cart) */
  --button-dark-fg: var(--on-inverse);
  --button-secondary-bg: transparent;
  --button-secondary-line: var(--line-control);   /* 1.5px */
  --button-height-lg: 56px;                /* NEW */
  --button-height-md: 48px;
  --button-height-sm: 44px;                /* touch minimum */
  --field-bg: var(--bg-canvas);
  --field-line: var(--line-default);       /* 1.5px; focus → ink border + 3px accent ring */
  --field-sunken-bg: var(--bg-canvas);
  --field-sunken-line: var(--line-default);
  --slider-track-bg: var(--line-default);
  --slider-fill: var(--accent);
  --slider-thumb-bg: var(--bg-raised);
  --slider-thumb-line: var(--line-control);
  --tabs-underline: var(--accent);
  --focus-ring: 3px solid var(--focus);    /* was 2px */
  --focus-offset: 2px;
  --badge-instant-bg: var(--accent);       /* NEW · «تحویل فوری» */
  --badge-instant-fg: var(--on-brand);
  --badge-preorder-bg: transparent;        /* NEW · «پیش‌فروش» outlined */
  --badge-preorder-line: var(--text-primary);
}
