/* Design tokens. Every colour, size, radius, shadow and duration in the app is named here; no other file holds a raw value. */
:root {
  /* FROZEN. The sign-up, privacy and terms pages and print output read these names. Never rename one or change a value; app screens do not use them. */
  --terra: #1F6DB0;
  --terra-dark: #17568C;
  --terra-light: #E4EFF8;
  --terra-xlight: #F1F7FC;
  --cream: #FAF6F0;
  --espresso: #2C1A0E;
  --espresso-light: #5C3D2A;
  --warm-gray: #6B4F40;
  --border: #A9C9E6;
  --danger: #A33A22;
  --fs-3: 18px;
  --border-light: #CFE0F1;

  /* Colour: the frame (blue). Press, navigate, "you are here". */
  --color-frame: #1F6DB0;
  --color-frame-deep: #17568C;
  --color-frame-night: #0F3D63;
  --color-frame-wash: #DCE9F6;
  --color-frame-line: #9DBEDD;
  --color-on-frame: #FFFFFF;
  --color-on-night-soft: #C9DDF0;
  --color-on-frame-line: rgba(255, 255, 255, 0.6);   /* a white outline, or a hover, on a blue ground */
  --color-on-frame-press: rgba(255, 255, 255, 0.16);  /* a pressed control on a blue ground */

  /* Colour: the table and what lies on it. */
  --color-paper: #FBF8F2;
  --color-card: #FFFFFF;
  --color-edge: #CDBFA6;
  --color-lip: #B3A387;
  --color-stone: #857A6D;
  --color-rule: #BFD3E8;
  --color-field-line: #5580AE;

  /* Colour: text. */
  --color-ink: #26211C;
  --color-ink-soft: #564C42;

  /* Colour: money only. */
  --color-tag: #EED084;
  --color-tag-pale: #F8E8B8;
  --color-tag-edge: #A9822A;

  /* Colour: the marker. A fill, never text. */
  --color-pepper: #F2C230;

  /* Colour: meaning. */
  --color-ok: #2F6F34;
  --color-ok-wash: #D9EBD3;
  --color-ok-wash-hover: color-mix(in srgb, var(--color-ok-wash) 92%, var(--color-ok));  /* the good button under the pointer */
  --color-ok-lip: color-mix(in srgb, var(--color-ok) 30%, var(--color-ok-wash));          /* the good button's lip */
  --color-warn: #8A5A00;
  --color-danger: #A33A22;
  --color-off: #D8D6D2;
  --color-off-ink: #56524D;
  --color-off-line: #9E9992;
  --color-scrim: rgba(12, 38, 64, 0.55);

  /* Colour: recipe type dots. Decoration beside the word; the word carries the type. */
  --color-type-breakfast: #D9A21B;
  --color-type-entree: #2F6F34;
  --color-type-side: #1F6DB0;
  --color-type-dressing: #8C8A2B;
  --color-type-soup: #A33A22;
  --color-type-bread: #9A6B33;
  --color-type-dessert: #6E3B2E;
  --color-type-starter: #0F3D63;
  --color-type-other: #8A8178;

  /* Type: families. The display face has one weight: always 400, never synthesised. */
  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Kalam", "Source Sans 3", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Type: sizes. Public screens never go below --text-md for sentences or --text-sm for labels. */
  --text-2xs: 0.7rem;     /* 11.2px: a number in a small step disc (staff pack steps) */
  --text-xs: 0.875rem;   /* 14px: meta inside .density-deep (Culinary tables) only */
  --text-note: 0.88rem;   /* 14.1px: a step line or note in staff recipe text; a long staff list in a one-line phone field */
  --text-field-tight: 0.9rem;    /* 14.4px: a one-line staff sample field at phone width */
  --text-field-dense: 0.9375rem; /* 15px: editor row fields on a phone-width screen with a mouse */
  --text-sm: 1rem;       /* 16px: staff body; public labels, dates, badges */
  --text-md: 1.125rem;   /* 18px: public body, buttons, fields */
  --text-lg: 1.25rem;    /* 20px: lead text, list names, long reading */
  --text-title: 1.375rem; /* 22px: display-face titles of list sections and cards in a list */
  --text-glyph-sm: 1.375rem;     /* 22px: a glyph in an icon slot (icon button, account menu) */
  --text-xl: 1.5rem;     /* 24px: card and dialog titles, section heads */
  --text-money-sm: min(1.5rem, 8vw);    /* 24px: figure in a row. Each money size is capped by the screen width so a figure fits at 200% zoom and large text */
  --text-title-lg: 1.625rem;     /* 26px: a recipe sheet's title on desktop */
  --text-glyph: 1.75rem;  /* 28px: one glyph or a short code that must read at a glance */
  --text-2xl: 1.875rem;  /* 30px: page title on phones, section heads on desktop */
  --text-money-md: min(1.875rem, 10vw);  /* 30px: figure on a card tag */
  --text-glyph-lg: 2rem;         /* 32px: the close glyph in a dialog head */
  --text-3xl: 2.5rem;    /* 40px: page title on desktop, hero on phones (34px by clamp) */
  --text-title-xl: 2.75rem;       /* 44px: the Partners page title on desktop; the glyph in an xl disc */
  --text-money-lg: min(2.75rem, 14vw);   /* 44px: figure in a dialog or a sub-total */
  --text-4xl: 3.25rem;   /* 52px: Home hero on desktop */
  --text-money-xl: min(4.5rem, 17vw);    /* 72px: the one total of a screen */
  --text-money-xl-phone: clamp(min(3.75rem, 17vw), 17vw, 4.5rem);  /* the one total of a screen on phones */
  --text-money-2xl: clamp(min(4.5rem, 20vw), 20vw, 6rem);  /* 78px at 390, 96px on desktop: "Saved so far" on Cost Savings only */
  --text-code: 0.9em;            /* inline code, against the words around it */
  --text-chevron: 1.45em;        /* the Back chevron, against its words, so it reads as strongly */

  /* Type: weights and line heights. */
  --weight-regular: 400;
  --weight-strong: 600;
  --weight-bold: 700;
  --leading-tight: 1.15;  /* display type, money */
  --leading-snug: 1.3;    /* titles, buttons, labels */
  --leading-body: 1.5;    /* sentences */
  --leading-loose: 1.65;  /* long reading (Learn note) */

  /* Space: 4px base. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Size: controls and page. */
  --control-sm: 44px;   /* staff density */
  --control-md: 48px;   /* every public control: the public minimum */
  --control-lg: 56px;   /* the one main action of a screen or dialog; list rows */
  --control-pad: 20px;  /* a button's side padding */
  --field-pad: 14px;    /* a text field's side padding; also the tab's */
  --page: 960px;
  --page-wide: 1120px;
  --page-staff: 1200px;
  --measure: 66ch;
  --gutter: 16px;
  --photo-band: 168px;      /* phone: height of a section photo; never under 140px clear of the title tab */
  --photo-tab-rise: 28px;   /* phone: how far the title tab rises into the photo */
  --photo-side-w: 420px;    /* desktop: photo beside the page title */
  --photo-side-h: 220px;

  /* Shape. */
  --radius-check: 8px;
  --radius-mark: 4px;    /* a small inline mark: inline code */
  --radius-tick: 6px;    /* the box of a tick in a chip or tile */
  --radius-marker: 7px 4px 6px 4px;  /* the uneven ends of a marker stroke */
  --radius-control: 12px;
  --radius-tab: 14px;
  --radius-card: 16px;
  --radius-sheet: 22px;
  --radius-pill: 999px;

  /* Elevation: thickness, not glow. The lip is a solid line, the same under a card as under a button. */
  --lip: 3px;
  --money-outline: 2px;  /* the outline of an "at least" price tag */
  --hairline: 1px;      /* a rule drawn as a shadow, so it takes no room */
  --accent-bar: 4px;    /* the frame-coloured bar on the edge of an open or current item */
  --check-ring: 5px;    /* the white ring inside a chosen radio dot */
  --shadow-chosen: inset 0 -4px 0 var(--color-frame);  /* the bar inside the foot of a chosen option */
  --shadow-card: 0 var(--lip) 0 var(--color-lip);
  --shadow-raised: 0 var(--lip) 0 var(--color-lip), 0 12px 24px -14px rgba(38, 33, 28, 0.35);
  --shadow-overlay: 0 24px 64px -16px rgba(12, 38, 64, 0.5);

  /* Motion. */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Layers, bottom to top. Values are the ones scripts and tests already rely on. */
  --z-sticky: 5;
  --z-header: 10;
  --z-dialog: 1000;
  --z-drawer-scrim: 1100;
  --z-drawer: 1200;
  --z-menu: 9000;
  --z-welcome: 9998;
  --z-install: 9999;
  --z-signin: 10000;
  --z-confirm: 10001;   /* the in-app confirm: over whatever dialog asked the question */
  --z-skip: 20000;
  --z-toast: 2147483000;
  --z-system: 2147483646;
}

@media (min-width: 641px) {
  :root { --gutter: 24px; }
}
