/* ==========================================================================
   Base: reset, typography, layout primitives, header, footer
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: var(--fs-body)/var(--lh-body) var(--sans);
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.1; }
h1 { font-size: var(--fs-h1); letter-spacing: var(--track-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

a { color: inherit; text-underline-offset: 5px; text-decoration-thickness: 1px; }
img, picture, svg, video { display: block; max-width: 100%; }
img { width: 100%; height: auto; object-fit: cover; }
picture { width: 100%; height: 100%; }
picture > img { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
:where(ul[class], ol[class]) { list-style: none; margin: 0; padding: 0; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

.icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 29px; height: 29px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(var(--wrap-narrow) + var(--gutter) * 2); }
.section { padding-block: var(--section); }
.stack > * + * { margin-top: 1em; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--white); color: var(--berry); padding: 12px 18px; border-radius: var(--radius);
}
.skip:focus { top: 10px; }

.eyebrow {
  display: block;
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--berry);
  margin-bottom: 22px;
}
.lead { font-size: var(--fs-lead); line-height: 1.55; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }

/* --------------------------------------------------------------------------
   Announcement bar
   ------------------------------------------------------------------------ */
.announcement {
  background: var(--berry); color: var(--white); text-align: center;
  padding: 7px 20px; font-size: var(--fs-xs); letter-spacing: .06em;
}

/* --------------------------------------------------------------------------
   Header (approved structure: brand · search · tools, nav row beneath)
   ------------------------------------------------------------------------ */
.site-header { background: var(--cream); } /* no z-index: keeps the fixed nav drawer above the scrim */
.header-top {
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  padding-top: 23px; padding-bottom: 13px;
}
.brand { text-decoration: none; display: inline-block; text-align: center; color: var(--berry); flex-shrink: 0; }
.brand strong { display: block; font: 36px/1 var(--serif); letter-spacing: .24em; padding-left: .24em; font-weight: 400; }
.brand span { display: block; font-size: 10px; letter-spacing: .46em; margin-top: 8px; padding-left: .46em; }

.search {
  display: flex; align-items: center; flex: 1; max-width: 440px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--white);
  padding: 0 6px 0 16px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search:focus-within { border-color: var(--berry); box-shadow: 0 0 0 3px rgba(150, 115, 52, .25); }
.search input {
  min-width: 0; width: 100%; border: 0; background: transparent; padding: 10px 4px; font-size: var(--fs-small);
}
.search input:focus-visible { outline: none; }
.search input::placeholder { color: #8a7d76; }
.search button { border: 0; background: transparent; min-width: 44px; min-height: 42px; color: var(--berry); display: grid; place-items: center; }

.tools { display: flex; gap: 4px; align-items: center; }
.icon-button {
  position: relative; border: 0; background: transparent; min-width: 44px; min-height: 44px;
  color: var(--berry); display: inline-grid; place-items: center; text-decoration: none; border-radius: 50%;
  transition: background-color var(--dur-fast);
}
.icon-button:hover { background: rgba(96, 17, 43, .06); }
.count {
  position: absolute; right: 2px; top: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10px; line-height: 18px; text-align: center; border-radius: 9px;
  background: var(--berry); color: var(--white); font-weight: 700;
  transition: transform var(--dur) var(--ease);
}
.count:empty, .count[data-count="0"] { display: none; }
.count.is-bumped { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }
.menu-toggle { display: none; }

.nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 35px; padding: 13px 0 20px; }
.nav a {
  font-size: var(--fs-small); text-decoration: none; position: relative; padding: 4px 0;
  transition: color var(--dur-fast);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--berry); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-drawer__head, .nav-drawer__extra { display: none; }

@media (max-width: 1100px) { .nav { gap: 6px 24px; } }
@media (max-width: 900px) { .header-top { gap: 18px; } .nav { gap: 6px 20px; } }

/* Mobile header: nav becomes an off-canvas drawer (JS). Without JS it stays inline. */
@media (max-width: 760px) {
  .header-top { flex-wrap: wrap; padding-top: 17px; gap: 12px 10px; }
  .brand strong { font-size: 28px; }
  .brand span { font-size: 8px; }
  .tools { margin-left: auto; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .menu-toggle { display: inline-grid; }
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .nav { justify-content: flex-start; padding: 6px var(--gutter) 16px; gap: 0 20px; }
  html:not(.js) .nav a { min-height: 44px; display: flex; align-items: center; }

  .js .nav {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(86vw, 360px);
    display: flex; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; gap: 0;
    background: var(--cream); padding: 0 0 24px; overflow-y: auto;
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
    box-shadow: 16px 0 48px rgba(33, 19, 22, .2);
  }
  .js .nav.is-open { transform: none; visibility: visible; transition: transform var(--dur) var(--ease); }
  .js .nav a { font: 22px/1.2 var(--serif); padding: 14px 24px; border-bottom: 1px solid var(--line); min-height: 52px; display: flex; align-items: center; justify-content: space-between; }
  .js .nav a::after { display: none; }
  .js .nav-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 14px 24px; border-bottom: 1px solid var(--line); }
  .js .nav-drawer__extra { display: block; padding: 22px 24px 0; font-size: var(--fs-small); }
  .js .nav-drawer__extra a { font: inherit; border: 0; padding: 0; min-height: 44px; }
}

/* Shared overlay behind drawers */
.scrim {
  position: fixed; inset: 0; z-index: 55; background: var(--backdrop);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.scrim.is-visible { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ease); }

/* --------------------------------------------------------------------------
   Footer (approved: brand column + three link columns, hairline rules)
   ------------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 45px; padding-top: 40px; padding-bottom: 38px; }
.footer-brand { border-right: 1px solid var(--line); padding-right: 30px; }
.footer-brand p { font-size: var(--fs-xs); margin-top: 19px; }
.footer-brand .footer-promise { font: italic 19px/1.35 var(--serif); color: var(--berry); margin-top: 22px; max-width: 250px; }
.footer-social { display: flex; gap: 6px; margin-top: 18px; }
.footer-social a { color: var(--berry); }
.site-footer h2 { font: 700 13px var(--sans); margin: 0 0 14px; }
.footer-links a { display: block; text-decoration: none; font-size: var(--fs-xs); line-height: 2.1; width: fit-content; }
.footer-links a:hover { text-decoration: underline; color: var(--berry); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 17px; padding-bottom: 20px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 11px; color: var(--muted);
}
.footer-bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

@media (max-width: 900px) { .footer-main { gap: 22px; } }
@media (max-width: 600px) {
  .footer-main { grid-template-columns: repeat(2, 1fr); gap: 26px 14px; }
  .footer-brand { grid-column: 1 / -1; border: 0; padding: 0 0 8px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .footer-links a { line-height: 1.4; padding: 7px 0; }
}

/* --------------------------------------------------------------------------
   Motion preferences
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
