/* c-c-brew-sheet: page CSS for direction C (Asili Coffee).
   Every colour, font, size and spacing this direction adds is an --asili-* token in the :root block
   below, so it can move into asili-tokens.css later. The kit's own tokens (--s-*, --t-*, --r-*) are
   reused where they already hold the value. */

:root {
  /* colour (contrast computed, see the report) */
  --asili-white: #FFFFFF;           /* page */
  --asili-surface: #F0F2F8;         /* spec cards, quiet fields */
  --asili-ink: #0E1020;             /* text: 18.86 on white, 16.85 on surface */
  --asili-muted: #4A4F66;           /* 8.07 on white, 7.21 on surface */
  --asili-cobalt: #3A39B8;          /* the logo's blue: hero box, brand band, actions, links */
  --asili-cobalt-hover: #E7E7F5;    /* a white button's hover on cobalt (cobalt text on it: 6.98) */
  --asili-crema: #F6C25B;           /* text and marks on cobalt only: 5.20 */
  --asili-crema-fill: #F2B33D;      /* the timer's progress on cobalt: 4.59 */
  --asili-on-cobalt-muted: #C6CFF6; /* 5.56 on cobalt, 7.53 on cobalt deep */
  --asili-cobalt-deep: #2B2793;     /* the timer's face (palette file's cobalt deep): white 11.58, crema 7.05, crema fill 6.22 */
  --asili-line: #D5D9E6;            /* decorative dividers and empty meter segments */
  --asili-line-control: #7A7F96;    /* control borders: 3.96 on white, 3.54 on surface */
  --asili-line-on-cobalt: #6F6ED0;  /* decorative: the ring's empty track and the rules on the band */
  --asili-disabled: 0.5;            /* a timer button that does nothing in this state */

  /* type */
  --asili-font-text: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --asili-font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --asili-size-label: 0.8125rem;    /* 13px mono labels */
  --asili-size-nav: 0.9375rem;      /* 15px: the nav's words and the language switch */
  --asili-size-body: 1rem;          /* 16px: every value people read */
  --asili-size-title: 1.25rem;      /* 20px: a coffee's name, the recipe's name */
  --asili-size-step: 1.125rem;      /* 18px: a step of the recipe */

  /* measures */
  --asili-logo-nav: 7.5rem;
  --asili-logo-footer: 9rem;
  --asili-hero-box: 34rem;          /* the hero's cobalt box on a tablet */
  --asili-hero-box-wide: 40rem;     /* the hero's cobalt box from 1024 */
  --asili-spec-label: 6.5rem;       /* the label column of a spec row */
  --asili-spec-strip: 5.5rem;       /* a coffee's picture on a phone */
  --asili-step-when: 7.5rem;        /* the time column of a recipe step */
  --asili-step-when-phone: 6rem;
  --asili-dial: 30rem;              /* the timer's ring */
  --asili-ring-w: 10;               /* the ring's stroke, in the 240-unit dial */
  --asili-tick-w: 2;
  --asili-meter-w: 0.875rem;
  --asili-meter-h: 0.5rem;
  --asili-meter-gap: 0.1875rem;
  --asili-toggle-bar: 1rem;
  --asili-toggle-gap: 0.3125rem;
  --asili-hairline: 1px;
  --asili-rule: 2px;
  --asili-lang-h: 2.25rem;
  --asili-lang-h-touch: 2.75rem;
  --asili-news-w: 26rem;
  --asili-faq-pad: 2.25rem;         /* the space above and below each question */

  /* motion: quick and tactile */
  --asili-ease: cubic-bezier(.3, 0, .2, 1);
  --asili-dur-press: 120ms;
  --asili-dur-snap: 160ms;
  --asili-dur-move: 200ms;

  /* the kit's tokens, mapped to this direction */
  --font-mono: var(--asili-font-mono);
  --line: var(--asili-line);
  --line-strong: var(--asili-line-control);
}

::selection { background: var(--asili-cobalt); color: var(--asili-white); }
html { caret-color: var(--asili-cobalt); }
.spec__rows, .sheet-rows .rows__value, .brew__time, .brew__when { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- cobalt: the brand band (#brew) and the hero's box */
.ground-brand {
  --muted: var(--asili-on-cobalt-muted);
  --line: var(--asili-line-on-cobalt);
  --line-strong: var(--asili-on-cobalt-muted);
}
.ground-brand .btn--primary:hover { background: var(--asili-cobalt-hover); }
.hero--film .hero__media { background: var(--asili-surface); }
.hero--film .hero__over > .hero__box {
  background: var(--asili-cobalt); color: var(--asili-white);
  --bg: var(--asili-cobalt); --ink: var(--asili-white); --muted: var(--asili-on-cobalt-muted);
  --action: var(--asili-white); --action-ink: var(--asili-cobalt);
  --line: var(--asili-line-on-cobalt); --line-strong: var(--asili-on-cobalt-muted);
}
.hero--film .hero__over .hero__lead { color: var(--asili-white); }
/* the box a little wider than the kit's 600px, so a 41-character headline still sets in three lines in Albert Sans */
@media (min-width: 1024px) {
  .hero--film .hero__over > .hero__box { max-width: var(--asili-hero-box-wide); }
  .hero--film .hero__over h1 { max-width: none; }
}
.hero__box .btn--primary:hover { background: var(--asili-cobalt-hover); }
@media (min-width: 640px) and (max-width: 1023px) {
  .hero--film .hero__over > .hero__box { justify-self: start; max-width: min(var(--asili-hero-box), 72%); }
}
/* a phone: the frame, then the words on the page ground under it (layout-v4.md, the film hero at 390) */
@media (max-width: 639px) {
  .hero--film .hero__media { overflow: visible; border-radius: 0; background: none; justify-content: flex-start; }
  .hero--film .hero__media > img { position: relative; inset: auto; flex: 1 1 0; height: auto; min-height: 10rem; border-radius: var(--r-lg); }
  .hero--film .hero__over { padding: var(--s-5) 0 0; }
  .hero--film .hero__over > .hero__box {
    padding: 0; background: none; color: var(--asili-ink);
    --bg: var(--asili-white); --ink: var(--asili-ink); --muted: var(--asili-muted);
    --action: var(--asili-cobalt); --action-ink: var(--asili-white);
    --line: var(--asili-line); --line-strong: var(--asili-line-control);
  }
  .hero--film .hero__over .hero__lead { color: var(--asili-ink); }
  .hero__box .btn--primary:hover { background: color-mix(in oklab, var(--action) 86%, var(--ink)); }
}

/* ---------------------------------------------------------------- the nav: the logo as supplied, the language switch, the menu button */
.nav__logo.asili-logo { --logo-w: var(--asili-logo-nav); gap: 0; }
.footer__logo.asili-logo { --logo-w: var(--asili-logo-footer); }

.lang [role="group"] { display: inline-flex; align-items: center; gap: var(--s-1); }
.lang button {
  position: relative; display: inline-grid; place-items: center;
  min-width: var(--asili-lang-h); height: var(--asili-lang-h); padding: 0 var(--s-2);
  border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  font: 500 var(--asili-size-nav)/1 var(--asili-font-text); color: var(--muted);
  transition: color var(--asili-dur-press) var(--asili-ease);
}
.lang button::after {
  content: ""; position: absolute; left: var(--s-2); right: var(--s-2); bottom: var(--s-1);
  border-top: var(--asili-rule) solid var(--action);
  transform: scaleX(0); transition: transform var(--asili-dur-snap) var(--asili-ease);
}
.lang button:hover, .lang button[aria-pressed="true"] { color: var(--ink); }
.lang button[aria-pressed="true"]::after { transform: scaleX(1); }

asili-nav-menu { display: contents; }
.nav asili-nav-menu > .nav__toggle { position: relative; margin-left: 0; }
.nav.is-open asili-nav-menu > .nav__toggle { margin-left: auto; }
/* the bars are drawn here, so the icon follows aria-expanded whichever script toggled it */
.nav__toggle > svg { display: none; }
.nav__toggle::before, .nav__toggle::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: var(--asili-toggle-bar);
  margin: calc(var(--asili-rule) / -2) 0 0 calc(var(--asili-toggle-bar) / -2);
  border-top: var(--asili-rule) solid currentColor;
  transition: transform var(--asili-dur-move) var(--asili-ease);
}
.nav__toggle::before { transform: translateY(calc(-1 * var(--asili-toggle-gap))); }
.nav__toggle::after { transform: translateY(var(--asili-toggle-gap)); }
.nav__toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"]::after { transform: rotate(-45deg); }
@media (max-width: 1023px) {
  .nav.is-open .nav__actions .lang { justify-self: center; }
}

/* ---------------------------------------------------------------- #coffees: three spec cards, a brew sheet each */
.spec-grid { align-items: stretch; }
.spec { --card: var(--asili-surface); gap: 0; }
.spec__media {
  position: relative; overflow: hidden; aspect-ratio: 5 / 2; background: var(--asili-line);
  margin: calc(-1 * var(--c-pad) - var(--asili-hairline)) calc(-1 * var(--c-pad) - var(--asili-hairline)) var(--s-5);
}
.spec__media > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.spec__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.spec__head h3 { margin: 0; font: 500 var(--asili-size-title)/1.3 var(--asili-font-text); letter-spacing: -0.01em; color: var(--ink); }
.spec__origin { margin: 0; flex: none; font: 400 var(--asili-size-label)/1.4 var(--asili-font-mono); color: var(--muted); }
.spec__notes { margin: var(--s-2) 0 0; font-size: var(--asili-size-body); line-height: 1.5; color: var(--ink); }
.spec__rows { margin: var(--s-4) 0 0; border-top: var(--asili-hairline) solid var(--line); }
.spec__rows > div {
  display: grid; grid-template-columns: var(--asili-spec-label) minmax(0, 1fr); gap: var(--s-3); align-items: baseline;
  padding-block: var(--s-2); border-bottom: var(--asili-hairline) solid var(--line);
}
.spec__rows dt { font: 400 var(--asili-size-label)/1.5 var(--asili-font-mono); color: var(--muted); }
.spec__rows dd { margin: 0; font: 400 var(--asili-size-body)/1.5 var(--asili-font-mono); color: var(--ink); white-space: nowrap; }
.spec__rows > div:not(.spec__m) dd { white-space: normal; }
.meter { display: inline-flex; gap: var(--asili-meter-gap); margin-right: var(--s-3); vertical-align: 0.05em; }
.meter > i { display: block; width: var(--asili-meter-w); height: var(--asili-meter-h); background: var(--asili-line); }
.meter[data-v="1"] > i:nth-child(-n + 1),
.meter[data-v="2"] > i:nth-child(-n + 2),
.meter[data-v="3"] > i:nth-child(-n + 3),
.meter[data-v="4"] > i:nth-child(-n + 4),
.meter[data-v="5"] > i:nth-child(-n + 5) { background: var(--asili-cobalt); }
@media (forced-colors: active) {
  .meter > i { border: var(--asili-hairline) solid CanvasText; background: Canvas; }
  .meter[data-v="1"] > i:nth-child(-n + 1), .meter[data-v="2"] > i:nth-child(-n + 2), .meter[data-v="3"] > i:nth-child(-n + 3),
  .meter[data-v="4"] > i:nth-child(-n + 4), .meter[data-v="5"] > i:nth-child(-n + 5) { background: CanvasText; }
}
/* the notes take two lines on every card, so the rows of the three sheets line up */
@media (min-width: 1280px) { .spec__notes { min-height: 3em; } }

/* 1024 to 1279 (a short laptop screen): two screens, a card a row, the picture, the words and the rows side by side */
@media (min-width: 1024px) and (max-width: 1279px) {
  #coffees { --h: 2; }
  .spec-grid > .spec { --c-pad: var(--s-6); grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 5fr); column-gap: var(--s-6); align-items: start; }
  .spec__media { align-self: stretch; aspect-ratio: auto; margin: calc(-1 * var(--c-pad) - var(--asili-hairline)) 0 calc(-1 * var(--c-pad) - var(--asili-hairline)) calc(-1 * var(--c-pad) - var(--asili-hairline)); }
  .spec__rows { margin-top: 0; }
  .spec__rows > div { padding-block: var(--s-3); }
}
/* a tablet: one screen, the three sheets side by side, each label over its value */
@media (min-width: 640px) and (max-width: 1023px) {
  .spec-grid > .spec { --c-pad: var(--s-5); grid-column: auto / span 4; }
  .spec__media { aspect-ratio: 4 / 3; }
  .spec__head { flex-wrap: wrap; gap: 0 var(--s-3); }
  .spec__rows > div { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: var(--s-1); }
  .spec__rows dt { line-height: 1.3; }
  .spec__rows dd { white-space: normal; line-height: 1.4; }
}
/* a phone: two screens, the picture as a strip across the card, the rows kept tight */
@media (max-width: 639px) {
  #coffees { --hm: 2; }
  .spec__media { aspect-ratio: auto; height: var(--asili-spec-strip); margin-bottom: var(--s-4); }
  .spec__head { flex-wrap: wrap; gap: 0 var(--s-3); }
  .spec__rows > div { padding-block: var(--s-1); }
}

/* ---------------------------------------------------------------- #subscription: words and ruled rows beside one picture */
.split__text > * + * { margin-top: var(--s-5); }
.split__text > .sheet-rows { margin-top: var(--s-7); }
.sheet-rows > li:first-child { padding-top: var(--s-4); }
.sheet-rows .rows__name { font: 400 var(--asili-size-label)/1.5 var(--asili-font-mono); color: var(--muted); align-self: baseline; }
.sheet-rows .rows__value { font: 400 var(--asili-size-body)/1.5 var(--asili-font-mono); color: var(--ink); align-self: baseline; }
/* a narrow phone: the value gets the wider column and wraps at its spaces (a Dutch compound never runs past the screen) */
@media (max-width: 479px) {
  .sheet-rows > li { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .sheet-rows .rows__value { max-width: none; white-space: normal; text-wrap: pretty; hyphens: auto; }
}
@media (min-width: 1024px) {
  #subscription > .split { grid-template-rows: minmax(0, 1fr); align-content: stretch; }
  #subscription .split__media { --ratio: 0px; align-self: stretch; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  #subscription .split__media { --ratio: 50%; margin-top: var(--s-7); }
}
@media (max-width: 639px) {
  #subscription .split__media { --ratio: 0px; align-self: stretch; }
}

/* ---------------------------------------------------------------- #origin: bleed, the head row, then one wide picture across the wrap */
.origin__head { margin-bottom: var(--head-gap); align-items: start; }
.origin__head > p { color: var(--ink); }
/* the picture takes what the screen leaves under the head row (1280 x about 550 at 1440, a 16:7 band; about 4:5 on a phone) */
#origin .origin__bleed { --ratio: 0px; }

/* ---------------------------------------------------------------- #brew: the recipe and its step timer on the cobalt band */
.brew { align-items: start; }
.brew__lead { margin-top: var(--s-5); color: var(--ink); max-width: 36ch; }
.brew__recipe { margin-top: var(--s-7); }
.brew__name { font: 500 var(--asili-size-title)/1.3 var(--asili-font-text); letter-spacing: -0.01em; color: var(--ink); }
.brew__ratio { margin-top: var(--s-1); font: 400 var(--asili-size-body)/1.5 var(--asili-font-mono); color: var(--muted); }
.brew__steps { margin-top: var(--s-4); }
.brew__steps > li {
  position: relative; display: grid; grid-template-columns: var(--asili-step-when) minmax(0, 1fr); gap: var(--s-4); align-items: baseline;
  padding-block: var(--s-4); border-bottom: var(--asili-hairline) solid var(--line);
  color: var(--muted); transition: color var(--asili-dur-snap) var(--asili-ease);
}
/* the current step: its rule turns crema and snaps from row to row */
.brew__steps > li::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(-1 * var(--asili-hairline));
  border-bottom: var(--asili-rule) solid var(--asili-crema);
  transform: scaleX(0); transform-origin: left center; transition: transform var(--asili-dur-snap) var(--asili-ease);
}
.brew__when { font: 400 var(--asili-size-body)/1.5 var(--asili-font-mono); }
.brew__what { font-size: var(--asili-size-step); line-height: 1.4; text-wrap: pretty; }
.brew__steps > li[aria-current="step"] { color: var(--ink); }
.brew__steps > li[aria-current="step"]::after { transform: scaleX(1); }
.brew__steps > li[aria-current="step"] .brew__when { color: var(--asili-crema); }
.brew__steps > li[data-past] .brew__what { text-decoration: line-through; text-decoration-thickness: var(--asili-hairline); }
/* without the script every step reads in full white, as a plain recipe, and the timer stays out */
asili-brew-timer:not([data-ready]) .brew__steps > li { color: var(--ink); }
asili-brew-timer:not(:defined) .brew__panel { display: none; }

/* the timer: the crema ring on the band, a deep-cobalt display in its middle with the time and the step */
.brew__dial { position: relative; width: min(100%, var(--asili-dial)); aspect-ratio: 1; margin: 0; }
.brew__ring { display: block; width: 100%; height: 100%; }
.brew__track, .brew__arc { fill: none; stroke-width: var(--asili-ring-w); }
.brew__track { stroke: var(--asili-line-on-cobalt); }
.brew__arc {
  stroke: var(--asili-crema-fill); stroke-dasharray: 1000; stroke-dashoffset: calc(1000 - 1000 * var(--brew-p, 0));
  transform: rotate(-90deg); transform-box: view-box; transform-origin: center;
}
.brew__ticks line { stroke: var(--asili-on-cobalt-muted); stroke-width: var(--asili-tick-w); stroke-linecap: square; }
.brew__readout {
  position: absolute; inset: 14%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-2); padding: var(--s-5); border-radius: 50%; background: var(--asili-cobalt-deep); text-align: center;
}
.brew__label { font: 400 var(--asili-size-label)/1.4 var(--asili-font-mono); color: var(--muted); }
.brew__time { font: 400 var(--t-h2)/1 var(--asili-font-mono); letter-spacing: -0.02em; color: var(--ink); }
.brew__now { min-height: 2.8em; max-width: 16ch; font-size: var(--asili-size-body); line-height: 1.4; color: var(--ink); text-wrap: balance; }
.brew__buttons { margin-top: var(--s-6); flex-wrap: wrap; gap: var(--s-3); }
.brew__buttons .btn[aria-disabled="true"] { opacity: var(--asili-disabled); cursor: default; }
@media (forced-colors: active) {
  .brew__readout { border: var(--asili-hairline) solid CanvasText; }
  .brew__arc { stroke: Highlight; }
  .brew__track, .brew__ticks line { stroke: CanvasText; }
}
@media (min-width: 1280px) {
  .brew__recipe { margin-top: var(--s-8); }
  .brew__steps > li { padding-block: var(--s-5); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .brew__recipe { margin-top: var(--s-5); }
  .brew__steps > li { padding-block: var(--s-1); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  #brew .brew > .brew__text { grid-column: 1 / span 6; }
  #brew .brew > .brew__panel { grid-column: 7 / span 6; }
}
@media (max-width: 639px) {
  .brew__steps > li { grid-template-columns: var(--asili-step-when-phone) minmax(0, 1fr); gap: var(--s-3); padding-block: var(--s-3); }
  .brew__recipe { margin-top: var(--s-6); }
}

/* ---------------------------------------------------------------- #faq */
#faq .faq > .faq__item { padding-block: var(--asili-faq-pad); }
@media (min-width: 1024px) and (max-width: 1279px) { #faq .faq > .faq__item { padding-block: var(--s-4); } }
@media (max-width: 639px) { #faq .faq > .faq__item { padding-block: var(--s-2); } #faq .split > :first-child { margin-bottom: var(--s-4); } }
#faq .faq > .faq__item:first-child { padding-top: 0; }
.faq .faq__item > h3 { color: var(--ink); }

/* ---------------------------------------------------------------- footer.closing: close-type, the newsletter, the columns */
/* At 1280 and wider the kit holds the footer to one screen and the close and the links fit it (900px at 1440x900,
   800px at 1280x800). From 640 to 1279 the kit lets it grow past one screen when its content needs it: one screen at
   768x1024, but 840px (EN), 858px (NL) and 888px (FR) at 1024x768. On a phone they cannot share one (the close, the
   newsletter and four link columns run to about 1.3 screens), and padding them to two screens left 628px of empty
   ground under the close. So on a phone the footer takes its natural height: the close, then the links, with no screen padding
   and no forced two screens (coordinator ruling, fix wave 3). The section-height finding this leaves (at 390, and
   at 1024x768 where the kit's own tablet rule lets the footer grow) is waived in .taste-skill/waivers.json. */
@media (max-width: 639px) {
  footer.closing { min-height: 0; }
  footer.closing > .wrap { grid-template-rows: auto auto; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  footer.closing .closing__cta.close--type > .btn--xl { align-self: start; width: auto; height: var(--btn-h); font: 500 var(--t-body)/1 var(--font-text); letter-spacing: 0; }
}
.footer__company > .footer__lede { max-width: 30ch; }
.news { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--s-3); row-gap: var(--s-2); max-width: var(--asili-news-w); }
.news > .field { grid-column: 1; }
.news > .btn-row { grid-column: 2; }
.news > .form__status { grid-column: 1 / -1; }
.news .field label { font: 400 var(--asili-size-label)/1.4 var(--asili-font-mono); color: var(--muted); }
.footer__legal { align-items: center; }
.footer__legal .lang { margin-left: auto; }
@media (max-width: 639px) {
  .lang button { min-width: var(--asili-lang-h-touch); height: var(--asili-lang-h-touch); }
  .footer__logo.asili-logo { --logo-w: var(--asili-logo-nav); }
}
/* ---------------------------------------------------------------- the kit's placeholder guard
   system.js outlines in red every img whose alt says "Placeholder" (system.css [data-placeholder]). Here the
   placeholders are mandated by prototypes-combined/AGENTS.md (photographs are PLACEHOLDER files until the client
   supplies them), and the sample-label waiver in .taste-skill/waivers.json records it. Only the outline goes, and
   only on our own PLACEHOLDER files: a genuinely broken image still shows the kit's red flag. The attribute stays,
   and the checker still counts them through html[data-placeholders]. */
img[data-placeholder][src*="PLACEHOLDER"] { outline: none; }
