/**
 * The Food Gene — tokens.css
 * Version: 3.4 (Site V2) · Teal Kitchen
 * Owner: UI Foundation. Page agents read these tokens; they do not add colours.
 *
 * BR-002 lists the Teal Kitchen palette by name and hex, and these are those
 * values. The Cotswold Botanical (v3.0–v3.3) and V1 colours are retired: none
 * of them may appear in web/, and CI fails the build if one does (BR-002.2).
 *
 * NFR-008: every colour, space, radius and type decision is a custom property
 * declared here, and nowhere else carries a raw colour code. The existing role
 * names (--accent-juniper, --bg-surface-warm and so on) stay, as NFR-008
 * allows, with their values re-pointed to Teal Kitchen.
 *
 * BR-012 decides where each colour may be used, and the comments say so.
 * The /colours-and-type/ page (BR-013) reads this file: a token's trailing
 * comment is shown there as "Name — use", so keep each one on its own line.
 */

/* ── Fonts (BR-003, NFR-003) ────────────────────────────────────────────────
   Five self-hosted Latin-subset WOFF2 files and nothing else. font-display:
   swap shows the fallback straight away rather than invisible text; the
   fallbacks in the --font-* tokens below are chosen to be close in width so
   the swap does not reflow the page much. Only Rubik 800 is preloaded
   (layouts/site.php) — it sets every heading, so it is the font a reader
   notices arriving late. */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/rubik-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/barlow-condensed-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/outfit-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/outfit-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jost-500.woff2') format('woff2');
}

:root {
  /* ── Canvas and surfaces (BR-002, BR-014) ──────────────────────────────── */
  --bg-primary:         #F4F9F9;  /* Page — the pale canvas either side of the white column */
  --bg-surface:         #FFFFFF;  /* White — content column, header bar, cards, form fields */
  --bg-surface-subtle:  #F2F6F7;  /* Panel — chips, pale buttons, footer, recipe details */
  --bg-surface-warm:    #E8EEF0;  /* Wash — missing-photo placeholder and divider wash */
  --bg-placeholder:     #E8EEF0;  /* Placeholder — BR-011, the one missing-photo background */
  --bg-panel-deep:      #23475A;  /* Deep teal panel — newsletter, labels on photos */
  --bg-accent-soft:     #E1EFEF;  /* Tint — tinted sections, featured tips, hover on pale pills */
  --bg-sage-soft:       #E6F1EF;  /* Diet tint — dietary badges */
  --bg-surface-dark:    #1E3B49;  /* Photo overlay — scrims over photographs, text on mint */

  /* ── Accent (BR-002, BR-012) ───────────────────────────────────────────── */
  --accent-juniper:       #2F6E77;  /* Teal — the main accent: headings, links, buttons, active states */
  --accent-juniper-hover: #245860;  /* Teal hover — hover and pressed state of the main accent */
  --accent-sage:          #3A777F;  /* Supporting teal — quiet supporting marks, never small text on tints */
  --accent-sage-strong:   #2A5F67;  /* Label teal — BR-012 small labels and badges on tinted backgrounds */
  --accent-mint:          #4CC2AE;  /* Mint — wordmark, button fill with dark text, text on deep teal only */

  /* ── Text (BR-002, BR-012) ─────────────────────────────────────────────── */
  --text-primary:       #23475A;  /* Body text — paragraphs and body copy, 9.9:1 on white */
  --text-secondary:     #4A6573;  /* Secondary text — meta lines and captions, 6.2:1 on white */
  --text-muted:         #587080;  /* Muted text — icons and small print; 4.4:1 on the wash, so not there */
  --text-on-dark:       #FFFFFF;  /* Text on dark — on the deep-teal panel and photo scrims */
  --text-on-dark-muted: #C3D5DC;  /* Muted on dark — small print on the deep-teal panel, 6.5:1 */
  --text-inverse:       #FFFFFF;  /* On teal — text and icons on the teal accent, 5.8:1 */
  --text-on-mint:       #1E3B49;  /* On mint — the dark text a mint button carries, 5.4:1 */

  /* ── Lines (BR-002) ────────────────────────────────────────────────────── */
  --border-subtle: #E8EEF0;  /* Hairline — rules and dividers */
  --border-medium: #C9D7DC;  /* Line — input borders, outlined icon buttons */
  --border-sand:   #D3DEE2;  /* Footer line — rules inside the footer panel */
  --border-strong: #23475A;  /* Strong line — editorial rules and print borders */

  /* ── Translucent layers (BR-002 values with alpha) ─────────────────────── */
  /* Scrims are the photo-overlay colour #1E3B49 at reduced opacity; the
     on-dark layers are white. They are the only rgba() values on the site. */
  --scrim-soft:   rgba(30, 59, 73, 0.35);  /* Light scrim — play buttons over video stills */
  --scrim-strong: rgba(30, 59, 73, 0.72);  /* Strong scrim — behind white text on photos */
  --scrim-clear:  rgba(30, 59, 73, 0);     /* Clear scrim — the transparent end of a gradient */
  --backdrop:     rgba(30, 59, 73, 0.45);  /* Backdrop — behind the slide-out menu */
  --line-on-dark: rgba(255, 255, 255, 0.8);   /* On-dark line — outline of a ghost pill on photos */
  --wash-on-dark: rgba(255, 255, 255, 0.14);  /* On-dark wash — hover of a ghost pill on photos */
  --veil-light:   rgba(255, 255, 255, 0.92);  /* Light veil — icon buttons sitting on photos */

  /* ── Type (BR-003, NFR-003) ────────────────────────────────────────────── */
  --font-display: 'Rubik', 'Arial Black', system-ui, sans-serif;  /* Rubik 800 caps — page titles and section headings */
  --font-title:   'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;  /* Barlow Condensed 600 caps — card titles and kickers */
  --font-body:    'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;  /* Outfit 400 and 600 — body text, never in capitals */
  --font-label:   'Jost', 'Outfit', system-ui, sans-serif;  /* Jost 500 caps — navigation, labels, buttons, breadcrumbs */
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* BR-003 sizes. Headings scale down on phones so a long recipe title still
     wraps to three lines or fewer at 375px (BR-003.2). */
  --size-h1:     clamp(2.25rem, 1.6rem + 2.6vw, 3.4rem);   /* page titles, 54px desktop */
  --size-h2:     clamp(1.9rem, 1.45rem + 1.9vw, 2.85rem);  /* section headings, 46px desktop */
  --size-h3:     clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);   /* sub-headings, 36px desktop */
  --size-card:   clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);   /* card titles, 24px desktop */
  --size-kicker: 1.125rem;   /* kickers, 18px */
  --size-label:  0.875rem;   /* navigation, labels, buttons, breadcrumbs, 14px */
  --size-badge:  0.75rem;    /* badges, 12px */

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1rem;       /* 16px — the body size BR-003 sets */
  --text-lg:   1.125rem;   /* 18px — intros and summaries */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  1.875rem;   /* 30px */
  --text-3xl:  2.25rem;    /* 36px */
  --text-4xl:  2.875rem;   /* 46px */
  --text-hero: 3.4rem;     /* 54px */

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semi:   600;
  --weight-heavy:  800;

  --leading-display: 1;      /* caps headings set solid */
  --leading-tight:   1.1;
  --leading-snug:    1.3;
  --leading-normal:  1.6;    /* body, as BR-003 sets */

  --tracking-display: 0.02em;  /* Rubik caps */
  --tracking-title:   0.04em;  /* Barlow Condensed caps */
  --tracking-wide:    0.08em;  /* Jost labels — BR-003 asks for 0.08 to 0.1em */

  /* ── Space ─────────────────────────────────────────────────────────────── */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2rem;
  --space-xl:  3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* The side gutter inside the white column. 16px on phones is BR-014's
     number; the column gets 24px from 900px up (see main.css). */
  --gutter: 1rem;
  --sheet-pad: 1rem;

  /* ── Layout (BR-014) ───────────────────────────────────────────────────── */
  --width-sheet:   1000px;  /* the white content column */
  --width-page:    1000px;  /* legacy name for the same column */
  --width-reading: 720px;   /* the reading column sits inside Medium (800px) */
  --width-narrow:  560px;

  /* MED-008 display sizes, so CSS and PHP cannot drift apart */
  --media-small:  400px;
  --media-medium: 800px;
  --media-large:  1280px;

  /* ── Shape (BR-004) ───────────────────────────────────────────────────── */
  /* BR-004.1: corner radii come only from these. The header's 48px underside
     is two --radius-md, written as a calc so it stays tied to the scale. */
  --radius-sm:   12px;    /* small elements — icon buttons, inputs, swatches */
  --radius-md:   24px;    /* images and cards */
  --radius-lg:   32px;    /* large panels — hero, feature, newsletter */
  --radius-pill: 999px;   /* buttons, badges, chips and round icon buttons */
  --radius-header: calc(2 * var(--radius-md));  /* header underside, 48px desktop */

  /* ── Elevation ────────────────────────────────────────────────────────── */
  /* Tinted with the body-text teal rather than black, so a shadow reads as
     shade on a pale teal page instead of a grey smudge. */
  --shadow-sm: 0 1px 2px rgba(35, 71, 90, 0.08);
  --shadow-md: 0 0 24px rgba(35, 71, 90, 0.08);
  --shadow-lg: 0 8px 28px rgba(35, 71, 90, 0.14);

  /* ── Motion ───────────────────────────────────────────────────────────── */
  --transition-fast:   120ms ease;
  --transition-smooth: 220ms ease;

  /* ── Controls (NFR-004, NAV-007) ──────────────────────────────────────── */
  /* 44px is the WCAG target size NFR-004 and NAV-007 both require. Holding it
     as a token means no control can quietly be built smaller. */
  --tap-target: 44px;
  --focus-ring: 2px solid var(--accent-juniper);
  --focus-ring-on-dark: 2px solid var(--text-on-dark);
  --focus-offset: 2px;

  --z-header: 100;
  --z-panel:  200;
  --z-modal:  300;

  /* ── Icons ────────────────────────────────────────────────────────────── */
  /* The round-arrow pill's arrow (BR-004), used as a CSS mask: the mask reads
     only the shape, and the colour comes from a token, so no colour lives in
     the image. */
  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

/**
 * FUT-013 (Sprint 2): a dark theme following the reader's device setting.
 * Sprint 1 ships the light theme only, so there is deliberately no
 * prefers-color-scheme block here yet — a partial dark theme is worse than
 * none, and BR-012's contrast rules would need re-deriving for dark surfaces
 * rather than assumed to carry over.
 */
