/* Thermals brand tokens: the single source of truth for colour, type, space and shape.
   The download page (index.html) and the brand guide (brand/index.html) both read from here.
   Direction: Thermals should look like a utility that ships with macOS. See the brand guide for the reasoning. */

:root {
  /* ---- Neutrals: the greys of macOS itself. Tiles are the colour of the app's own window. ---- */
  --bg: #ffffff;            /* page */
  --band: #f5f5f7;          /* full-width section behind tiles */
  --tile: #ffffff;          /* tiles; same as the app's window in light mode */
  --inset: #f5f5f7;         /* the recess inside a tile that a capture sits in */
  --field: #ffffff;         /* text field */
  --ink: #1d1d1f;           /* text */
  --ink-2: #6e6e73;         /* secondary text */
  --ink-3: #86868b;         /* captions */
  --line: #d2d2d7;          /* hairlines */
  --nav: rgba(255, 255, 255, .78);

  /* ---- Action: system blue, the colour macOS uses for the thing you can click. ---- */
  --action: #0071e3;
  --action-hover: #0077ed;
  --link: #0066cc;

  /* ---- Ember: sampled from the app icon. The brand's one colour, used in exactly three places:
          the icon, the wallpaper behind the product, and one line of the headline. ---- */
  --ember-light: #ffbb7b;
  --ember: #f36642;
  --ember-text: linear-gradient(92deg, #ff8a3c 0%, #f2542d 55%, #d93a1e 100%);
  /* The wallpaper: soft overlapping lights, like a macOS desktop picture, in the icon's colours.
     It sits behind the product in the hero and behind the closing call, and nowhere else. */
  --wall:
    radial-gradient(120% 95% at 6% -6%, #fff3e6 0%, rgba(255, 243, 230, 0) 68%),
    radial-gradient(85% 80% at 100% 0%, #ffcdaa 0%, rgba(255, 205, 170, 0) 70%),
    radial-gradient(95% 90% at 92% 108%, #f37443 0%, rgba(243, 116, 67, 0) 70%),
    radial-gradient(110% 95% at -4% 106%, #ffad7a 0%, rgba(255, 173, 122, 0) 70%),
    #ffd9c0;
  --glow: radial-gradient(75% 62% at 50% -12%, rgba(255, 150, 96, .22) 0%, rgba(255, 150, 96, .08) 45%, rgba(255, 150, 96, 0) 100%);
  --on-wall: #3a1c10;       /* text set directly on the wallpaper */
  --on-wall-2: rgba(58, 28, 16, .72);
  --bar-pill: rgba(60, 20, 0, .13);   /* the highlight behind an open menu bar item */

  /* ---- Status: the app's verdict colours (macOS system colours). They only ever mean status. ---- */
  --relaxed: #34c759;
  --busy: #ffcc00;
  --near: #ff9500;
  --throttling: #ff3b30;

  /* ---- Type: the system font, on Apple's own scale. Size / line height / tracking travel together. ---- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --t-hero: clamp(2.5rem, 7.6vw, 5rem);        /* 40–80 */
  --t-title: clamp(2rem, 4.6vw, 3rem);         /* 32–48 */
  --t-tile: clamp(1.3125rem, 2.3vw, 1.75rem);  /* 21–28 */
  --t-lede: clamp(1.1875rem, 1.9vw, 1.3125rem);/* 19–21 */
  --t-body: 1.0625rem;                         /* 17 */
  --t-small: .875rem;                          /* 14 */
  --t-caption: .75rem;                         /* 12 */

  --lh-hero: 1.05;   --tr-hero: -.015em;
  --lh-title: 1.08;  --tr-title: -.003em;
  --lh-tile: 1.14;   --tr-tile: .007em;
  --lh-lede: 1.38;   --tr-lede: .011em;
  --lh-body: 1.47;   --tr-body: -.022em;
  --lh-small: 1.43;  --tr-small: -.016em;
  --lh-caption: 1.33;--tr-caption: -.01em;

  /* ---- Space: 4-point scale. ---- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 140px;
  --gutter: clamp(16px, 4vw, 22px);
  --page: 1024px;
  --gap: 20px;              /* between tiles */

  /* ---- Shape. ---- */
  --r-tile: 28px;
  --r-stage: 36px;
  --r-window: 22px;         /* a capture of the whole menu */
  --r-control: 980px;       /* capsule */
  --shadow-window: 0 0 0 .5px rgba(0, 0, 0, .12), 0 18px 50px -12px rgba(120, 50, 20, .28), 0 4px 14px rgba(0, 0, 0, .06);
  --shadow-module: 0 0 0 .5px rgba(0, 0, 0, .08), 0 10px 28px -14px rgba(0, 0, 0, .22);
  --shadow-field: 0 0 0 .5px rgba(0, 0, 0, .10), 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px -16px rgba(0, 0, 0, .22);
  --shadow-card: 0 0 0 .5px rgba(0, 0, 0, .08), 0 24px 60px -28px rgba(0, 0, 0, .28);

  --ease: cubic-bezier(.25, .1, .25, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);   /* arrivals: quick start, long settle */
  --fast: 200ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --band: #000000;
    --tile: #1d1d1d;        /* the app's window in dark mode */
    --inset: #0c0c0d;
    --field: #1d1d1f;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --line: #424245;
    --nav: rgba(22, 22, 23, .78);
    --link: #2997ff;
    --ember-text: linear-gradient(92deg, #ffb27a 0%, #ff8552 55%, #ff5f3a 100%);
    --wall:
      radial-gradient(120% 95% at 6% -6%, #40200f 0%, rgba(64, 32, 15, 0) 68%),
      radial-gradient(85% 80% at 100% 0%, #5e2713 0%, rgba(94, 39, 19, 0) 70%),
      radial-gradient(95% 90% at 92% 108%, #b9481c 0%, rgba(185, 72, 28, 0) 70%),
      radial-gradient(110% 95% at -4% 106%, #742e13 0%, rgba(116, 46, 19, 0) 70%),
      #2a130a;
    --glow: radial-gradient(75% 62% at 50% -12%, rgba(255, 120, 60, .20) 0%, rgba(255, 120, 60, .07) 45%, rgba(255, 120, 60, 0) 100%);
    --on-wall: #fff1e6;
    --on-wall-2: rgba(255, 241, 230, .74);
    --bar-pill: rgba(255, 255, 255, .22);
    --relaxed: #30d158;
    --busy: #ffd60a;
    --near: #ff9f0a;
    --throttling: #ff453a;
    --shadow-window: 0 0 0 .5px rgba(255, 255, 255, .16), 0 24px 60px -12px rgba(0, 0, 0, .7);
    --shadow-module: 0 0 0 .5px rgba(255, 255, 255, .10), 0 12px 30px -14px rgba(0, 0, 0, .8);
    --shadow-field: 0 0 0 .5px rgba(255, 255, 255, .16), 0 12px 32px -16px rgba(0, 0, 0, .8);
    --shadow-card: 0 0 0 .5px rgba(255, 255, 255, .12), 0 24px 60px -28px rgba(0, 0, 0, .9);
  }
}
