/* =====================================================================
 * freebeat — Design Tokens
 * Source of truth: FB - Design System.fig (Styles page)
 *
 * Naming follows the fig: spacing xxs→23xl, radius_xxs→radius_round,
 * elevation e1–e6, blur sm/md/lg/xl, breakpoints mobile/tablet/desktop.
 *
 * This file extends `colors_and_type.css` (which carries the color
 * scales, font-face declarations, and motion tokens). Load both:
 *   <link rel="stylesheet" href="colors_and_type.css">
 *   <link rel="stylesheet" href="tokens.css">
 * ===================================================================== */

:root {
  /* =================================================================
   * SPACING SCALE — fig values, exact
   * One scale, 29 steps (incl. zero). Use the named tokens, not raw px.
   * ================================================================= */
  --space-zero:  0;
  --space-xxs:   2px;
  --space-xs:    4px;
  --space-sm:    6px;
  --space-md:    8px;
  --space-lg:    10px;
  --space-xl:    12px;
  --space-2xl:   14px;
  --space-3xl:   16px;
  --space-4xl:   18px;
  --space-5xl:   20px;
  --space-6xl:   22px;
  --space-7xl:   24px;
  --space-8xl:   26px;
  --space-9xl:   28px;
  --space-10xl:  32px;
  --space-11xl:  36px;
  --space-12xl:  40px;
  --space-13xl:  44px;
  --space-14xl:  48px;
  --space-15xl:  52px;
  --space-16xl:  56px;
  --space-17xl:  60px;
  --space-18xl:  64px;
  --space-19xl:  72px;
  --space-20xl:  80px;
  --space-21xl:  88px;
  --space-22xl:  104px;
  --space-23xl:  120px;

  /* =================================================================
   * RADIUS — base scale (22 steps + round)
   * Use *_xxs..*_16xl on surfaces; pill = radius_round.
   * ================================================================= */
  --radius_xxs:    2px;
  --radius_xs:     4px;
  --radius_sm:     6px;
  --radius_md:     8px;
  --radius_lg:     10px;
  --radius_xl:     12px;
  --radius_2xl:    14px;
  --radius_3xl:    16px;
  --radius_4xl:    18px;
  --radius_5xl:    20px;
  --radius_6xl:    22px;
  --radius_7xl:    24px;
  --radius_8xl:    28px;
  --radius_9xl:    32px;
  --radius_10xl:   40px;
  --radius_11xl:   44px;
  --radius_12xl:   48px;
  --radius_13xl:   52px;
  --radius_14xl:   56px;
  --radius_15xl:   64px;
  --radius_16xl:   72px;
  --radius_round:  1000px;

  /* Component subscale — for buttons, chips, inputs, small cards. */
  --radius-component-xxs:  3px;
  --radius-component-xs:   4px;
  --radius-component-sm:   6px;
  --radius-component-md:   8px;
  --radius-component-lg:   10px;
  --radius-component-xl:   12px;
  --radius-component-2xl:  14px;
  --radius-component-3xl:  16px;
  --radius-component-4xl:  18px;
  --radius-component-5xl:  20px;
  --radius-component-6xl:  22px;

  /* Big-component subscale — for hero cards, sheets, modals. */
  --radius-big-xs:   10px;
  --radius-big-sm:   12px;
  --radius-big-md:   16px;
  --radius-big-lg:   18px;

  /* Semantic role aliases (per fig overview tile labels) */
  --radius-rounded: 24px;   /* "Modern rounded — standard UI" */
  --radius-soft:    56px;   /* "Very soft — large surface treatment" */
  --radius-softer:  64px;   /* "Softer large — prominent cards" */
  --radius-pill:    var(--radius_round);

  /* =================================================================
   * ELEVATION — e1 to e6 (Minimal Lift → Cinematic), fig-exact values
   *
   * Six steps, fig-exact (Color-Palette-skill8):
   *   e1  Minimal Lift     · 1 layer   · 0 1px 2px #08
   *   e2  Low Depth        · 2 layers
   *   e3  Layered Low      · 3 layers
   *   e4  Moderate Depth   · 3 layers
   *   e5  Strong Lift      · 3 layers
   *   e6  Cinematic        · 4 layers (incl. inset highlight)
   *
   * Hex alphas in the fig: 08=3.1%, 10=6.3%, 14=7.8%, 18=9.4%, 1C=11%, 0F=5.9%
   * ================================================================= */
  --elevation-e1: 0 1px 2px #00000008;
  --elevation-e2: 0 1px 3px #00000008,
                  0 2px 4px #00000008;
  --elevation-e3: 0 2px 4px  #00000008,
                  0 4px 8px  #00000010,
                  0 8px 16px #00000008;
  --elevation-e4: 0 4px 8px  #00000010,
                  0 8px 16px #00000014,
                  0 16px 32px #00000010;
  --elevation-e5: 0 8px 16px #00000014,
                  0 16px 32px #00000018,
                  0 24px 48px #00000014;
  --elevation-e6: 0 12px 24px #00000018,
                  0 24px 48px #0000001C,
                  0 48px 96px #00000018,
                  inset 0 1px 0 #FFFFFF0F;

  /* Surface "Effects" — 350×350 swatches in fig Surface frame */
  --elevation-special:    var(--elevation-e1);    /* "Special" */
  --elevation-small-dark: 0 1px 2px -1.5px rgba(0,0,0,0.06),
                          inset 0 -4px 6px 0 rgba(0,0,0,0.09);

  /* =================================================================
   * BLUR — backdrop-filter values for layered atmospherics
   * sm: floating surfaces · md: overlays · lg: premium depth · xl: dramatic
   * ================================================================= */
  --blur-sm: 16px;
  --blur-md: 24px;
  --blur-lg: 48px;
  --blur-xl: 96px;

  /* =================================================================
   * BREAKPOINTS — three-tier responsive system
   *  402  · 🚲 mobile  — single column, focused, immersive
   *  744  · 📟 tablet  — intermediate, two-column potential
   * 1440  · 🖥 desktop — full multi-column, rich sidebar
   * ================================================================= */
  --bp-mobile:   402px;
  --bp-tablet:   744px;
  --bp-desktop:  1440px;

  /* =================================================================
   * TYPOGRAPHY — fig role scale, Google Sans Flex
   * Three families:
   *   display  — Display 3/2/1, Heading 6/5/4    (large expressive)
   *   heading  — Heading 3/2/1, Title 2/1        (mid-scale)
   *   product  — Body, Caption, Overline         (compact UI)
   * Each role has a default weight; use `font-weight` to access
   * normal (400) / medium (500) / semibold (600) / bold (700).
   * ================================================================= */

  /* ---- Display + Heading + Body + Caption + Overline scale ---------
   * Role names taken verbatim from fig Typography frame (Display 3..1,
   * Heading 6..1, Title 2..1, Body 2/1, Para, Caption 2/1, Overline).
   *
   * Sizes for Display/Heading/Title rows are inferred from the fig
   * specimen geometry — the fig declares role NAMES on a 56-px-gap
   * stack but does not expose explicit px sizes for each row in the
   * binary. These values are calibrated to the visual typescale
   * captured by fig_screenshot.
   *
   * Sizes for Body, Para, Caption and Overline ARE fig-exact (they
   * match the Interface Text Scale block, which IS declared).
   * ----------------------------------------------------------------- */

  /* Display — marketing hero, splash. Largest: matches fig sidebar
     header (76/80, ls -0.4, w700). */
  --type-display-3: 700 76px/80px var(--font-display);
  --type-display-2: 700 64px/68px var(--font-display);
  --type-display-1: 700 56px/60px var(--font-display);

  /* Heading — page titles, section starters. */
  --type-heading-6: 600 48px/52px var(--font-display);
  --type-heading-5: 600 40px/44px var(--font-display);
  --type-heading-4: 600 36px/40px var(--font-display);
  --type-heading-3: 600 32px/40px var(--font-display);
  --type-heading-2: 600 28px/36px var(--font-display);
  --type-heading-1: 600 24px/32px var(--font-display);

  /* Title — subsection headers, feature labels. */
  --type-title-2:   500 20px/28px var(--font-sans);
  --type-title-1:   500 18px/26px var(--font-sans);

  /* Body — long-form, descriptions. Body/1 + Para match the fig
     Interface Text Scale Body/Large row (15/22 · w400). */
  --type-body-2:    400 17px/26px var(--font-sans);
  --type-body-1:    400 15px/22px var(--font-sans);   /* fig-exact */
  --type-para:      400 15px/22px var(--font-sans);   /* fig-exact */

  /* Caption — metadata, supporting. fig-exact (Caption/Lg + Caption/Df). */
  --type-caption-2: 400 12px/16px var(--font-sans);   /* fig-exact */
  --type-caption-1: 400 10px/14px var(--font-sans);   /* fig-exact */

  /* Overline — section markers, tiny labels. fig-exact (11/12 w600 ls+1). */
  --type-overline:  600 11px/12px var(--font-sans);
  --type-overline-tracking: 1px;

  /* INTERFACE TEXT SCALE — compact product-grade scale.
   * Every value below is declared verbatim in the fig Typography
   * frame's "Interface Text Scale" table. */
  --type-ui-title-default:   500 16px/24px var(--font-sans);
  --type-ui-body-large:      400 15px/22px var(--font-sans);
  --type-ui-body-default:    400 13px/18px var(--font-sans);
  --type-ui-caption-large:   400 12px/16px var(--font-sans);
  --type-ui-caption-default: 400 10px/14px var(--font-sans);
  --type-ui-overline:        600 11px/12px var(--font-sans);

  /* LETTER SPACING tokens (fig: Compact / Default / Open) */
  --tracking-compact: -0.2px;   /* mid-scale headings */
  --tracking-default: 0;        /* body, interface */
  --tracking-open:    1px;      /* overlines, sparse labels */

  /* WEIGHT tokens (fig: Regular / Medium / Semibold / Bold) */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
}

/* =====================================================================
 * Backwards-compat aliases — old token names still resolve to fig values.
 * Existing UI kits / preview cards that used the legacy --space-1..16
 * and --radius-xs..2xl scales continue to work.
 * ===================================================================== */
:root {
  --space-1:  var(--space-xs);   /* 4 */
  --space-2:  var(--space-md);   /* 8 */
  --space-3:  var(--space-xl);   /* 12 */
  --space-4:  var(--space-3xl);  /* 16 */
  --space-5:  var(--space-5xl);  /* 20 */
  --space-6:  var(--space-7xl);  /* 24 */
  --space-8:  var(--space-10xl); /* 32 */
  --space-10: var(--space-12xl); /* 40 */
  --space-12: var(--space-14xl); /* 48 */
  --space-16: var(--space-18xl); /* 64 */

  --radius-xs:   var(--radius_xs);    /* 4 */
  --radius-sm:   var(--radius_sm);    /* 6 */
  --radius-md:   var(--radius_md);    /* 8 — was 10, now matches fig */
  --radius-lg:   var(--radius_2xl);   /* 14 */
  --radius-xl:   var(--radius_5xl);   /* 20 */
  --radius-2xl:  var(--radius_7xl);   /* 24 */

  --shadow-e1: var(--elevation-e1);
  --shadow-e2: var(--elevation-e2);
  --shadow-e3: var(--elevation-e3);
  --shadow-e4: var(--elevation-e4);
}
