/*
 * Responsible for: every colour, size, space, radius, shadow and speed the product's screens use.
 * A stylesheet or a component takes its values from here and from nowhere else, so that every screen
 * looks like the same product.
 *
 * Must never: hold a rule for an element or a class. Only custom properties live here.
 */

@layer tokens, base, kit, screens;

@layer tokens {
  :root {
    /* Surfaces and text */
    --bg: #F3F5F7;
    --panel: #FFFFFF;
    --sunken: #EBEFF3;
    --ink: #1C2430;
    --muted: #5B6675;
    --faint: #8A94A3;
    --rule: #DCE1E7;
    --accent: #1F5F6B;
    --accent-strong: #174B55;
    --on-accent: #F7F9FA;
    --tint: #E3EDEF;
    --hover: #EBEFF3;
    --ok: #2B6A45;
    --ok-bg: #E5F1E9;
    --warn: #85550F;
    --warn-bg: #FAF0DF;
    --badge: #E5484D;
    --unread: #2F6FDB;
    --star: #D99A1C;
    --pop: #FFFFFF;

    /* The Demo button: a brighter blue than the accent, with white text on it (5 to 1). Its marked state is the darker one. */
    --demo: #1B64F2;
    --demo-strong: #1450C8;

    /* Folder colours: soft, chalk-pastel mid-tones that carry white writing (3.2 to 1 or better; see test/colour-tokens.test.ts). The only place these values exist. Keys match ColourKey in engine/views.ts. The five largest areas of the
       made-up mailbox (Shopping, Career, Newsletters, People, Junk) wear hues far apart on the colour wheel: green, blue, teal,
       pink and a quiet brown. */
    --c-people: #D66D8F;
    --c-finance: #DE5B45;
    --c-government: #63718F;
    --c-health: #D24455;
    --c-career: #588FE0;
    --c-education: #8E69E9;
    --c-housing: #A66C5C;
    --c-shopping: #2D9568;
    --c-travel: #4C95CA;
    --c-food: #649542;
    --c-entertainment: #C27F2F;
    --c-tech: #BE67BF;
    --c-newsletters: #3D96A7;
    --c-other: #838B8A;
    --c-junk: #A38A75;
    --c-own-1: #B947C9;
    --c-own-2: #83792D;
    --c-own-3: #348473;
    --c-own-4: #C673AB;
    --c-own-5: #C34896;
    --c-own-6: #6671CD;

    /* Type: seven sizes */
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --t-xs: 12px;
    --t-sm: 13.5px;
    --t-md: 15px;
    --t-lg: 17px;
    --t-xl: 22px;
    --t-2xl: 30px;
    --t-3xl: 42px;
    /* The large numeral beside each numbered step's title on the landing page. */
    --t-step-number: 64px;

    /* Space: one scale */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 72px;

    /* Shape */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-pill: 999px;
    --shadow-1: 0 1px 2px rgba(28, 36, 48, .06), 0 2px 8px rgba(28, 36, 48, .05);
    --shadow-2: 0 2px 6px rgba(28, 36, 48, .08), 0 14px 36px rgba(28, 36, 48, .14);

    /* Motion: three speeds and two curves. Reduced motion sets the speeds to zero. */
    --fast: 120ms;
    --move: 240ms;
    --slow: 420ms;
    --ease: cubic-bezier(.2, .7, .2, 1);
    /* The slow, calm fade between the lines of a reading's story. */
    --calm: 900ms;
    --calm-ease: cubic-bezier(.4, 0, .2, 1);
    --spring: cubic-bezier(.3, 1.3, .5, 1);

    /* How faint the rest of the Map goes while one category is pointed at. */
    --quieted: .4;

    /* Layers */
    --z-sticky: 10;
    --z-drag: 20;
    --z-popover: 30;
    --z-notice: 40;

    /* Layout */
    --head-h: 56px;
    --tap: 44px;

    /* The moving guide: its sentence, its pointer (an arrow for a mouse, a fingertip for a touch) and the ring of a press */
    --guide-say: 20px;
    --guide-arrow-w: 48px;
    --guide-arrow-h: 70px;
    --guide-finger: 84px;
    --guide-ripple: 92px;
    /* The notice's dimmed screen: its strength (share of the ink laid over the window) and how fast it comes in. */
    --guide-dim: 42%;
    --guide-fade: 90ms;

    /* The mail app in the look of a mail service: its own surfaces, lines and text. Layout and colour only. */
    --gm-canvas: #F6F8FC;
    --gm-panel: #FFFFFF;
    --gm-read: #F2F6FC;
    --gm-rule: #E3E7ED;
    --gm-search: #EAF1FB;
    --gm-select: #D3E3FD;
    --gm-compose: #C2E7FF;
    --gm-compose-ink: #041E49;
    --gm-ink: #1F1F1F;
    --gm-muted: #5F6368;
    --gm-on-label: #FFFFFF;
    --ol-bar: #0F548C;
    --ol-on-bar: #FFFFFF;
    --ol-bar-field: #E6EFF8;
    --ol-canvas: #F0F2F5;
    --ol-panel: #FFFFFF;
    --ol-rule: #E1E4E8;
    --ol-select: #E3EEF9;
    --ol-accent: #115EA3;
    --ol-ink: #242424;
    --ol-muted: #616161;

    color-scheme: light;
  }

  @media (prefers-reduced-motion: reduce) {
    :root {
      --fast: 0ms;
      --move: 0ms;
      --slow: 0ms;
      --calm: 0ms;
      --guide-fade: 0ms;
    }
  }
}
