/* =====================================================================
   TimeFace Design System — tokens + adoption layer   (DESIGN agent, 2026-11-12)
   Spec: docs/DESIGN-SYSTEM.md

   ONE source of truth for colour, type, radius, spacing, elevation, motion.
   Loads AFTER style.css and tf2-redesign.css. Removing this <link> reverts
   every visual change it makes (nothing else depends on it: every new
   var() used elsewhere carries a fallback).

   Rules of thumb
   - Violet is the ONE brand colour. Two roles, never mixed:
       --tf-brand        light violet for text / icons / borders on dark  (6.1:1 on bg)
       --tf-brand-fill   deep violet for filled buttons under white text  (white 4.6–6.5:1)
   - Champagne = value only (credits, gift, "best value"). Never a CTA.
   - Headings: Rubik 700 (800 only for big numbers). Body: Heebo 400/500/600.
     No 900 anywhere — Hebrew at 900 closes the counters and reads as a blob.
   - Radii: 8 · 12 · 14 (controls) · 16 (tiles) · 22 (cards/panels) · 28 (sheets) · pill.
   - No new @media blocks here (owner rule: mobile @media is maintained by Tuvia).
   ===================================================================== */

:root{
  /* ---- neutrals (dark, cool, low-chroma) ---- */
  --tf-bg-0:#07080C;            /* page */
  --tf-bg-1:#0A0C12;            /* page lower / recessed */
  --tf-surface-1:#11141D;       /* cards */
  --tf-surface-2:#161A25;       /* raised card, sheet */
  --tf-surface-3:#1B2030;       /* popover, hover on surface-2 */
  --tf-line-1:rgba(255,255,255,.07);   /* default hairline */
  --tf-line-2:rgba(255,255,255,.12);   /* inputs, emphasised hairline */
  --tf-line-3:rgba(255,255,255,.20);   /* hover / strong */

  /* ---- text (all ≥ 4.5:1 on --tf-surface-3, the lightest surface) ---- */
  --tf-text-1:#F3F5FB;          /* primary          16.2:1 on surface-1 */
  --tf-text-2:#AEB6C9;          /* secondary         8.0:1 on surface-3 */
  --tf-text-3:#8B93A8;          /* tertiary / meta   5.3:1 on surface-3 (was #7E869B = 4.45, failed) */

  /* ---- brand violet ---- */
  --tf-brand-300:#B4A8FF;
  --tf-brand:#8B7BFF;           /* text / icon / border / focus on dark — 6.1:1 on bg-0 */
  --tf-brand-400:#A394FF;       /* links on surfaces — 6.4:1 on surface-3 */
  --tf-brand-fill:#6E5BFF;      /* solid fill under white text — white 4.56:1 */
  --tf-brand-fill-2:#5440E6;    /* gradient end — white 6.46:1 */
  --tf-brand-soft:rgba(139,123,255,.14);
  --tf-brand-line:rgba(139,123,255,.38);
  --tf-on-brand:#FFFFFF;
  --tf-grad-brand:linear-gradient(135deg,#6E5BFF 0%,#5440E6 100%);
  --tf-glow-brand:0 10px 28px rgba(94,72,240,.42);

  /* ---- value accent (credits / gift / best-value) ---- */
  --tf-champ:#E9C98B;
  --tf-champ-text:#F1DDAF;      /* champagne text on dark — 13.7:1 */
  --tf-on-champ:#1B1407;        /* dark text on champagne — 11.5:1 */
  --tf-grad-champ:linear-gradient(90deg,#F1DDAF,#E9C98B);

  /* ---- status ---- */
  --tf-success:#86ECB4;  --tf-success-soft:rgba(134,236,180,.12);
  --tf-warning:#FBBF24;  --tf-warning-soft:rgba(251,191,36,.12);
  --tf-danger:#FF8A98;   --tf-danger-soft:rgba(255,138,152,.12);
  --tf-danger-fill:#BE123C;     /* destructive button, white 6.3:1 */

  /* ---- type ---- */
  --tf-font-display:'Rubik','Heebo',-apple-system,'Segoe UI',Arial,sans-serif;
  --tf-font-body:'Heebo',-apple-system,'Segoe UI',Arial,sans-serif;
  --tf-fs-micro:12px;           /* badges / dock labels only, weight ≥ 600 */
  --tf-fs-caption:13px;         /* meta, helper text — the body-text floor */
  --tf-fs-sm:14px;
  --tf-fs-body:15px;
  --tf-fs-md:16px;              /* inputs (≥16 stops iOS zoom-on-focus) */
  --tf-fs-title-sm:18px;
  --tf-fs-title:20px;
  --tf-fs-h3:24px;
  --tf-fs-h2:30px;
  --tf-fs-h1:clamp(30px,4.6vw,44px);
  --tf-fw-regular:400; --tf-fw-medium:500; --tf-fw-semibold:600; --tf-fw-bold:700; --tf-fw-heavy:800;
  --tf-lh-tight:1.15; --tf-lh-snug:1.35; --tf-lh-body:1.6;

  /* ---- spacing (4-pt) ---- */
  --tf-sp-1:4px; --tf-sp-2:8px; --tf-sp-3:12px; --tf-sp-4:16px; --tf-sp-5:20px;
  --tf-sp-6:24px; --tf-sp-7:32px; --tf-sp-8:40px; --tf-sp-9:56px;

  /* ---- radius ---- */
  --tf-r-xs:8px;      /* tags, tiny chips */
  --tf-r-sm:12px;     /* chips, small tiles, menu rows */
  --tf-r-control:14px;/* buttons, inputs, segmented controls */
  --tf-r-tile:16px;   /* media tiles, list cards */
  --tf-r-card:22px;   /* cards, panels, dialogs */
  --tf-r-sheet:28px;  /* bottom sheets (top corners) */
  --tf-r-pill:999px;

  /* ---- elevation ---- */
  --tf-e1:0 2px 8px rgba(0,0,0,.28);
  --tf-e2:0 10px 28px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.04);
  --tf-e3:0 24px 64px rgba(0,0,0,.6);

  /* ---- motion ---- */
  --tf-ease:cubic-bezier(.2,.7,.2,1);
  --tf-dur-1:.16s; --tf-dur-2:.24s; --tf-dur-3:.4s;

  /* ---- interaction ---- */
  --tf-target:44px;             /* minimum touch target */
  --tf-focus:0 0 0 2px var(--tf-bg-0), 0 0 0 4px var(--tf-brand);
}

/* =====================================================================
   1) ALIAS LAYER — the two older token sets now read from the one above.
      (style.css :root "PRO MAX" set + tf2-redesign.css html.tf2 set)
   ===================================================================== */
html.tf2{
  /* tf2 shell tokens */
  --tf2-bg:var(--tf-bg-0); --tf2-bg2:var(--tf-bg-1);
  --tf2-surf:var(--tf-surface-1); --tf2-surf2:var(--tf-surface-2); --tf2-elev:var(--tf-surface-3);
  --tf2-line:var(--tf-line-1); --tf2-line2:var(--tf-line-2);
  --tf2-txt:var(--tf-text-1); --tf2-mut:var(--tf-text-2); --tf2-mut2:var(--tf-text-3);
  --tf2-vio:var(--tf-brand); --tf2-vio2:var(--tf-brand-fill); --tf2-viosoft:var(--tf-brand-soft);
  --tf2-champ:var(--tf-champ); --tf2-ok:var(--tf-success); --tf2-rad:var(--tf-r-card);
  /* legacy style.css tokens (re-skinned by tf2-redesign.css §GLOBAL THEME) */
  --bg-0:var(--tf-bg-0); --bg-1:var(--tf-bg-1); --bg-elevated:var(--tf-surface-3);
  --surface-solid:var(--tf-surface-1); --surface-solid-2:var(--tf-surface-2);
  --text-primary:var(--tf-text-1); --text-secondary:var(--tf-text-2); --text-tertiary:var(--tf-text-3);
  --border-soft:var(--tf-line-1); --border-default:var(--tf-line-2); --border-strong:var(--tf-line-3);
  --grad-gold:var(--tf-grad-brand);           /* every consumer of --grad-gold is a filled CTA */
  --glow-gold:var(--tf-glow-brand);
  --text-on-gold:var(--tf-on-brand);
  --coin:var(--tf-champ);
  --r-sm:var(--tf-r-sm); --r-md:var(--tf-r-tile); --r-lg:var(--tf-r-card); --r-xl:var(--tf-r-sheet); --r-pill:var(--tf-r-pill);
  --btn-r:var(--tf-r-control);
  --font-display:var(--tf-font-display); --font-body:var(--tf-font-body);
  --success:var(--tf-success); --warning:var(--tf-warning); --danger:var(--tf-danger);
  --ease:var(--tf-ease);
}

/* =====================================================================
   2) TYPOGRAPHY — one heading voice across every screen
   ===================================================================== */
/* Rubik for headings everywhere (it was loaded on every page but used by ~nothing).
   Specificity (0,1,2) beats the module-injected heading rules (.x h3 = 0,1,1); rules
   that set their own font shorthand in tf2-redesign.css were migrated at the source. */
html.tf2 :is(h1,h2,h3,h4){font-family:var(--tf-font-display)}
/* Hebrew/Arabic: no negative tracking on headings (Latin-only habit; it glues Hebrew letters) */
html[dir="rtl"].tf2 :is(h1,h2,h3,h4),
html[dir="rtl"] #tf2home h1, html[dir="rtl"] #tf2home .sec h3,
html[dir="rtl"] .tf2-sheet h3{letter-spacing:0}
/* numbers that ARE the message (prices, balances) share the display face */
html.tf2 :is(.tf2p-tier .tp-amt,.tf2c2-bal .b-num,.tf2b-hero .h-cr-num,.tf2b-hero .h-cell-num,.tfp-price,.tfp-amt){font-family:var(--tf-font-display);font-variant-numeric:tabular-nums}

/* =====================================================================
   3) PRIMITIVES — focus, targets, selection
   ===================================================================== */
html.tf2 :is(a,button,[role="button"],[role="tab"],input,select,textarea,summary,[tabindex]):focus-visible{
  outline:2px solid var(--tf-brand);outline-offset:2px}
html.tf2 ::selection{background:rgba(139,123,255,.38);color:#fff}
/* inputs ≥ 16px: iOS Safari zooms the page on focus when an input is smaller */
html.tf2 :is(input[type="text"],input[type="email"],input[type="password"],input[type="tel"],input[type="search"],input:not([type]),textarea,select){font-size:max(16px,1em)}

/* reusable component classes for NEW markup (old markup keeps its classes) */
.tf-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--tf-target);
  padding:0 20px;border-radius:var(--tf-r-control);border:1px solid transparent;cursor:pointer;
  font:var(--tf-fw-bold) var(--tf-fs-body)/1.2 var(--tf-font-body);text-decoration:none;
  transition:transform var(--tf-dur-1) var(--tf-ease),filter var(--tf-dur-1),background-color var(--tf-dur-1),border-color var(--tf-dur-1)}
.tf-btn:active{transform:scale(.98)}
.tf-btn--primary{background:var(--tf-grad-brand);color:var(--tf-on-brand);box-shadow:var(--tf-glow-brand)}
.tf-btn--secondary{background:var(--tf-surface-2);color:var(--tf-text-1);border-color:var(--tf-line-2)}
.tf-btn--ghost{background:transparent;color:var(--tf-text-2)}
.tf-btn--danger{background:var(--tf-danger-fill);color:#fff}
.tf-btn[disabled],.tf-btn[aria-disabled="true"]{opacity:.45;cursor:not-allowed;box-shadow:none}
.tf-card{background:var(--tf-surface-1);border:1px solid var(--tf-line-1);border-radius:var(--tf-r-card);box-shadow:var(--tf-e2)}
.tf-chip{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px;border-radius:var(--tf-r-pill);
  border:1px solid var(--tf-line-2);background:var(--tf-surface-2);color:var(--tf-text-2);font:600 var(--tf-fs-sm)/1 var(--tf-font-body)}
.tf-chip[aria-pressed="true"],.tf-chip.on{background:var(--tf-brand-soft);border-color:var(--tf-brand-line);color:var(--tf-text-1)}
.tf-badge{display:inline-block;padding:3px 8px;border-radius:var(--tf-r-pill);font:700 var(--tf-fs-micro)/1.2 var(--tf-font-body)}
.tf-badge--brand{background:var(--tf-brand-soft);color:var(--tf-brand-300)}
.tf-badge--value{background:var(--tf-champ);color:var(--tf-on-champ)}
.tf-icn{display:inline-flex;vertical-align:-3px;margin-inline-end:6px}
.tf-icn svg{display:block}

/* =====================================================================
   4) SCREEN FIXES that need the cascade (sources edited where possible)
   ===================================================================== */
/* Gift bar (tf-gift-bar.js sets an inline style): neon lemon → champagne, the product's
   "value" colour. Same height/padding/position, so --tf-gift-h offsets stay valid. */
#tf-gift-bar{background:var(--tf-grad-champ)!important;color:var(--tf-on-champ)!important;
  box-shadow:0 1px 0 rgba(0,0,0,.25),0 6px 18px rgba(0,0,0,.28)!important;letter-spacing:0}

