/*
  c-b-blue-print: page CSS for direction B (blue type on paper).
  The :root block below holds every colour, font, size and spacing value this page adds, as --asili-*
  tokens, so they can move into asili-tokens.css later. The rules under it use only tokens (the kit's or
  these), never a raw colour or font size.
*/
:root {
  /* colours (contrast ratios in the report) */
  --asili-paper: #F2EDE3;          /* the page */
  --asili-raised: #FBF8F2;         /* cards, inputs */
  --asili-paper-deep: #E7E0D2;     /* placeholder fields (the img/PLACEHOLDER-*.svg files use it), quiet surfaces */
  --asili-ink: #1F1E6E;            /* running text */
  --asili-cobalt: #3A39B8;         /* the logo's blue: headings, display type, links, primary buttons, the band */
  --asili-muted: #4B4A99;          /* muted text, the statement's unlit words */
  --asili-cherry-text: #B42A26;    /* rare text: errors */
  --asili-cherry-mark: #C8302B;    /* small round marks only, never text, never on cobalt */
  --asili-on-cobalt-muted: #C9CDF5;/* quiet text on the cobalt band */
  --asili-line-control: #7470A8;   /* control borders: 3:1 or more on paper and raised */

  /* fonts */
  --asili-font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --asili-font-text: "Newsreader", Georgia, "Times New Roman", serif;

  /* type sizes */
  --asili-size-body: 1.0625rem;                                   /* 17px: Newsreader reads small at 16 */
  --asili-size-h3: clamp(1.25rem, 1.157rem + 0.381vw, 1.5rem);    /* 20 at 390, 24 at 1440: every h3 one size */
  --asili-size-meta: 0.875rem;                                    /* 14px: facts lines, the language codes */
  --asili-size-statement: clamp(2.25rem, 1.6rem + 3vw, 4.5rem);   /* 37 at 390, 56 at 1024, 69 at 1440 */
  --asili-size-statement-tablet: 9.5vw;                           /* 73 at 768, 78 at 820: the poster fills a tall tablet screen */
  --asili-ly-scale-phone: 0.85;                                   /* Bricolage runs wide: the hero h1 at 34px on a phone keeps two lines */
  --asili-leading-statement: 1.08;

  /* sizes and spacing */
  --asili-logo-nav: 7.5rem;          /* 120 x 44 in the bar */
  --asili-dot: 0.625rem;             /* the roast marks */
  --asili-dot-gap: 0.25rem;
  --asili-dot-border: 0.09375rem;    /* 1.5px */
  --asili-rule: 0.125rem;            /* 2px: the pressed language's underline */
  --asili-hairline: 1px;             /* the profile's and the journey steps' rules */
  --asili-measure-statement: 13em;   /* the statement's measure: about 30 characters a line */
  --asili-measure-statement-laptop: 11em;
  --asili-hero-pic-min: 15rem;       /* the phone hero's picture never shorter than this */
  --asili-underline-offset: 0.375rem;
  --asili-tap: 2.75rem;              /* 44px tap target */
  --asili-tap-compact: 2.25rem;      /* 36px: the bar's codes on a small laptop, where the centred words leave less room */
  --asili-tap-narrow: 1.875rem;      /* 30px wide (still 44 tall): the bar's codes on a phone narrower than 360 */
  --asili-fade: 480ms;               /* the journey frame's crossfade */
  --asili-settle: 900ms;             /* the journey picture settling from 1.03 */
}

/* ---------------------------------------------------------------- the kit's tokens, mapped */
:root {
  --font-text: var(--asili-font-text);
  --t-body: var(--asili-size-body);
}
html { font-synthesis: none; }
::selection { background: var(--asili-cobalt); color: var(--asili-paper); }

/* grotesk headings in cobalt over a serif text; buttons, labels and the nav in the grotesk too */
h1, h2, h3 { color: var(--accent); }
h3 { font-size: var(--asili-size-h3); line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; }
.btn, .nav__link, .nav__toggle, .skip-link, .t-label, .rows__name, .field, .footer__lede,
.footer :is(h3, h4):not(.closing__cta *), .footer :is(ul, .footer__legal) {
  font-family: var(--asili-font-display);
}
.t-label { color: var(--muted); }
/* a heading block in a grid row sits at the top of its cell, its line right under the h2 */
.grid > .section-head { align-self: start; align-content: start; }
/* the pill secondary gets an outline that holds 3:1 on paper and raised (the brief's control-border rule), at every
   width: on a phone the kit's pill look keeps its tinted fill, so the outline marks it there too */
html[data-buttons="pill"] .btn--secondary { border-color: var(--asili-line-control); }
html[data-buttons="pill"] .btn--secondary:hover { border-color: var(--asili-ink); }

/* ---------------------------------------------------------------- nav */
.nav__logo.asili-logo { --logo-w: var(--asili-logo-nav); }
asili-nav { display: none; }
/* the language switch: three codes, the pressed one underlined in the accent */
.asili-lang [role="group"] { display: flex; align-items: center; }
.asili-lang button {
  min-width: var(--asili-tap); height: var(--asili-tap); padding: 0 var(--s-2); border: 0; border-radius: var(--r-btn);
  background: none; color: var(--muted); cursor: pointer;
  font: 500 var(--asili-size-meta)/1 var(--asili-font-display); letter-spacing: 0.02em;
  transition: color var(--dur) var(--ease);
}
.asili-lang button:hover { color: var(--ink); }
.asili-lang button[aria-pressed="true"] {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: var(--asili-rule); text-underline-offset: var(--asili-underline-offset);
}
/* the pressed code answers the pointer too, as the bar's first item */
.asili-lang button[aria-pressed="true"]:hover { color: var(--ink); }
/* the bar's codes sit right after the logo at every width; in the nav-centre grid (1024 and up) they share the logo's
   column, so the words stay centred and the button keeps the right line */
.asili-lang--bar { flex: none; }
@media (min-width: 1024px) {
  .nav--centre .asili-lang--bar { grid-column: 1; grid-row: 1; justify-self: start; margin-left: calc(var(--asili-logo-nav) + var(--s-3)); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .asili-lang--bar button { min-width: var(--asili-tap-compact); padding: 0; }
}
@media (max-width: 359px) {
  .asili-lang--bar button { min-width: var(--asili-tap-narrow); padding: 0; }
}
/* the menu button's own close state where system.js does not run (file://); over http system.js swaps the icon */
.nav__toggle .asili-icon-cross { display: none; }
.nav__toggle[aria-expanded="true"] .asili-icon-bars { display: none; }
.nav__toggle[aria-expanded="true"] .asili-icon-cross { display: inline; }

/* ---------------------------------------------------------------- hero */
/* a phone: the photograph at 4:3 under the words, so the hero stays one screen (the kit's demo does the same) */
@media (max-width: 639px) {
  :root { --ly-scale: var(--asili-ly-scale-phone); }
  /* a phone: the photograph takes what the words leave of the first screen, down to a margin above the fold */
  .hero--product .hero__stage { aspect-ratio: auto; flex: 1 1 auto; min-height: var(--asili-hero-pic-min); }
  .hero--product .hero__stage:has(> img:not(.is-cutout), > picture) { margin-bottom: var(--s-7); }
}
/* a tablet: the photograph stops above the fold too, so the gap to the range matches the page's other gaps */
@media (min-width: 640px) and (max-width: 1023px) {
  .hero--product .hero__stage:has(> img:not(.is-cutout), > picture) { margin-bottom: 0; }
}

/* ---------------------------------------------------------------- the head row: the h2 on the left, its line on the
   page's split line (the hero's: column 9 from 1280, column 7 from 1024), its foot on the h2's foot */
.section-head.asili-head {
  max-width: none; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--s-4); align-items: end;
}
.asili-head > h2 { grid-column: 1 / span 7; }
.asili-head > p { grid-column: 9 / -1; max-width: none; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .asili-head > h2 { grid-column: 1 / span 6; }
  .asili-head > p { grid-column: 7 / -1; }
}
@media (max-width: 1023px) { .asili-head > :is(h2, p) { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- range: three sample coffees */
/* system.js outlines an img whose alt says "Placeholder" (system.css [data-placeholder]). The img/PLACEHOLDER-*.svg
   files are mandated by prototypes-combined/AGENTS.md until the client's photographs arrive, and the sample-label
   waiver records it, so their honest alt text stays and the outline goes; a genuinely broken image keeps the flag */
img[data-placeholder][src*="PLACEHOLDER"] { outline: none; }
.asili-coffee { padding: 0; gap: 0; overflow: clip; background: var(--asili-raised); }
.asili-coffee__media { position: relative; overflow: clip; aspect-ratio: 3 / 2; }
.asili-coffee__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.asili-coffee__body { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-5); }
.asili-coffee__body > h3 { font-family: var(--asili-font-display); font-size: var(--asili-size-h3); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.asili-coffee__facts { color: var(--muted); font: 400 var(--asili-size-meta)/1.4 var(--asili-font-display); }
.asili-coffee__notes { color: var(--ink); }
.asili-roast { font: 400 var(--asili-size-meta)/1.4 var(--asili-font-display); }
.asili-roast__label { color: var(--muted); margin-right: var(--s-2); }
.asili-dots { display: inline-flex; gap: var(--asili-dot-gap); margin-right: var(--s-2); vertical-align: 0.05em; }
.asili-dots > i { width: var(--asili-dot); height: var(--asili-dot); border-radius: 50%; border: var(--asili-dot-border) solid var(--asili-line-control); }
.asili-dots > i.is-on { background: var(--asili-cherry-mark); border-color: var(--asili-cherry-mark); }
/* acidity, body and sweetness read as one line of text, label then value */
.asili-profile { margin: var(--s-1) 0 0; padding-top: var(--s-3); border-top: var(--asili-hairline) solid var(--line); font: 400 var(--asili-size-meta)/1.6 var(--asili-font-display); }
.asili-profile > div { display: inline; margin-right: var(--s-4); white-space: nowrap; }
.asili-profile dt { display: inline; color: var(--muted); margin-right: var(--s-1); }
.asili-profile dd { display: inline; margin: 0; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
/* a tablet: the three stay side by side, so the range keeps one screen; the bags stand taller */
@media (min-width: 640px) and (max-width: 1023px) {
  .asili-range > .asili-coffee { grid-column: auto / span 4; }
  .asili-coffee__media { aspect-ratio: 4 / 5; }
  .asili-coffee__body { padding: var(--s-4); }
}
@media (max-width: 639px) {
  #range { --hm: 2; }
  .asili-coffee__media { aspect-ratio: 2 / 1; }
  .asili-coffee__body { padding: var(--s-4); }
}

/* ---------------------------------------------------------------- the statement (asili-statement.js) */
.asili-statement-section .wrap > .t-label { margin-bottom: var(--s-5); }
asili-statement { display: block; }
.asili-statement__text {
  font-family: var(--asili-font-display); font-weight: var(--display-weight); font-stretch: var(--display-stretch, 100%);
  font-size: var(--asili-size-statement); line-height: var(--asili-leading-statement); letter-spacing: var(--display-tracking);
  max-width: var(--asili-measure-statement); color: var(--asili-cobalt); text-wrap: pretty; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 10 4 4;
}
@media (min-width: 640px) and (max-width: 1023px) {
  .asili-statement__text { font-size: var(--asili-size-statement-tablet); }
}
/* live: the sentence rests in the muted blue and its lit words (one custom highlight) turn cobalt */
asili-statement.is-live > .asili-statement__text { color: var(--asili-muted); }
::highlight(asili-statement) { color: var(--asili-cobalt); }
@media (min-width: 1024px) and (max-width: 1279px) { .asili-statement__text { max-width: var(--asili-measure-statement-laptop); } }
.asili-statement__more { margin-top: var(--s-7); }

/* ---------------------------------------------------------------- one bag or a subscription */
.asili-ways .rows__name { color: var(--ink); }
@media (min-width: 640px) and (max-width: 1023px) { #subscribe .frame--split { --ratio: 50%; margin-top: var(--s-7); } }
/* a phone: two screens (.g2m), the words on the first and the picture filling the second */
@media (max-width: 639px) { #subscribe .frame--split { --ratio: 0px; height: 100%; } }

/* ---------------------------------------------------------------- the journey on the cobalt band (asili-origin-steps.js) */
.asili-band {
  --bg: var(--asili-cobalt); --surface: var(--asili-cobalt); --card: var(--asili-cobalt);
  --ink: var(--asili-paper); --muted: var(--asili-on-cobalt-muted);
  --accent: var(--asili-paper); --accent-ink: var(--asili-cobalt);
  --action: var(--asili-paper); --action-ink: var(--asili-cobalt);
}
.asili-band .section-head p { color: var(--ink); }
asili-origin-steps { display: block; }
.journey__steps { counter-reset: none; }
.journey__step { display: grid; align-content: start; gap: var(--s-2); }
.journey__num { display: block; margin-bottom: var(--s-2); color: var(--muted); font: 500 var(--t-label)/1.4 var(--asili-font-display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.journey__step > h3 { color: var(--ink); font-family: var(--asili-font-display); }
.journey__step > p { color: var(--ink); max-width: 40ch; }
.journey__pic { margin: var(--s-3) 0 0; overflow: clip; border-radius: var(--r-lg); aspect-ratio: 16 / 9; }
.journey__pic > img { width: 100%; height: 100%; object-fit: cover; }
.journey__stage { display: none; }

/* at rest (no script, reduced motion, a phone): every step stands with its picture under it */
@media (min-width: 640px) {
  .journey:not(.is-live) .journey__steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--gutter); }
  .journey:not(.is-live) .journey__group + .journey__group { margin-top: var(--s-7); }
}
@media (max-width: 639px) {
  .journey__steps { display: grid; gap: var(--s-7); }
  .journey__group + .journey__group { margin-top: var(--s-7); }
  .journey__pic { aspect-ratio: 16 / 7; }
}

/* live (640px and wider, motion allowed): the steps run down two screens on the left, two to a screen (the first
   screen under the heading), and one frame holds on the right showing the picture of the step in view */
.journey.is-live { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.journey.is-live > .journey__text {
  grid-column: 1 / span 5; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  row-gap: calc(var(--padt) + var(--padb) + var(--bar)); min-height: 0;
}
.journey.is-live .journey__group { display: flex; flex-direction: column; min-height: 0; }
.journey.is-live .journey__steps { flex: 1 1 auto; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 0; }
/* each step under a quiet rule; the steps themselves never change as the page scrolls, only the frame does */
.journey.is-live .journey__step { padding-top: var(--s-4); border-top: var(--asili-hairline) solid color-mix(in oklab, var(--ink) 40%, transparent); }
.journey.is-live > .journey__stage {
  grid-column: 7 / -1; align-self: start; display: block; position: sticky; top: var(--padt);
  width: 100%; aspect-ratio: 4 / 5; max-height: calc(100svh - var(--padt) - var(--padb) - var(--bar));
  overflow: clip; border-radius: var(--r-lg);
}
.journey.is-live .journey__stage > .journey__pic {
  position: absolute; inset: 0; margin: 0; border-radius: 0; aspect-ratio: auto;
  opacity: 0; visibility: hidden; transform: scale(1.03);
  transition: opacity var(--asili-fade) var(--ease), transform var(--asili-settle) var(--m-ease-enter, var(--ease)), visibility 0s linear var(--asili-fade);
}
.journey.is-live .journey__stage > .journey__pic.is-on { opacity: 1; visibility: visible; transform: none; z-index: 1; transition-delay: 0s; }
/* a tablet: a narrower text column and a frame as tall as the screen allows, so the picture keeps its share */
@media (min-width: 640px) and (max-width: 1023px) {
  .journey.is-live > .journey__text { grid-column: 1 / span 5; }
  .journey.is-live > .journey__stage { grid-column: 6 / -1; aspect-ratio: auto; height: calc(100svh - var(--padt) - var(--padb) - var(--bar)); }
}
@media (prefers-reduced-motion: reduce) {
  .journey .journey__pic { transition: none; }
}

/* ---------------------------------------------------------------- questions: a full-width list, text only
   each question on the left, its answer on the page's split line (column 9 from 1280, column 7 from 1024); one
   screen at every width */
.asili-faq > .faq__item > h3 { color: var(--accent); font: 500 var(--asili-size-h3)/1.3 var(--asili-font-display); letter-spacing: -0.01em; }
/* a screen holds the four with room to spare, so the rows open up (less from 1024 to 1279, where the screen is
   short, still enough to keep the gap to #brew near the page's others); a phone tightens them so the four stay on
   one screen in all three languages */
@media (min-width: 640px) and (max-width: 1023px), (min-width: 1280px) {
  .asili-faq > .faq__item { padding-block: var(--s-7); }
  .asili-faq > .faq__item:first-child { padding-top: 0; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .asili-faq > .faq__item { padding-block: var(--s-6); }
  .asili-faq > .faq__item:first-child { padding-top: 0; }
}
@media (max-width: 639px) {
  .asili-faq > .faq__item { padding-block: var(--s-3); }
  .asili-faq > .faq__item:first-child { padding-top: 0; }
}
@media (min-width: 1024px) {
  .asili-faq > .faq__item { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
  .asili-faq > .faq__item > h3 { grid-column: 1 / span 7; }
  .asili-faq > .faq__item > p { grid-column: 9 / -1; max-width: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .asili-faq > .faq__item > h3 { grid-column: 1 / span 6; }
  .asili-faq > .faq__item > p { grid-column: 7 / -1; }
}

/* ---------------------------------------------------------------- brew: tall-small (sections.md section 4)
   brewing at home tall, the h2, its line and link with the cup 1:1 under them, its foot level with the tall one's.
   Mirrored from the recipe: the checker starts every h2 on the container's left (SR-6), so the words and the small
   one take the left column and the tall one the split's right line (column 7) */
#brew > .wrap.asili-ts { grid-template-rows: minmax(0, 1fr); align-content: stretch; }
.asili-ts > .asili-ts__side {
  grid-column: 1 / span 5; grid-row: 1; min-height: 0;
  display: grid; grid-template-columns: subgrid; grid-template-rows: auto minmax(0, 1fr); row-gap: var(--s-6);
}
.asili-ts__head { grid-column: 1 / -1; margin-bottom: 0; display: grid; gap: var(--s-4); justify-items: start; }
.asili-ts__small { grid-column: 1 / span 4; align-self: end; --ratio: 100%; }
.asili-ts > .asili-ts__tall { grid-column: 7 / -1; grid-row: 1; --ratio: 0px; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .asili-ts > .asili-ts__side { grid-column: 1 / span 6; }
}
/* a tablet and a phone: the words across, then the tall one and the small one side by side, tops level */
@media (max-width: 1023px) {
  #brew > .wrap.asili-ts { grid-template-rows: auto auto; align-content: start; row-gap: var(--s-6); }
  .asili-ts > .asili-ts__side { display: contents; }
  .asili-ts__head { grid-column: 1 / -1; grid-row: 1; }
  .asili-ts > .asili-ts__tall { grid-column: 1 / span 7; grid-row: 2; --ratio: 125%; }
  .asili-ts__small { grid-column: 9 / -1; grid-row: 2; align-self: start; }
}
@media (max-width: 639px) {
  .asili-ts > .asili-ts__tall { --ratio: 150%; }
  .asili-ts__small { grid-column: 8 / -1; }
}
/* ---------------------------------------------------------------- the close and the footer */
/* close-word: the head row (the h2 and its line left, the button on the right line), then the client's logo file set
   across the .wrap through its CSS frame (469px tall at 1280, 125 on a phone). Close and links cannot share one screen
   at 1024 and up, and two screens would leave empty ground (coordinator ruling, round 2): the close is one screen, the
   logo at its foot as the kit sets the name, and the links follow at their own height. From 640 to 1023 both fit the
   kit's one screen; on a phone the logo follows the head row and the links follow it, at their own height */
.asili-close__logo { --logo-w: 100%; margin-top: auto; }
/* the close's button changes only its fill on hover, so its colour never needs a transition; without one, the
   checker's own text-hiding pass (consistency.mjs hideText) cannot restore its colour under system.js's phone-bar
   watch and read that as a reveal on scroll (html and .btn outweigh motion.css's html:not([data-motion="off"]) .btn) */
html .closing__cta .btn.btn--primary { transition-property: background-color, border-color, box-shadow, transform; }
@media (min-width: 1024px) {
  footer.closing { height: auto; min-height: 0; }
  footer.closing > .wrap { height: auto; grid-template-rows: auto auto; }
  footer.closing > .wrap > .closing__cta {
    min-height: calc(100vh - var(--padt) - var(--padb) - var(--bar));
    min-height: calc(100svh - var(--padt) - var(--padb) - var(--bar));
  }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .footer .closing__links .grid > .asili-news { grid-column: auto / span 6; }
}
/* 1024 and up: 3/2/2/5, the newsletter wider from the split pair's last line (column 8) */
@media (min-width: 1024px) {
  .closing__links .grid > .asili-foot__lede { grid-column: 1 / span 3; }
  .closing__links .grid > .asili-news { grid-column: 8 / -1; }
}
@media (max-width: 639px) {
  footer.closing { min-height: 0; }
  footer.closing > .wrap { grid-template-rows: auto auto; }
  .asili-close__logo { margin-top: 0; }
  .asili-news__row { flex-direction: column; }
  .asili-news__row > .btn { width: 100%; }
}
.asili-news h3 { margin-bottom: var(--s-3); }
.asili-news__form { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.asili-news__row { display: flex; gap: var(--s-3); }
.asili-news__row > input { flex: 1 1 auto; min-width: 0; height: var(--btn-h); border-color: var(--asili-line-control); background: var(--asili-raised); }
.asili-news__row > .btn { flex: none; }
.form { --error: var(--asili-cherry-text); }
.footer__legal { align-items: center; }
