/*
  Asili Coffee, direction A (c-a-cobalt-serif): the page stylesheet.
  The :root block below is the only place a colour, font, type size or spacing value is defined, so it can move
  into asili-tokens.css. Its first part is docs/palette-and-type.md section 6, verbatim; the rest is what this
  direction adds (spacing, motion, component sizes) and how Taste's system tokens map onto the palette.
*/
:root {
  /* docs/palette-and-type.md, section 6 (verbatim) */
  --asili-cobalt: #3A39B8;
  --asili-cobalt-deep: #2B2793;
  --asili-ink: #131736;
  --asili-ink-muted: #535974;
  --asili-porcelain: #F5F6FB;
  --asili-white: #FFFFFF;
  --asili-mist: #E4E9FD;
  --asili-line: #D7DAE6;
  --asili-line-strong: #7A7F96;
  --asili-on-cobalt-muted: #C6CFF6;
  --asili-cherry: #D22E2C;
  --asili-leaf: #267543;

  --asili-surface-page: var(--asili-porcelain);
  --asili-surface-raised: var(--asili-white);
  --asili-surface-selected: var(--asili-mist);
  --asili-surface-brand: var(--asili-cobalt);
  --asili-text: var(--asili-ink);
  --asili-text-muted: var(--asili-ink-muted);
  --asili-text-heading: var(--asili-cobalt);
  --asili-text-on-brand: var(--asili-white);
  --asili-text-on-brand-muted: var(--asili-on-cobalt-muted);
  --asili-action: var(--asili-cobalt);
  --asili-action-hover: var(--asili-cobalt-deep);
  --asili-focus: var(--asili-cobalt);
  --asili-border: var(--asili-line);
  --asili-border-control: var(--asili-line-strong);
  --asili-accent: var(--asili-cherry);
  --asili-error: var(--asili-cherry);
  --asili-success: var(--asili-leaf);

  --asili-font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --asili-font-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --asili-size-hero: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);
  --asili-size-page-title: clamp(1.875rem, 1.4rem + 1.9vw, 3rem);
  --asili-size-section-title: 1.5rem;
  --asili-size-item-title: 1.125rem;
  --asili-size-body: 1.0625rem;
  --asili-size-small: 0.9375rem;
  --asili-size-label: 0.8125rem;

  /* added by direction A: the palette's type scale gives the button its own row (16px) */
  --asili-size-button: 1rem;
  --asili-lh-hero: 1.02;
  --asili-lh-section-title: 1.2;
  --asili-lh-item-title: 1.3;
  --asili-lh-body: 1.55;
  --asili-lh-body-on-brand: 1.6;
  --asili-lh-label: 1.2;
  --asili-lh-small: 1.45;
  --asili-track-hero: -0.015em;
  --asili-track-label: 0.08em;
  --asili-track-button: 0.01em;
  --asili-track-on-brand: 0.01em;
  --asili-weight-strong: 600;

  /* spacing (the 4/8 steps this direction uses) */
  --asili-space-1: 0.25rem;
  --asili-space-2: 0.5rem;
  --asili-space-3: 0.75rem;
  --asili-space-4: 1rem;
  --asili-space-5: 1.5rem;
  --asili-space-6: 2rem;
  --asili-space-7: 3rem;
  --asili-space-8: 4rem;

  /* component sizes */
  --asili-logo-nav: 7.5rem;            /* 120 x 44: the logo frame's own tap height */
  --asili-ring: 2px;                   /* focus ring and its offset (palette rule 11) */
  --asili-tap: 2.75rem;                /* 44px targets */
  --asili-meter-w: 4rem;
  --asili-meter-h: 0.375rem;
  --asili-roast-tile-h: clamp(6rem, 100svh - 41.5rem, 13rem);   /* shorter on a short laptop screen (1024x768), so the section stays one screen */
  --asili-roast-tile-h-phone: 12.5rem;
  --asili-roast-thumb: 1.75rem;
  --asili-roast-track: 2px;
  --asili-chip-h: 2.75rem;
  --asili-chip-border: 2px;
  --asili-underline: 2px;
  --asili-underline-offset: 4px;
  --asili-picture-min: 12.5rem;       /* the least a picture that fills what the words leave may shrink to */
  --asili-centre-col: calc(50% - var(--gutter));   /* A's centred column from 1280 up: under half the container */
  --asili-picture-min-faq: 8rem;      /* the FAQ's picture under its answers from 1024 up (1280x800, French at 1024x768) */
  --asili-card-pic-min: 5rem;         /* the least a range card's picture shrinks to from 1280 up, on a short screen */
  --asili-coffee-head: 9rem;          /* the range's heading row, for sizing three cards into one tablet screen */
  --asili-coffee-pic-max: 22rem;      /* the picture beside a card's words, 640-1279 */

  /* motion: slow and soft (direction A) */
  --asili-ease: cubic-bezier(.2, .7, .2, 1);
  --asili-dur-ground: 700ms;           /* the roast slider's ground (this direction's own transitions run 600-800 ms) */
  --asili-text-flip: 120ms;            /* text changes colour early in the ground's ease, so it never sits long on a near match */

  /* roast levels: five grounds from the palette (porcelain, mist, on-cobalt-muted, cobalt, cobalt deep) */
  --asili-roast-1: var(--asili-porcelain);
  --asili-roast-2: var(--asili-mist);
  --asili-roast-3: var(--asili-on-cobalt-muted);
  --asili-roast-4: var(--asili-cobalt);
  --asili-roast-5: var(--asili-cobalt-deep);

  /* Taste's system tokens, set from the palette (the palette outranks the dealt pairing and the printed tints) */
  --p-accent-ink: var(--asili-text-on-brand);
  --p-action-ink: var(--asili-text-on-brand);
  --font-display: var(--asili-font-display);
  --font-text: var(--asili-font-text);
  --display-weight: 400;
  --display-tracking: 0;
  --display-tracking-xl: var(--asili-track-hero);
  --ly-h1-xl: var(--asili-size-hero);
  --ly-lead: var(--asili-size-body);
  --t-h2: var(--asili-size-section-title);
  --t-h3: var(--asili-size-item-title);
  --t-card: var(--asili-size-item-title);
  --t-lead: var(--asili-size-body);
  --t-body: var(--asili-size-body);
  --t-small: var(--asili-size-small);
  --t-label: var(--asili-size-label);
  --line: var(--asili-line);
  --line-strong: var(--asili-line-strong);
  --ground-bg: var(--asili-mist);
  --ground-surface: var(--asili-white);
  --ground-ink: var(--asili-ink);
  --ground-muted: var(--asili-ink-muted);
  --ground-accent: var(--asili-cobalt);
  --heading: var(--asili-text-heading);
}

/* ---------------------------------------------------------------- browser details (palette rule 11) */
::selection { background: var(--asili-cobalt); color: var(--asili-white); }
html { caret-color: var(--asili-cobalt); }
:focus-visible { outline: var(--asili-ring) solid var(--asili-focus); outline-offset: var(--asili-ring); }
.ground-brand :focus-visible, [data-roast="4"] :focus-visible, [data-roast="5"] :focus-visible { outline-color: var(--asili-white); }
/* a field's focus is the palette's ring too: the kit's motion layer swaps the outline for a soft 4px halo, which is a
   glow (palette rule 9), so the halo goes and the 2px outline 2px off the field comes back (rule 11) */
html:not([data-motion="off"]) .field :is(input, select, textarea):focus,
.field :is(input, select, textarea):focus { box-shadow: none; }
html:not([data-motion="off"]) .field :is(input, select, textarea):focus-visible,
.field :is(input, select, textarea):focus-visible { outline: var(--asili-ring) solid var(--asili-focus); outline-offset: var(--asili-ring); box-shadow: none; }
/* the primary's hover is the palette's cobalt deep (the kit's layers mix their own tint) */
.btn--primary:hover,
html:not([data-motion="off"]) .btn--primary:hover { background: var(--asili-action-hover); }
/* the kit's guard outlines a picture whose alt says "Placeholder" in red dashes. These placeholders are mandated by
   prototypes-combined/AGENTS.md (photographs only as PLACEHOLDER files, honest alt text) and the sample-label waiver
   in .taste-skill/waivers.json records it, so the outline is taken off our PLACEHOLDER files only (a picture that
   really fails to load keeps the kit's red flag); the attribute and the kit's rule stay as they are. */
img[data-placeholder][src*="PLACEHOLDER"] { outline: none; }

/* ---------------------------------------------------------------- type (palette section 5) */
body { font-size: var(--asili-size-body); line-height: var(--asili-lh-body); }
h1, h2 { font-family: var(--asili-font-display); font-weight: 400; font-style: normal; font-synthesis: none; color: var(--heading); }
.hero h1 { line-height: var(--asili-lh-hero); letter-spacing: var(--asili-track-hero); }
h2 { font-size: var(--asili-size-section-title); line-height: var(--asili-lh-section-title); letter-spacing: 0; }
h2 .muted { color: var(--muted); }
h3, .card > h3 { font-family: var(--asili-font-text); font-weight: var(--asili-weight-strong); font-size: var(--asili-size-item-title);
  line-height: var(--asili-lh-item-title); letter-spacing: 0; color: var(--ink); }
p { max-width: 65ch; }
.t-label { font-size: var(--asili-size-label); font-weight: var(--asili-weight-strong); letter-spacing: var(--asili-track-label); text-transform: uppercase; }
.t-small { font-size: var(--asili-size-small); line-height: var(--asili-lh-small); }
.section-head p { font-size: var(--asili-size-body); }
.btn { font-weight: var(--asili-weight-strong); font-size: var(--asili-size-button); letter-spacing: var(--asili-track-button); }
@media (min-width: 640px) { .nav__actions .btn { font-size: var(--asili-size-button); } }

/* ---------------------------------------------------------------- the logo (../_shared/asili-logo.css frames it) */
.nav .asili-logo { --logo-w: var(--asili-logo-nav); --logo-radius: var(--r-sm); }

/* ---------------------------------------------------------------- language switch (../_shared/asili-lang-switch.js) */
asili-lang-switch { display: inline-flex; }
asili-lang-switch [role="group"] { display: inline-flex; gap: var(--asili-space-1); }
asili-lang-switch button {
  min-width: var(--asili-tap); height: var(--asili-tap); padding: 0 var(--asili-space-2); border-radius: var(--r-btn);
  border: 1px solid var(--asili-border-control); background: transparent; color: var(--ink);
  font: var(--asili-weight-strong) var(--asili-size-small)/1 var(--asili-font-text); letter-spacing: var(--asili-track-button); cursor: pointer;
  /* a hover answer belongs to the kit's hover layer, so it keeps the layer's time */
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
asili-lang-switch button:hover { background: var(--asili-mist); }
asili-lang-switch button[aria-pressed="true"] { background: var(--asili-cobalt); border-color: var(--asili-cobalt); color: var(--asili-white);
  text-decoration: underline; text-underline-offset: var(--asili-underline-offset); }
asili-lang-switch button[aria-pressed="true"]:hover { background: var(--asili-cobalt-deep); border-color: var(--asili-cobalt-deep); }
.nav__actions asili-lang-switch button { height: var(--btn-h); }
@media (max-width: 1023px) { .nav.is-open .nav__actions asili-lang-switch { justify-content: center; } }

/* the phone sheet's icon (asili-nav-sheet.js opens it from file://; system.js over http) */
.nav__toggle .nav__icon-close { display: none; }
.nav.is-open .nav__toggle .nav__icon-open { display: none; }
.nav.is-open .nav__toggle .nav__icon-close { display: block; }
asili-nav-sheet { display: none; }

/* ---------------------------------------------------------------- hero (hero-photo): the words in a solid porcelain box */
.hero--photo .hero__text { --heading: var(--asili-text-heading); }
.hero--photo .hero__lead { color: var(--asili-ink); max-width: 44ch; }

/* ---------------------------------------------------------------- the range: three calm cards (the product photograph on its white tile, the words on the page) */
.coffee__cards { align-items: stretch; }
.coffee-card { gap: 0; }
.coffee-card > .panel--top { aspect-ratio: 3 / 2; background: var(--asili-surface-raised); }
.coffee-card__meta { margin-top: var(--asili-space-2); font-size: var(--asili-size-small); color: var(--asili-ink-muted); }
.coffee-card__meta > span + span::before { content: "\00B7"; margin: 0 var(--asili-space-2); color: var(--asili-ink-muted); }
.coffee-card > p.coffee-card__notes { margin-top: var(--asili-space-2); font-size: var(--asili-size-body); color: var(--asili-ink); }
/* the scale's four columns a quarter each, wider where a label needs it (the French Torréfaction), so no label breaks */
.coffee-card__scales { margin-top: var(--asili-space-4); width: 100%; border-collapse: collapse; table-layout: auto; font-size: var(--asili-size-small); }
.coffee-card__scales th { width: 25%; padding: 0 var(--asili-space-2) var(--asili-space-1) 0; text-align: left; font-weight: 400; color: var(--asili-ink-muted);
  vertical-align: bottom; hyphens: auto; }
.coffee-card__scales td { padding: 0 var(--asili-space-2) 0 0; color: var(--asili-ink); font-variant-numeric: tabular-nums; vertical-align: top; white-space: nowrap; }
.coffee-card__scales .meter { display: block; margin: var(--asili-space-1) 0 var(--asili-space-1); }
.meter { position: relative; width: min(100%, var(--asili-meter-w)); height: var(--asili-meter-h); border: 1px solid var(--asili-border-control); border-radius: var(--asili-meter-h); overflow: hidden; }
.meter::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 20%); background: var(--asili-cobalt); }
/* 1280 and up: three across in one row (the kit sets panel cards two-up below 1280) */
@media (min-width: 1280px) { #coffee .coffee__cards > .coffee-card { grid-column: auto / span 4; } }
/* 640-1279: the cards stacked, the picture beside the words; the section takes two screens there */
@media (min-width: 640px) and (max-width: 1279px) {
  #coffee { --h: 2; }
  #coffee .coffee__cards > .coffee-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, min(42%, var(--asili-coffee-pic-max))) minmax(0, 1fr);
    grid-template-rows: repeat(4, auto) minmax(0, 1fr); column-gap: var(--asili-space-5); align-content: start; }
  .coffee-card > .panel--top { grid-column: 1; grid-row: 1 / span 5; aspect-ratio: 1 / 1; align-self: start; margin: 0; }
  .coffee-card > :not(.panel) { grid-column: 2; }
}
/* a phone: two screens, the picture a wide band over the words */
@media (max-width: 639px) {
  #coffee { --hm: 2; }
  .coffee__cards { row-gap: var(--asili-space-6); }
  .coffee-card > .panel--top { aspect-ratio: 2 / 1; margin-bottom: var(--asili-space-4); }
}

/* ---------------------------------------------------------------- one-off orders and subscriptions: one centred column
   (the head, the three ways, the link, then the picture across the container under them: no words-and-picture split) */
.order__rows > li { grid-template-columns: minmax(0, 1fr); }
.order__rows .rows__name { color: var(--asili-ink); }
.order__rows p { color: var(--asili-ink); }
#order .order__more { margin-top: var(--asili-space-5); align-self: flex-start; }
#order .order__photo { margin-top: var(--asili-space-6); min-height: var(--asili-picture-min); }
@media (min-width: 1024px) {
  #order .order__rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); }
  #order .order__rows > li { padding-block: 0; border-bottom: 0; align-content: start; }
}
@media (min-width: 1280px) {
  #order .order__rows > li { justify-items: center; text-align: center; }
  #order .order__more { align-self: center; }
}
/* a phone: the words on the first screen, the picture the whole second screen (as the questions do) */
@media (max-width: 639px) {
  #order { --hm: 2; }
  #order .order__photo { flex: 0 0 auto; margin-top: auto; height: calc(100lvh - var(--padt) - var(--padb) - var(--bar)); }
}

/* ---------------------------------------------------------------- the brand band (palette rule 1: cobalt, white words) */
.ground-brand {
  --bg: var(--asili-surface-brand); --surface: var(--asili-cobalt-deep); --card: var(--asili-cobalt-deep);
  --ink: var(--asili-text-on-brand); --muted: var(--asili-text-on-brand-muted);
  --action: var(--asili-white); --action-ink: var(--asili-cobalt);
  --line: var(--asili-on-cobalt-muted); --line-strong: var(--asili-on-cobalt-muted);
  --heading: var(--asili-text-on-brand);
}
.ground-brand p { line-height: var(--asili-lh-body-on-brand); letter-spacing: var(--asili-track-on-brand); }
.origin__pair { align-items: start; }
.origin__photo { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--asili-mist); }
.origin__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px) {
  .origin__pair > .origin__photo { grid-column: auto / span 6; aspect-ratio: 4 / 5; }
}
/* ---------------------------------------------------------------- the roast slider (asili-roast-slider.js) */
#roast {
  --roast-bg: var(--asili-roast-1); --ink: var(--asili-ink); --muted: var(--asili-ink); --heading: var(--asili-text-heading);
  --roast-track: var(--asili-cobalt); --roast-edge: var(--asili-line-strong);
  background: var(--roast-bg); color: var(--ink);
}
#roast[data-roast="2"] { --roast-bg: var(--asili-roast-2); }
#roast[data-roast="3"] { --roast-bg: var(--asili-roast-3); }
#roast:is([data-roast="4"], [data-roast="5"]) {
  --ink: var(--asili-text-on-brand); --muted: var(--asili-text-on-brand-muted); --heading: var(--asili-text-on-brand);
  --roast-track: var(--asili-text-on-brand); --roast-edge: var(--asili-on-cobalt-muted); --action: var(--asili-white);
}
#roast[data-roast="4"] { --roast-bg: var(--asili-roast-4); }
#roast[data-roast="5"] { --roast-bg: var(--asili-roast-5); }
/* light text on cobalt gets a little more room (palette section 5): body lines at 1.6 and 0.01em */
#roast:is([data-roast="4"], [data-roast="5"]) :is(p:not(.roast__name), .roast__value) { line-height: var(--asili-lh-body-on-brand); letter-spacing: var(--asili-track-on-brand); }
.roast__stops > li:nth-child(n + 4) { letter-spacing: var(--asili-track-on-brand); }
/* the ground eases over 700 ms once the visitor moves the slider (never on load); the words change colour early */
#roast[data-roast-live] { transition: background-color var(--asili-dur-ground) var(--asili-ease); }
#roast[data-roast-live] :is(h2, p, label, .roast__value) { transition: color 0s linear var(--asili-text-flip); }
@media (prefers-reduced-motion: reduce) {
  #roast[data-roast-live], #roast[data-roast-live] :is(h2, p, label, .roast__value) { transition: none; }
}
#roast .section-head p { color: var(--ink); }
.roast__control { display: grid; gap: var(--asili-space-3); }
.roast__label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--asili-space-4); font-weight: var(--asili-weight-strong); color: var(--ink); }
.roast__value { font-weight: 400; color: var(--ink); }
.roast__input {
  -webkit-appearance: none; appearance: none; display: block; margin: 0;
  width: calc(80% + var(--asili-roast-thumb)); margin-inline-start: calc(10% - var(--asili-roast-thumb) / 2);
  height: var(--asili-tap); background: transparent; cursor: pointer;
}
.roast__input::-webkit-slider-runnable-track { height: var(--asili-roast-track); background: var(--roast-track); border-radius: var(--asili-roast-track); }
.roast__input::-moz-range-track { height: var(--asili-roast-track); background: var(--roast-track); border-radius: var(--asili-roast-track); }
.roast__input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: var(--asili-roast-thumb); height: var(--asili-roast-thumb);
  margin-top: calc((var(--asili-roast-thumb) - var(--asili-roast-track)) / -2);
  border-radius: 50%; background: var(--asili-white); border: var(--asili-chip-border) solid var(--asili-cobalt);
}
.roast__input::-moz-range-thumb { width: var(--asili-roast-thumb); height: var(--asili-roast-thumb); border-radius: 50%; background: var(--asili-white); border: var(--asili-chip-border) solid var(--asili-cobalt); box-sizing: border-box; }
.roast__input:focus-visible { outline-offset: var(--asili-ring); border-radius: var(--asili-tap); }
.roast__stops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none;
  border: 1px solid var(--roast-edge); border-radius: var(--r-lg); overflow: hidden; }
.roast__stops > li {
  display: flex; align-items: flex-end; min-width: 0; height: var(--asili-roast-tile-h); padding: var(--asili-space-3);
  font-size: var(--asili-size-small); line-height: var(--asili-lh-label); overflow-wrap: anywhere; hyphens: auto;
}
.roast__stops > li + li { border-left: 1px solid var(--roast-edge); }
.roast__stops > li:nth-child(1) { background: var(--asili-roast-1); color: var(--asili-ink); }
.roast__stops > li:nth-child(2) { background: var(--asili-roast-2); color: var(--asili-ink); }
.roast__stops > li:nth-child(3) { background: var(--asili-roast-3); color: var(--asili-ink); }
.roast__stops > li:nth-child(4) { background: var(--asili-roast-4); color: var(--asili-white); }
.roast__stops > li:nth-child(5) { background: var(--asili-roast-5); color: var(--asili-white); }
.roast__stops > li.is-current { font-weight: var(--asili-weight-strong); text-decoration: underline; text-decoration-thickness: var(--asili-underline); text-underline-offset: var(--asili-underline-offset); }
.roast__detail { margin-top: var(--asili-space-7); align-items: start; }
.roast__levels { margin: 0; padding: 0; list-style: none; }
.roast__level { display: grid; gap: var(--asili-space-3); }
.roast__name { font: var(--asili-weight-strong) var(--asili-size-item-title)/var(--asili-lh-item-title) var(--asili-font-text); color: var(--ink); }
.roast__level > p { color: var(--ink); }
.roast__match { font-weight: var(--asili-weight-strong); }
.roast__coffees-label { font-size: var(--asili-size-small); color: var(--ink); margin-bottom: var(--asili-space-3); }
.roast__coffees { display: flex; flex-wrap: wrap; gap: var(--asili-space-3); margin: 0; padding: 0; list-style: none; }
.roast__coffees > li {
  display: inline-flex; align-items: center; gap: var(--asili-space-2); min-height: var(--asili-chip-h); padding: 0 var(--asili-space-4);
  border-radius: var(--r-btn); border: var(--asili-chip-border) solid var(--asili-white); background: var(--asili-white); color: var(--asili-ink); font-size: var(--asili-size-small);
}
/* each chip leads with a swatch of its roast level's shade; the matching one shows a check instead */
.roast__coffees > li::before { content: ""; flex: none; width: var(--asili-space-5); height: var(--asili-space-2); border-radius: var(--asili-space-1); border: 1px solid var(--asili-border-control); background: var(--swatch); }
.roast__coffees > li[data-roast-coffee="2"] { --swatch: var(--asili-roast-2); }
.roast__coffees > li[data-roast-coffee="3"] { --swatch: var(--asili-roast-3); }
.roast__coffees > li[data-roast-coffee="4"] { --swatch: var(--asili-roast-4); }
.roast__coffees > li.is-match { border-color: var(--asili-cobalt); font-weight: var(--asili-weight-strong); }
.roast__coffees > li.is-match::before {
  width: var(--asili-space-4); height: var(--asili-space-4); border: 0; border-radius: 50%; background: var(--asili-cobalt);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cmask id='m'%3E%3Crect width='16' height='16' fill='white'/%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Ccircle cx='8' cy='8' r='8' mask='url(%23m)'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cmask id='m'%3E%3Crect width='16' height='16' fill='white'/%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Ccircle cx='8' cy='8' r='8' mask='url(%23m)'/%3E%3C/svg%3E") center / contain no-repeat;
}
#roast:is([data-roast="4"], [data-roast="5"]) .roast__coffees > li.is-match { outline: var(--asili-ring) solid var(--asili-white); outline-offset: var(--asili-ring); }

/* with the script: the slider and one level at a time */
asili-roast-slider { display: block; }
asili-roast-slider[data-ready] .roast__level:not(.is-current) { display: none; }
/* without the script: the five levels read as a static list, and the section takes two screens */
asili-roast-slider:not([data-ready]) :is(.roast__control, .roast__coffees-wrap) { display: none; }
asili-roast-slider:not([data-ready]) .roast__detail { margin-top: 0; }
asili-roast-slider:not([data-ready]) .roast__levels { display: grid; gap: var(--asili-space-6); }
asili-roast-slider:not([data-ready]) .roast__levels-col { grid-column: 1 / -1; }
#roast:has(asili-roast-slider:not([data-ready])) { --hm: 2; }
@media (min-width: 1024px) {
  asili-roast-slider:not([data-ready]) .roast__levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  #roast { --hm: 2; }
  .roast__stops > li { height: var(--asili-roast-tile-h-phone); padding: var(--asili-space-2); font-size: var(--asili-size-label); }
  .roast__detail { margin-top: var(--asili-space-6); row-gap: var(--asili-space-6); }
  .roast__coffees { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------- close (close-word: the logo file large) and footer */
.closing__cta h2 { max-width: 24ch; }
/* the logo as supplied, set large on its own cobalt ground across the .wrap, line to line, at every width (close-word),
   straight under the head row. A logo that wide is about 350 px tall or more, so the close and the links cannot share
   one screen, and padding them to two would leave empty ground. So from 1024 up the close is one screen: the logo's
   frame grows past its own proportion to the screen's --padb line, showing more of the file's own cobalt ground with
   the wordmark kept in its middle (48.75% down the file), and the links follow a section's gap later at their own
   height, with no screen padding. Below 1024 the close is not padded (there it would stand half empty) and the links
   follow it. The footer is then not one or two screens tall: that finding is waived in .taste-skill/waivers.json
   (coordinator ruling, fix round 2). */
.close__logo-room > .asili-logo { --logo-w: 100%; --logo-radius: var(--r-lg); display: block; }
footer.closing > .wrap { grid-template-rows: auto auto; }
@media (min-width: 1024px) {
  footer.closing { height: auto; min-height: 0; }
  footer.closing > .wrap { height: auto; row-gap: 0; }
  footer.closing .closing__cta { min-height: calc(100svh - var(--padt) - var(--padb)); }
  footer.closing .close__logo-room { flex: 1 0 auto; display: flex; flex-direction: column; }
  footer.closing .close__logo-room > .asili-logo { flex: 1 0 auto; }
  footer.closing .close__logo-room > .asili-logo img { inset-block-start: 50%; translate: 0 -48.75%; }
  footer.closing .closing__links { padding-top: calc(var(--padb) + var(--padt)); }
}
@media (max-width: 1023px) {
  footer.closing > .wrap { row-gap: var(--asili-space-7); }
  footer.closing .closing__links { gap: var(--asili-space-6); }
}
.footer__lede { font-synthesis: none; }
.footer__news { display: grid; gap: var(--asili-space-3); align-content: start; }
.footer__news > h3 { margin: 0; }
.footer__news form { display: flex; flex-wrap: wrap; gap: var(--asili-space-2); align-items: end; }
.footer__news .field { flex: 1 1 auto; min-width: 0; }
.footer__news .field input { border-color: var(--asili-border-control); background: var(--asili-white); }
.footer__news .form__status { flex-basis: 100%; }
.footer__legal { align-items: center; }
/* the newsletter's error line in the palette's error colour (cherry: 4.67:1 on porcelain), with its icon and words */
.footer__news .form { --error: var(--asili-error); }
@media (max-width: 1023px) { .footer__news { grid-column: 1 / -1; } }
@media (max-width: 1023px) { .footer__news form { flex-direction: column; align-items: stretch; } }

/* ---------------------------------------------------------------- hero on a phone: a lower photograph band so the words and both actions end on the first screen */
@media (min-width: 1024px) { .hero--photo { background: var(--asili-mist); } }
/* 1024-1279: the porcelain box takes eight columns, so the longer French and Dutch titles keep to three lines */
@media (min-width: 1024px) and (max-width: 1279px) { .hero--photo .hero__text { width: calc((100% - 11 * var(--gutter)) / 12 * 8 + 7 * var(--gutter)); } }
@media (max-width: 639px) { .hero--photo { --photo: 34svh; } }
/* a tablet: a taller photograph band, so the words end near the foot of the first screen */
@media (min-width: 640px) and (max-width: 1023px) { .hero--photo { --photo: min(50svh, 64vw); } }

/* ---------------------------------------------------------------- fits per width (layout-v4: every section one or two screens) */
/* the range on a tablet: one screen, the picture under a third of the card, the intro cut (the table heads name the scale) */
@media (min-width: 640px) and (max-width: 1023px) {
  #coffee { --h: 1; }
  .coffee__intro { display: none; }
  /* the picture as large as three cards allow in one screen: a little over a third of the card at most */
  #coffee .coffee__cards > .coffee-card { grid-template-columns: minmax(0, min(36%, (100svh - var(--padt) - var(--padb) - var(--asili-coffee-head)) / 3 - var(--asili-space-4))) minmax(0, 1fr); }
}
/* the range's link on a phone: a full row */
@media (max-width: 639px) { :is(.coffee__link, .order__more) { width: 100%; justify-content: space-between; } }

/* roast: the slider's element is the section's .wrap, two groups (the heading with the control, then the detail);
   a phone gives each group a screen (g2m) */
.roast__top { display: grid; gap: 0; }
.roast__top > .section-head { margin-bottom: var(--head-gap); }
/* below 1024: the shade strip takes what the words leave of the screen (a phone: of the first screen) */
@media (max-width: 1023px) {
  .roast__top { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  .roast__control { display: flex; flex-direction: column; gap: var(--asili-space-3); flex: 1 1 auto; min-height: 0; }
  .roast__stops { flex: 1 1 auto; min-height: var(--asili-roast-tile-h); }
  .roast__stops > li { height: auto; }
}
@media (max-width: 639px) {
  .roast__detail { margin-top: 0; display: flex; flex-direction: column; }
  .roast__detail > .roast__coffees-wrap { margin-top: auto; }
  main > #roast:has(asili-roast-slider:not([data-ready])) > .wrap { display: flex; flex-direction: column; }
}
/* 1024-1279 (a short laptop screen): the level's words and the coffees take half the row each (the chips two by two),
   and the shade strip may go a little lower, so the longer French and Dutch keep the section to one screen */
@media (min-width: 1024px) and (max-width: 1279px) {
  #roast .roast__detail { margin-top: var(--asili-space-6); }
  #roast .roast__levels-col { grid-column: 1 / span 6; }
  #roast .roast__coffees-wrap { grid-column: 7 / span 6; }
  #roast { --asili-roast-tile-h: clamp(5rem, 100svh - 42rem, 13rem); }
}

/* the brand band from 1280 up (one fixed screen): the pair takes what the words leave, never taller than 4:3, so a short
   laptop screen (1366x768, 1280x720) shortens the pictures, never the words */
@media (min-width: 1280px) {
  #origin > .wrap { container-type: inline-size; }
  #origin .origin__pair { flex: 1 1 0; min-height: 0; align-content: start;
    grid-template-rows: minmax(var(--asili-picture-min-faq), calc((100cqi - var(--gutter)) / 2 * 3 / 4)); }
  #origin .origin__pair > .origin__photo { aspect-ratio: auto; align-self: stretch; }
}
/* the brand band below 1024: the pair of pictures takes what the words leave of the screen */
@media (max-width: 1023px) {
  #origin .origin__pair { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  #origin .origin__pair > .origin__photo { aspect-ratio: auto; height: 100%; min-height: var(--asili-picture-min); }
}

/* the footer on a tablet: the line and the two link columns share a row */
@media (min-width: 640px) and (max-width: 1023px) {
  .footer .closing__links .grid > .span-4:first-child { grid-column: auto / span 6; }
  .footer .closing__links .footer__col { grid-column: auto / span 3; }
}

/* ---------------------------------------------------------------- questions: one centred column (the answers, then one
   picture across the container under them: no words-and-picture split) */
#faq .faq__item > h3 { font: var(--asili-weight-strong) var(--asili-size-item-title)/var(--asili-lh-item-title) var(--asili-font-text); }
#faq .faq__item > p { font-size: var(--asili-size-body); }
.faq__photo { position: relative; margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--asili-mist); }
.faq__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#faq .faq__photo { margin-top: var(--asili-space-7); min-height: var(--asili-picture-min); }
/* 1024-1279: the four answers two by two across the container, so the picture keeps its room on a short screen */
@media (min-width: 1024px) and (max-width: 1279px) {
  #faq .faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); }
  #faq .faq > .faq__item { align-content: start; }
  #faq .faq > .faq__item:nth-child(-n + 2) { padding-top: 0; }
}
/* from 1024 up the picture under the answers may shrink further (the longer French answers at 1024x768) */
@media (min-width: 1024px) { #faq .faq__photo { min-height: var(--asili-picture-min-faq); } }
@media (min-width: 1280px) {
  #faq .faq { width: var(--asili-centre-col); margin-inline: auto; text-align: center; }
  #faq .faq > .faq__item { padding-block: var(--asili-space-4); }
  #faq .faq > .faq__item:first-child { padding-top: 0; }
  #faq .faq__item > p { margin-inline: auto; }
}
/* a short laptop screen (1366x768, 1280x720): the answers sit closer and the picture gives way first */
@media (min-width: 1280px) and (max-height: 820px) {
  #order .order__photo { min-height: clamp(var(--asili-space-8), 100svh - 41rem, var(--asili-picture-min)); }
  #faq .faq > .faq__item { padding-block: var(--asili-space-3); }
  #faq .faq > .faq__item:first-child { padding-top: 0; }
  #faq .faq__photo { margin-top: var(--asili-space-6); min-height: clamp(var(--asili-space-8), 100svh - 41rem, var(--asili-picture-min-faq)); }
}
/* a phone: the answers on the first screen, the picture the whole second screen */
@media (max-width: 639px) {
  #faq { --hm: 2; }
  #faq .faq__photo { flex: 0 0 auto; margin-top: auto; height: calc(100lvh - var(--padt) - var(--padb) - var(--bar)); }
}

/* ---------------------------------------------------------------- A's composition: centred and airy
   From 1280 up every head stands on the page's axis, its words centred and no wider than the centre column (half the
   container, less a gutter). The kit sets heads on the left line (system.css 407-409: a centred head among left ones
   reads as a mistake); A centres all of them, so none is the odd one, and overrides the kit here, never in its file.
   Below 1280 the heads keep the left line: half a small laptop's, a tablet's or a phone's container is too narrow for
   centred words (a centred block is never wider than half the container), and the sections would outgrow the screen. */
@media (min-width: 1280px) {
  main > .section .section-head, footer.closing .section-head--split {
    display: grid; justify-content: normal; justify-items: center; max-width: var(--asili-centre-col); margin-inline: auto; text-align: center;
  }
  main > .section .section-head--row { gap: var(--s-4); }
  :is(.section-head--row, .section-head--split) > div { justify-items: center; }
  .section-head p { margin-inline: auto; }
}
/* the range from 1280 up, one fixed screen on any laptop: the link runs on at the end of the intro's last line (still
   centred, one line less), the cards' row takes what the head leaves, and each picture takes what its card's words
   leave: never taller than 3:2 (its size on a 1440x900 screen) and never under --asili-card-pic-min. The three cards share
   one row grid (subgrid), so their pictures keep one height and their titles, lines and scales stay level. On a short
   screen (1366x768, 1280x720) or in the longer French and Dutch the pictures give way, never the words. */
@media (min-width: 1280px) {
  #coffee .section-head--row { display: block; }
  #coffee .section-head--row > div { display: contents; }
  #coffee .section-head--row h2 { margin-bottom: var(--s-4); }
  #coffee .coffee__intro { display: inline; }
  #coffee .coffee__link { margin-left: var(--s-3); }
  #coffee > .wrap { container-type: inline-size; }
  #coffee .coffee__cards { flex: 1 1 0; min-height: 0; row-gap: 0; align-content: start;
    grid-template-rows: minmax(calc(var(--asili-card-pic-min) + var(--s-5)), calc((100cqi - 2 * var(--gutter)) / 3 * 2 / 3 + var(--s-5))) repeat(4, auto); }
  #coffee .coffee__cards > .coffee-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; }
  #coffee .coffee-card > .panel--top { aspect-ratio: auto; height: auto; min-height: 0; }
}

@media (max-width: 1023px) { .footer__news form > .field { width: 100%; } }