/* BakLover page CSS. The system (grid, type scale, buttons, nav, forms, motion) is the kit's in /assets/;
   this file holds the brand tokens, the faces, and the few things that sit inside a visual. Linked after the kit. */

/* ------------------------------------------------------------------ faces (self-hosted: no third-party requests) */
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

/* ------------------------------------------------------------------ tokens
   The brand's anchors (brand identity.md), then the kit's palette slots as `start.mjs brand` printed them, with
   two changes for contrast: on cream the action is espresso and the accent is a deeper coral (coral itself is
   2.3:1 on cream); on espresso the action and accent are the brand coral with an espresso label (5.9:1). */
:root {
  --bl-espresso: #30221f;
  --bl-cream: #fff2de;
  --bl-coral: #e88670;
  --bl-coral-deep: #a9472f;      /* coral darkened for text and marks on cream: 5.2:1 */
  --bl-pistachio: #a6b879;
  --bl-gold: #f5d77e;
  --bl-gold-toasted: #d99a38;

  --p-bg: #fff2de; --p-surface: #f3e6d3; --p-ink: #30221f; --p-muted: #72645b;
  --p-accent: #a9472f; --p-accent-ink: #fff2de; --p-action: #30221f; --p-action-ink: #fff2de;
  --p-inv-bg: #30221f; --p-inv-surface: #3c2e2a; --p-inv-ink: #fff2de; --p-inv-muted: #aa9c8f;
  --p-inv-accent: #e88670; --p-inv-accent-ink: #30221f; --p-inv-action: #e88670; --p-inv-action-ink: #30221f;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-text: "Instrument Sans", system-ui, sans-serif;
  --display-weight: 400;
  --display-tracking: -0.012em;
  --display-tracking-xl: -0.016em;
  --ly-scale: 1.12;
}

/* ------------------------------------------------------------------ the wordmark: artwork at its own proportions */
.nav__logo img.logo { height: 40px; width: auto; }
.footer__logo img.logo { height: 36px; width: auto; }
@media (max-width: 639px) { .nav__logo img.logo { height: 32px; } }
/* the narrowest phones: the bar holds the wordmark and the menu; the main action is in the sheet and the hero */
@media (max-width: 419px) {
  .nav:not(.is-open) .nav__actions { display: none; }
  .nav:not(.is-open) .nav__actions + .nav__toggle { margin-left: auto; }
}

/* ------------------------------------------------------------------ splits: text left, the visual right, top-aligned */
.grid.split { align-items: start; }

/* ------------------------------------------------------------------ the hero's picture
   A panel one step lighter than the espresso, top-aligned with the h1, holding the brand's own artwork:
   the mascot inside two fine diamonds that echo its shape, or the tray figure. */
.hero-visual.frame { border: 0; background: var(--p-inv-surface); }
.hero-mascot { --m: 300px; }
@media (min-width: 1280px) { .hero-mascot { --m: 360px; } }
.hero-visual.hero-mascot > .hero-mascot__ring, .hero-visual.hero-mascot > .hero-mascot__img { position: absolute; inset: 0; margin: auto; }
.hero-mascot__ring { width: calc(var(--m) * 1.12); height: calc(var(--m) * 1.12);
  border: 1px solid color-mix(in oklab, var(--bl-cream) 20%, transparent); transform: rotate(45deg); pointer-events: none; }
.hero-mascot__ring + .hero-mascot__ring { width: calc(var(--m) * 0.82); height: calc(var(--m) * 0.82); border-color: color-mix(in oklab, var(--bl-coral) 40%, transparent); }
.hero-mascot__img { z-index: 1; width: var(--m); height: var(--m); object-fit: contain; }
@media (max-width: 1023px) {
  .hero-mascot__ring { display: none; }
  .hero-mascot__img { width: auto; height: 84%; max-height: 300px; max-width: 70%; }
}

/* ------------------------------------------------------------------ the tray figure */
.tray { container-type: inline-size; width: 100%; }
.tray .tray__base { fill: var(--bl-gold); }
.tray .tray__rim { fill: none; stroke: var(--bl-gold-toasted); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tray__count { position: absolute; margin: 0; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 0.6cqw;
  color: var(--bl-espresso); text-align: center; white-space: nowrap; }
.tray__num { font: 400 27cqw/0.82 var(--font-display); letter-spacing: -0.03em; }
.tray__unit { font: 500 max(13px, 2.9cqw)/1.2 var(--font-text); }
.hero-tray .tray { flex: 1 1 100%; max-width: 560px; }

/* ------------------------------------------------------------------ the layers ornament */
.layers { flex: none; }
.layers path { fill: none; stroke-width: 2; stroke-linecap: round; }
.layers__gold { stroke: var(--bl-gold-toasted); }
.layers__nut { stroke: var(--bl-pistachio); }

/* ------------------------------------------------------------------ lists set as editorial rows */
.trade .rows__name, .terms h3, .serving__head { font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.trade .rows__name { font-size: clamp(28px, 1.1vw + 20px, 36px); }
.trade > li { gap: var(--s-3) var(--s-5); padding-block: var(--s-7); }
.trade > li > p { font-size: var(--t-lead); }
.terms { row-gap: var(--s-8); }
.terms > div { padding-top: var(--s-5); border-top: 1px solid var(--line-strong); }
.terms p { font-size: var(--t-lead); line-height: 1.5; max-width: 40ch; }

.next { margin: var(--s-6) 0 0; padding-left: 1.25em; display: grid; gap: var(--s-3); }
.next__title { font-weight: 500; }

.hero-facts-col { align-self: start; }
.hero-facts-col .rows > li { padding-block: var(--s-5); }

/* ------------------------------------------------------------------ the enquiry form's panel */
.form-panel { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-7); }
@media (max-width: 639px) { .form-panel { padding: var(--s-5); } }
.field__optional { font-weight: 400; color: var(--muted); }
.enquiry { position: relative; }
.enquiry__trap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.enquiry .t-small a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ plain document pages (privacy, form results) */
main > section.prose-page { height: auto; min-height: 100svh; }
.prose { max-width: 68ch; display: grid; gap: var(--s-4); }
.prose h1 { font-size: var(--t-h1); margin-bottom: var(--s-4); }
.prose h2 { font: 500 var(--t-lead)/1.4 var(--font-text); letter-spacing: 0; margin-top: var(--s-5); }
.prose a:not(.link) { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ section reveals
   A section's content settles as it enters the screen: opacity and a short rise, tied to the scroll position by
   the browser itself (no script), so it can never leave content hidden. Browsers without scroll-driven
   animations, reduced motion and print show every section as written. Phones get the opacity only. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    main > .section:not(.statement, .prose-page) > .wrap,
    .closing__cta {
      animation: bl-reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 24%;
    }
    @keyframes bl-reveal {
      from { opacity: 0.4; transform: translateY(20px); }
      to { opacity: 1; transform: none; }
    }
    @media (max-width: 639px) {
      @keyframes bl-reveal { from { opacity: 0.4; } to { opacity: 1; } }
    }
  }
}

/* ------------------------------------------------------------------ the tablet (640 to 1023)
   Each section keeps to its screen:  the footer's three columns run from line to line. */
@media (min-width: 640px) and (max-width: 1023px) {
  .closing__links .grid > .span-6 { grid-column: 1 / -1; }
  .closing__links .grid > .footer__col { grid-column: auto / span 4; }
}

/* ------------------------------------------------------------------ photographs in sections (public/photos) */
.trade__photo { aspect-ratio: 3 / 2; margin-top: var(--s-7); }
.serving__photo { aspect-ratio: 16 / 7; }
.trade__photo > img, .serving__photo > img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------------ the hero's words */
.hero-line { display: block; }
.hero-eyebrow { display: block; margin-bottom: var(--s-5); font: 500 var(--t-small)/1.4 var(--font-text); letter-spacing: 0.01em; color: var(--bl-coral); }
.hero-accent { color: var(--bl-coral); }
.hero-aside { font-size: var(--t-small); color: var(--ink); max-width: 44ch; }

/* ------------------------------------------------------------------ our story: editorial type beside one picture */
.story { display: grid; gap: var(--s-5); align-content: start; }
.story__label { display: flex; align-items: center; gap: var(--s-3); }
.story__lead { font: var(--display-weight) clamp(22px, 0.9vw + 16px, 30px)/1.3 var(--font-display); letter-spacing: var(--display-tracking); max-width: 26em; }
.story__said { color: #7f3220; }   /* the brand coral taken down to 7.9:1 on cream, so the line passes as body text at every size */
.story > p:not([class]) { font-size: var(--t-lead); line-height: 1.6; max-width: 34em; }
.story__close { font-weight: 500; font-size: var(--t-lead); padding-top: var(--s-5); border-top: 1px solid var(--line-strong); max-width: 34em; }
.story__photo { aspect-ratio: 1 / 1; }
.story__photo > img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px) { .story__photo { aspect-ratio: 3 / 2; } }

/* ------------------------------------------------------------------ the tasting sequence
   Three steps joined by one line. At rest (no script, reduced motion, print) the line is full and every step
   carries its accent. With site.js running, the line fills with the scroll (--seq-p, 0 to 1) and a step takes
   its accent when the line reaches it; steps not yet reached stay in full ink, never faded. */
ol.seq { list-style: none; margin: 0; padding: var(--s-7) 0 0; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); --seq-p: 1; }
.seq::before, .seq::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px; }
.seq::before { background: var(--line-strong); }
.seq::after { background: var(--accent); transform: scaleX(var(--seq-p)); transform-origin: left center; }
.seq__step { position: relative; display: grid; gap: var(--s-3); align-content: start; padding-right: var(--s-5); }
.seq__step::before { content: ""; position: absolute; left: 0; top: calc(-1 * var(--s-7)); width: 12px; height: 12px; border-radius: 50%; z-index: 1;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg); transition: background-color 300ms var(--ease), transform 300ms var(--ease); }
.seq__num { font: var(--display-weight) clamp(48px, 3.2vw + 28px, 84px)/1 var(--font-display); letter-spacing: var(--display-tracking-xl); color: var(--accent); transition: color 300ms var(--ease); }
.seq__step h3 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; color: var(--accent); transition: color 300ms var(--ease); }
.seq__step p { font-size: var(--t-lead); line-height: 1.5; max-width: 28ch; }
.seq--live .seq__step:not(.is-on) :is(.seq__num, h3) { color: var(--ink); }
.seq--live .seq__step:not(.is-on)::before { background: var(--line-strong); transform: scale(0.75); }
.seq__cta { margin-top: var(--s-8); }
@media (max-width: 767px) {
  ol.seq { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-7); padding: 0 0 0 var(--s-7); }
  .seq::before, .seq::after { left: 5px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .seq::after { transform: scaleY(var(--seq-p)); transform-origin: center top; }
  .seq__step { padding-right: 0; }
  .seq__step::before { left: calc(-1 * var(--s-7)); top: 0.9em; }
  .seq__cta { margin-top: var(--s-7); }
}
@media (prefers-reduced-motion: reduce) { .seq__step::before, .seq__num, .seq__step h3 { transition: none; } }

/* ------------------------------------------------------------------ questions: a compact accordion
   Native <details>, so it opens by click, Enter or Space and every answer is in the page from the start. */
main > section:is(#tasting, #questions) { height: auto; min-height: 0; }
main > section#tasting { padding-bottom: 0; }
.qa { border-top: 1px solid var(--line-strong); }
.qa__item { border-bottom: 1px solid var(--line); }
.qa__item > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: 64px; padding: var(--s-4) 0; cursor: pointer; list-style: none; }
.qa__item > summary::-webkit-details-marker { display: none; }
.qa__item > summary h3 { font: 500 var(--t-lead)/1.4 var(--font-text); letter-spacing: 0; }
.qa__item > summary::after { content: ""; flex: none; width: 14px; height: 14px; transition: transform 200ms var(--ease);
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat; }
.qa__item[open] > summary::after { transform: rotate(45deg); }
.qa__item > summary:hover h3 { color: var(--accent); }
.qa__item > p { padding: 0 var(--s-7) var(--s-5) 0; max-width: 60ch; }
@media (prefers-reduced-motion: reduce) { .qa__item > summary::after { transition: none; } }

/* a phone's first screen: the hero's words, both actions and the photograph end inside it */
@media (max-width: 639px) {
  .hero-copy > * + * { margin-top: var(--s-4); }
  .hero-copy > .btn-row { margin-top: var(--s-5); }
  .hero-split > .hero-visual { min-height: 140px; }
  .hero-text.hero-split { gap: var(--s-5); }
}
