/* Fluid type and space scales, in the Utopia manner (https://utopia.fyi): every size is a clamp()
   that grows with the viewport between a 360px phone and a 1240px laptop, so there are no
   breakpoints for type or spacing anywhere in the app.

   For a one-off size, scale a token with calc() (`calc(var(--space-l) * 1.5)`) before adding a new
   clamp here. A new token belongs in this file only once several places need it. */

/* TYPE SCALE
   Body text runs 17px → 19px: this is an app for reading and writing in, so its base size is a
   book's and not an interface's. Each step up multiplies by 1.2 on a phone and 1.25 on a laptop.
   @link https://utopia.fyi/type/calculator?c=360,17,1.2,1240,19,1.25,6,2 */

:root {
  /* Step 6: 50.7617px → 72.4792px */
  --step-6: clamp(3.1726rem, 2.6173rem + 2.4679vw, 4.53rem);
  /* Step 5: 42.3014px → 57.9834px */
  --step-5: clamp(2.6438rem, 2.2429rem + 1.782vw, 3.624rem);
  /* Step 4: 35.2512px → 46.3867px */
  --step-4: clamp(2.2032rem, 1.9185rem + 1.2654vw, 2.8992rem);
  /* Step 3: 29.376px → 37.1094px */
  --step-3: clamp(1.836rem, 1.6383rem + 0.8788vw, 2.3193rem);
  /* Step 2: 24.48px → 29.6875px */
  --step-2: clamp(1.53rem, 1.3969rem + 0.5918vw, 1.8555rem);
  /* Step 1: 20.4px → 23.75px */
  --step-1: clamp(1.275rem, 1.1893rem + 0.3807vw, 1.4844rem);
  /* Step 0: 17px → 19px */
  --step-0: clamp(1.0625rem, 1.0114rem + 0.2273vw, 1.1875rem);
  /* Step -1: 14.1667px → 15.2px */
  --step--1: clamp(0.8854rem, 0.859rem + 0.1174vw, 0.95rem);
  /* Step -2: 11.8056px → 12.16px */
  --step--2: clamp(0.7378rem, 0.7288rem + 0.0403vw, 0.76rem);
}

/* SPACE SCALE
   The same scale `345` uses, on an 18px → 20px base.
   @link https://utopia.fyi/space/calculator?c=360,18,1.2,1240,20,1.25,5,2,768&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */

:root {
  /* Space 3xs: 5px → 5px */
  --space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem);
  /* Space 2xs: 9px → 10px */
  --space-2xs: clamp(0.5625rem, 0.5369rem + 0.1136vw, 0.625rem);
  /* Space xs: 14px → 15px */
  --space-xs: clamp(0.875rem, 0.8494rem + 0.1136vw, 0.9375rem);
  /* Space s: 18px → 20px */
  --space-s: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem);
  /* Space m: 27px → 30px */
  --space-m: clamp(1.6875rem, 1.6108rem + 0.3409vw, 1.875rem);
  /* Space l: 36px → 40px */
  --space-l: clamp(2.25rem, 2.1477rem + 0.4545vw, 2.5rem);
  /* Space xl: 54px → 60px */
  --space-xl: clamp(3.375rem, 3.2216rem + 0.6818vw, 3.75rem);
  /* Space 2xl: 72px → 80px */
  --space-2xl: clamp(4.5rem, 4.2955rem + 0.9091vw, 5rem);
  /* Space 3xl: 108px → 120px */
  --space-3xl: clamp(6.75rem, 6.4432rem + 1.3636vw, 7.5rem);

  /* One-up pairs */
  /* Space 3xs-2xs: 5px → 10px */
  --space-3xs-2xs: clamp(0.3125rem, 0.1847rem + 0.5682vw, 0.625rem);
  /* Space 2xs-xs: 9px → 15px */
  --space-2xs-xs: clamp(0.5625rem, 0.4091rem + 0.6818vw, 0.9375rem);
  /* Space xs-s: 14px → 20px */
  --space-xs-s: clamp(0.875rem, 0.7216rem + 0.6818vw, 1.25rem);
  /* Space s-m: 18px → 30px */
  --space-s-m: clamp(1.125rem, 0.8182rem + 1.3636vw, 1.875rem);
  /* Space m-l: 27px → 40px */
  --space-m-l: clamp(1.6875rem, 1.3551rem + 1.4773vw, 2.5rem);
  /* Space l-xl: 36px → 60px */
  --space-l-xl: clamp(2.25rem, 1.6364rem + 2.7273vw, 3.75rem);
  /* Space xl-2xl: 54px → 80px */
  --space-xl-2xl: clamp(3.375rem, 2.7102rem + 2.9545vw, 5rem);
  /* Space 2xl-3xl: 72px → 120px */
  --space-2xl-3xl: clamp(4.5rem, 3.2727rem + 5.4545vw, 7.5rem);

  /* Custom pairs */
  /* Space s-l: 18px → 40px */
  --space-s-l: clamp(1.125rem, 0.5625rem + 2.5vw, 2.5rem);
  /* Space s-xl: 18px → 60px */
  --space-s-xl: clamp(1.125rem, 0.0511rem + 4.7727vw, 3.75rem);
  /* Space s-2xl: 18px → 80px */
  --space-s-2xl: clamp(1.125rem, -0.4602rem + 7.0455vw, 5rem);
  /* Space l-2xl: 36px → 80px */
  --space-l-2xl: clamp(2.25rem, 1.125rem + 5vw, 5rem);
}
