/* ==========================================================================
   Bucareli Chocolate — site stylesheet
   Palette and typography per BrandGuidelines.pdf
   Brown   #4B1F10   rgb(75,31,16)     CMYK 43,79,84,65
   Paper   #F7F4F2   the ground — Bucareli's off-white, in place of pure white
   Silver  #B2B3B7   rgb(178,179,183)  CMYK 31,24,22,0
   Ember   #8C3623   rgb(140,54,35)    CMYK 29,86,93,29
   Type    Futura PT (Book / Heavy) — primary
           Theano Didot (Regular)    — secondary
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --brown:        #4B1F10;  /* the fill inside the supplied logo artwork */
  --brown-deep:   #35150a;  /* darker brown for layered dark sections */
  --ember:        #8C3623;
  --silver:       #B2B3B7;
  /* Nothing on the site is pure #FFF. The ground is Bucareli's warm off-white;
     --white is a warmed off-white used for type and marks on the brown. */
  --white:        #FBF9F7;
  --paper:        #F7F4F2;  /* page ground */
  --paper-deep:   #EFE9E5;  /* alternating bands, one step deeper */
  --rule:         rgba(75, 31, 16, .16);
  --rule-light:   rgba(255, 255, 255, .22);

  /* Futura PT first, so an Adobe Fonts kit takes over automatically if added.
     Jost is the free Google Fonts geometric stand-in. */
  --sans:  "Futura PT", "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --serif: "Theano Didot", "Didot", "Bodoni MT", Georgia, serif;

  --measure: 62ch;
  --gutter:  clamp(1.25rem, 5vw, 5rem);
  --max:     1240px;

  --step--1: clamp(.78rem, .75rem + .15vw, .86rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.1rem);
  --step-1:  clamp(1.25rem, 1.15rem + .5vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
  --step-3:  clamp(2rem, 1.5rem + 2.2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 1.6rem + 4.4vw, 5.2rem);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--brown);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: rgba(140, 54, 35, .45); text-underline-offset: .22em; }
a:hover { text-decoration-color: var(--ember); }

h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.1; }

p { margin: 0 0 1.15em; max-width: var(--measure); }

::selection { background: var(--brown); color: var(--white); }

:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 780px; }

section { position: relative; }

.band { padding-block: clamp(4rem, 9vw, 8.5rem); }
.band--tight { padding-block: clamp(3rem, 6vw, 5.5rem); }

.band--paper { background: var(--paper-deep); }
.band--dark  { background: var(--brown); color: var(--white); }
.band--dark p { color: rgba(255, 255, 255, .84); }
.band--dark a { text-decoration-color: rgba(255, 255, 255, .45); }

/* --------------------------------------------------------------------------
   4. Type utilities
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 6rem;
}
.band--dark .eyebrow { color: var(--silver); }
.band--dark .eyebrow::after { background: var(--rule-light); }

.display   { font-family: var(--serif); font-size: var(--step-4); line-height: 1.02; letter-spacing: -.01em; }
.headline  { font-family: var(--serif); font-size: var(--step-3); line-height: 1.08; }
.subhead   { font-family: var(--serif); font-size: var(--step-2); line-height: 1.15; }
.title-sm  { font-family: var(--serif); font-size: var(--step-1); line-height: 1.2; }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  font-weight: 300;
  max-width: 46ch;
}

.small-caps {
  font-size: var(--step--1);
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 600;
}

.muted { color: rgba(75, 31, 16, .62); }
.band--dark .muted { color: rgba(255, 255, 255, .6); }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .95em 1.9em;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn:hover { background: var(--brown); border-color: var(--brown); color: var(--white); }

.btn--solid { background: var(--brown); border-color: var(--brown); color: var(--white); }
.btn--solid:hover { background: var(--ember); border-color: var(--ember); }

.band--dark .btn:hover,
.btn--onDark:hover { background: var(--white); border-color: var(--white); color: var(--brown); }

.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   6. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
  padding-block: 1.25rem;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand { display: block; line-height: 0; }
.brand img { width: clamp(78px, 8vw, 104px); transition: width .4s var(--ease); }
.brand .brand--dark-logo { display: none; }

/* transparent state, sitting over the dark hero */
.site-header[data-state="top"] { background: transparent; }
.site-header[data-state="top"] .nav a { color: var(--white); }
.site-header[data-state="top"] .nav-toggle span { background: var(--white); }

/* scrolled state */
.site-header[data-state="scrolled"] {
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule);
  padding-block: .7rem;
}
.site-header[data-state="scrolled"] .brand img { width: clamp(58px, 6vw, 72px); }
.site-header[data-state="scrolled"] .brand--light-logo { display: none; }
.site-header[data-state="scrolled"] .brand--dark-logo { display: block; }
.site-header[data-state="scrolled"] .nav a { color: var(--brown); }
.site-header[data-state="scrolled"] .nav-toggle span { background: var(--brown); }

/* pages without a dark hero start in the scrolled style */
.site-header--solid { background: var(--paper); box-shadow: 0 1px 0 var(--rule); }

.nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 2.6vw, 2.6rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  font-size: var(--step--1);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding-block: .35rem;
  transition: color .3s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 24px;
  margin-inline: auto;
  transition: transform .3s var(--ease), opacity .2s var(--ease), background .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: 0;
    background: var(--brown);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility .35s;
  }
  .nav[data-open="true"] { opacity: 1; visibility: visible; }
  .nav ul { flex-direction: column; gap: 2rem; text-align: center; }
  .site-header .nav a,
  .site-header[data-state="scrolled"] .nav a { color: var(--white); font-size: var(--step-1); letter-spacing: .2em; }
  .nav-toggle { position: relative; z-index: 2; }
  .site-header[data-nav-open="true"] .nav-toggle span { background: var(--white); }
  body[data-nav-locked="true"] { overflow: hidden; }
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(92svh, 900px);
  display: grid;
  align-items: end;
  background: var(--paper);
  color: var(--brown);
  overflow: hidden;
  padding-block: clamp(8rem, 16vh, 12rem) clamp(3rem, 7vw, 6rem);
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media picture { display: block; width: 100%; height: 100%; }
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  object-position: 50% 50%;
  filter: saturate(1) contrast(1.06);
}
/* The hero carries the primary (brown) lockup, so the washes are PAPER, not
   brown: they lift the photo toward the ground colour behind the type and let
   the stamp and tablet come through on the other side.
   1. a top scrim so the nav stays legible full width,
   2. a bottom-weighted wash for the copy on narrow screens,
   3. (desktop, below) a left-weighted wash for the headline column. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(247,244,242,.86) 0%, rgba(247,244,242,0) 18%),
    linear-gradient(to top, rgba(247,244,242,.98) 0%, rgba(247,244,242,.95) 42%, rgba(247,244,242,.4) 76%, rgba(247,244,242,.15) 100%);
}
@media (min-width: 900px) {
  .hero__media img { object-position: 62% 50%; }
  .hero__media::after {
    background:
      linear-gradient(to bottom, rgba(247,244,242,.7) 0%, rgba(247,244,242,0) 20%),
      linear-gradient(to top, rgba(247,244,242,.55) 0%, rgba(247,244,242,0) 26%),
      linear-gradient(97deg,
        rgba(247,244,242,.98) 0%,
        rgba(247,244,242,.96) 36%,
        rgba(247,244,242,.66) 53%,
        rgba(247,244,242,.14) 72%,
        rgba(247,244,242,0) 100%);
  }
}
.hero__inner { position: relative; z-index: 1; }

/* On the home page the hero carries the full lockup, so the header mark
   would sit directly above a near-identical one. Fade the header mark out
   until the page scrolls. */
@media (min-width: 900px) {
  body.is-home .site-header[data-state="top"] .brand {
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s var(--ease);
  }
}
@media (max-width: 899px) {
  .hero__mark { display: none; }
}
body.is-home .site-header .brand { transition: opacity .35s var(--ease); }

/* The home hero is light, so at the top of that page the header has to run
   dark — the opposite of every other page, whose page-hero is brown. */
body.is-home .site-header[data-state="top"] .nav a { color: var(--brown); }
body.is-home .site-header[data-state="top"] .nav-toggle span { background: var(--brown); }
body.is-home .site-header[data-state="top"] .brand--light-logo { display: none; }
body.is-home .site-header[data-state="top"] .brand--dark-logo { display: block; }
/* ...except once the full-screen brown menu is open, where it must go light again */
body.is-home .site-header[data-nav-open="true"][data-state="top"] .nav-toggle span { background: var(--white); }
body.is-home .site-header[data-nav-open="true"][data-state="top"] .nav a { color: var(--white); }

.hero__mark {
  width: clamp(132px, 14vw, 210px);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.hero h1 { max-width: 16ch; margin-bottom: 1.5rem; }
.hero .lede { color: rgba(75, 31, 16, .82); margin-bottom: 2.5rem; }

.hero__scroll {
  position: absolute;
  bottom: 2rem; right: var(--gutter);
  z-index: 1;
  writing-mode: vertical-rl;
  font-size: var(--step--1);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(75, 31, 16, .5);
  text-decoration: none;
}
@media (max-width: 860px) { .hero__scroll { display: none; } }

/* compact hero for interior pages */
.page-hero {
  background: var(--brown);
  color: var(--white);
  padding-block: clamp(8rem, 18vh, 12rem) clamp(3rem, 6vw, 5rem);
}
.page-hero h1 { max-width: 18ch; }
.page-hero .lede { color: rgba(255,255,255,.82); margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   8. Grids & cards
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.75rem); }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
/* for grids sitting inside one half of a split */
.grid--tight { grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); }

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
/* fr tracks default to min-width:auto, which lets a long paragraph steal width
   from the image column — pin them to 0 so the declared ratio actually holds */
.split > * { min-width: 0; }
.split--top { align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--wide-left  { grid-template-columns: 1.15fr .85fr; }
  .split--wide-right { grid-template-columns: .85fr 1.15fr; }
  .split__media--first { order: -1; }
}

.figure { position: relative; }
.figure img { width: 100%; }

/* crops a wide photo to a stronger portrait-ish block beside body copy */
.figure--fill img {
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 720px) { .figure--fill img { aspect-ratio: 3 / 2; } }
.figure figcaption {
  margin-top: .9rem;
  font-size: var(--step--1);
  letter-spacing: .04em;
  color: rgba(75,31,16,.6);
}
.band--dark .figure figcaption { color: rgba(255,255,255,.55); }

/* numbered process steps */
.step { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.band--dark .step { border-color: var(--rule-light); }
.step__num {
  font-family: var(--serif);
  font-size: var(--step-2);
  display: block;
  margin-bottom: .6rem;
  color: var(--ember);
}
.band--dark .step__num { color: var(--silver); }
.step h3 { margin-bottom: .6rem; }
.step p { font-size: var(--step--1); line-height: 1.7; }

/* product card */
.bar {
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
  background: var(--paper);
}
.bar:hover { border-color: var(--brown); transform: translateY(-3px); }
/* on the base ground the cards need to sit a step deeper to read as cards;
   on a --paper band they lift instead */
.band:not(.band--paper):not(.band--dark) .bar { background: var(--paper-deep); }
.bar__pct {
  font-family: var(--serif);
  font-size: var(--step-2);
  line-height: 1;
  color: var(--ember);
}
.bar h3 { font-family: var(--serif); font-size: var(--step-1); }
.bar p { font-size: var(--step--1); line-height: 1.65; margin: 0; }
.bar__notes {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(75,31,16,.55);
}

/* pull quote */
.quote {
  font-family: var(--serif);
  font-size: var(--step-2);
  line-height: 1.35;
  max-width: 28ch;
  margin: 0;
}
.quote cite {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: var(--step--1);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--silver);
}

/* definition rows (contact / stockists) */
.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid;
  gap: .4rem 2rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) { .row { grid-template-columns: minmax(110px, 190px) minmax(0, 1fr); } }
.row dt { font-size: var(--step--1); letter-spacing: .18em; text-transform: uppercase; color: rgba(75,31,16,.55); }
.row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.band--dark .rows, .band--dark .row { border-color: var(--rule-light); }
.band--dark .row dt { color: var(--silver); }

/* marquee rule of the lighthouse mark */
.mark-rule {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-block: clamp(2rem, 5vw, 3.5rem);
}
.mark-rule::before, .mark-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.band--dark .mark-rule::before, .band--dark .mark-rule::after { background: var(--rule-light); }
.mark-rule img { width: 26px; opacity: .8; }

/* --------------------------------------------------------------------------
   9. Form
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 1.5rem; max-width: 620px; }
.field { display: grid; gap: .5rem; }
.field label {
  font-size: var(--step--1);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
}
.field input, .field textarea, .field select {
  font: inherit;
  font-size: var(--step-0);
  color: inherit;
  padding: .85em 1em;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper-deep);
  transition: border-color .25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brown); outline: none; }
.field textarea { min-height: 150px; resize: vertical; }
.form__note { font-size: var(--step--1); color: rgba(75,31,16,.6); }

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--brown);
  color: var(--white);
  padding-block: clamp(3.5rem, 7vw, 6rem) 2rem;
}
.site-footer a { text-decoration: none; overflow-wrap: anywhere; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: .25em; }
.footer-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule-light);
}
.footer-grid h4 {
  font-size: var(--step--1);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: 1.2rem;
  font-weight: 600;
  font-family: var(--sans);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.footer-mark { width: 92px; margin-bottom: 1.25rem; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding-top: 2rem;
  font-size: var(--step--1);
  color: rgba(255,255,255,.6);
}

/* --------------------------------------------------------------------------
   11. Reveal on scroll
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   12. Utilities
   -------------------------------------------------------------------------- */
.stack > * + * { margin-top: 1.25rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.center p, .center .lede { margin-inline: auto; }
.center .lede { max-width: 54ch; }
.center .eyebrow { justify-content: center; }
.center .eyebrow::after { display: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brown);
  color: var(--white);
  padding: .8rem 1.2rem;
  z-index: 200;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
