/* ===========================================================================
   styles.css — BELOW-THE-FOLD. Loads non-blocking (media="print" onload).

   Above-the-fold rules live in critical.css and are inlined into every page by
   tools/build.py. Do not duplicate them here — one copy, one place.
   =========================================================================== */

/* --- shared layout ------------------------------------------------------- */

.shell { width: var(--shell); margin-inline: auto; }

/* See the note in critical.css: a <picture> between a sized container and a
   cover image swallows the percentage height unless it is sized itself. */
.pcard-media picture,
.band-media picture,
.look-media picture,
.pdp-gallery picture { display: block; width: 100%; height: 100%; }

section { scroll-margin-top: 80px; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(1.2rem, 2vw, 2rem);
}
.sec-head h2 {
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 3.4vw, 3.1rem);
  line-height: 1;
  letter-spacing: -.015em;
}
.sec-head .txt-link { color: var(--muted); flex: none; }
.sec-head .txt-link:hover { color: var(--espresso); }

/* Scroll-reveal. The end state is also set synchronously by main.js on load,
   so a background tab never leaves a section stuck at opacity 0. */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .hero-card img, .pcard-media img { transition: none !important; }
}

/* --- brand statement ----------------------------------------------------- */

.statement {
  padding: clamp(4rem, 9vw, 8rem) 0;
  text-align: center;
}
.statement p {
  margin: 0 auto;
  max-width: 24ch;
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.statement .sub {
  font-family: var(--f-body);
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.7;
  letter-spacing: 0;
  max-width: 56ch;
  margin-top: 1.6rem;
  color: var(--muted);
}

/* --- product grid -------------------------------------------------------- */

.pgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 2rem) clamp(.8rem, 1.4vw, 1.4rem);
}
@media (max-width: 1000px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .pgrid { grid-template-columns: repeat(2, 1fr); gap: 1.4rem .7rem; } }

.pcard { position: relative; }

.pcard-media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--oat);
  aspect-ratio: 3 / 4;
}
.pcard-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.pcard:hover .pcard-media img { transform: scale(1.035); }

.pcard-tag {
  position: absolute; top: .7rem; left: .7rem;
  z-index: 2;
  background: var(--bone);
  color: var(--espresso);
  font-size: 10px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .3rem .55rem;
}
.pcard-tag.low { background: var(--clay-deep); color: #fff; }

/* Quick-add. Hidden until hover on pointer devices; on touch it is always
   visible, because there is no hover to reveal it with. */
.quick {
  position: absolute; inset: auto .5rem .5rem;
  z-index: 2;
  background: rgba(247, 243, 237, .94);
  backdrop-filter: blur(8px);
  padding: .55rem;
  display: flex; align-items: center; gap: .3rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.pcard:hover .quick, .pcard:focus-within .quick { opacity: 1; transform: none; }
@media (hover: none) { .quick { opacity: 1; transform: none; } }

/* Two cards to a row on a phone leaves ~180px of card, which the label plus
   five size buttons cannot fit on one line — unwrapped, the row ran past the
   card and took the whole document with it. Drop the label and let it wrap. */
@media (max-width: 700px) {
  .quick { flex-wrap: wrap; justify-content: center; gap: .25rem; padding: .45rem .35rem; }
  .quick-label { display: none; }
  .quick button { min-width: 26px; height: 24px; font-size: 10px; }
}

.quick-label {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-right: auto; padding-left: .25rem;
}
.quick button {
  min-width: 30px; height: 26px;
  font-size: 11px; letter-spacing: .04em;
  border: 1px solid var(--sand);
  transition: background .2s, color .2s, border-color .2s;
}
.quick button:hover { background: var(--espresso); color: var(--bone); border-color: var(--espresso); }
.quick button[disabled] {
  color: var(--off); border-color: var(--sand);
  cursor: not-allowed;
  text-decoration: line-through;
}
.quick button[disabled]:hover { background: none; color: var(--off); }

.pcard-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .1rem .8rem;
  padding-top: .75rem;
}
.pcard-name { font-size: 13.5px; font-weight: 500; letter-spacing: .01em; }
.pcard-price { font-size: 13.5px; text-align: right; }
.pcard-price s { color: var(--muted); margin-right: .4rem; }
.pcard-colour { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

.swatches { display: flex; gap: .3rem; padding-top: .5rem; grid-column: 1 / -1; }
.swatch {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(36, 31, 27, .22);
}
.swatch.on { box-shadow: 0 0 0 1px var(--bone), 0 0 0 2px var(--espresso); }

/* --- full-bleed collection banner --------------------------------------- */

.band {
  position: relative;
  margin-top: clamp(3.5rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  align-items: stretch;
  background: var(--oat);
}
/* Mirror the TRACKS, don't just reorder the items — reordering alone left the
   image in the 1fr column and the copy in the 1.35fr one, i.e. the layout
   inverted on every flipped band. */
.band.flip { grid-template-columns: 1fr 1.35fr; }
.band.flip > .band-media { order: 2; }

.band-media {
  position: relative;
  overflow: hidden;
  min-width: 0;
  /* No aspect-ratio here. These are stretched grid items, so their height is
     definite (it comes from the taller text column) and `aspect-ratio` would
     derive the WIDTH from that height — which is how this element ended up
     27px wider than its own grid track and pushed the page sideways at 1024px.
     A min-height gives it presence instead; the image covers whatever it gets. */
  min-height: clamp(340px, 40vw, 640px);
}
.band-media img { width: 100%; height: 100%; object-fit: cover; }

.band-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  padding: clamp(2rem, 5vw, 5rem);
}
.band-copy h2 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  line-height: .98;
  letter-spacing: -.02em;
  margin: .5rem 0 .8rem;
  text-wrap: balance;
}
.band-copy p { margin: 0 0 1.6rem; max-width: 40ch; color: var(--muted); }
.band-copy .txt-link { align-self: flex-start; }

@media (max-width: 860px) {
  .band, .band.flip { grid-template-columns: 1fr; }
  .band.flip > .band-media { order: 0; }
  /* Stacked, the media is no longer a stretched item, so a fixed ratio is both
     safe and better than a min-height. */
  .band-media { aspect-ratio: 4 / 3; min-height: 0; }
  .band-copy { padding: 2rem 1.5rem 2.8rem; }
}

/* --- editorial "as worn" ------------------------------------------------- */

.looks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.8rem, 1.4vw, 1.4rem);
}
@media (max-width: 1000px) {
  .looks {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 68%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
    /* Bleed the rail to the viewport edge so the last card can scroll clear.
       Uses --gutter rather than 100vw — see the note in critical.css. */
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .looks::-webkit-scrollbar { display: none; }
  .look { scroll-snap-align: start; }
}
@media (max-width: 620px) { .looks { grid-auto-columns: 82%; } }

.look-media { position: relative; overflow: hidden; background: var(--oat); aspect-ratio: 3 / 4; }
.look-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.look:hover .look-media img { transform: scale(1.035); }

.look-items { padding-top: .9rem; display: grid; gap: .3rem; }
.look-item {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 12.5px;
  padding-block: .3rem;
  border-bottom: 1px solid var(--sand);
}
.look-item span:last-child { color: var(--muted); flex: none; }
.look .txt-link { margin-top: .9rem; font-size: 11px; }

/* --- ethos --------------------------------------------------------------- */

.ethos {
  margin-top: clamp(4rem, 8vw, 8rem);
  background: var(--oat);
  padding-block: clamp(3rem, 6vw, 5.5rem);
}
.ethos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
}
@media (max-width: 800px) { .ethos-grid { grid-template-columns: 1fr; gap: 2rem; } }

.ethos-item svg {
  width: 26px; height: 26px;
  stroke: var(--clay-deep); fill: none; stroke-width: 1.2;
  margin-bottom: 1rem;
}
.ethos-item h3 {
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
  line-height: 1.1;
  margin-bottom: .5rem;
}
.ethos-item p { margin: 0; color: var(--muted); font-size: 14px; max-width: 38ch; }

/* --- newsletter ---------------------------------------------------------- */

.news { padding-block: clamp(4rem, 9vw, 8rem); text-align: center; }
.news h2 {
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.015em;
  margin-bottom: .8rem;
}
.news p { margin: 0 auto 2rem; max-width: 46ch; color: var(--muted); }

.news form {
  display: flex;
  gap: .5rem;
  max-width: 440px;
  margin-inline: auto;
}
.news input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: .85rem 1rem;
  background: transparent;
  border: 1px solid var(--sand);
  color: var(--espresso);
}
.news input::placeholder { color: var(--muted); }
.news input:focus { outline: none; border-color: var(--espresso); }

.btn {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  padding: .85rem 1.6rem;
  background: var(--espresso); color: var(--bone);
  border: 1px solid var(--espresso);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.btn:hover { background: transparent; color: var(--espresso); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.wide { width: 100%; justify-content: center; }

.news .note { font-size: 12px; margin-top: 1rem; color: var(--muted); }
@media (max-width: 520px) { .news form { flex-direction: column; } }

/* --- footer -------------------------------------------------------------- */

.site-foot {
  background: var(--espresso);
  color: var(--bone);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 2.2rem; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

.foot-brand .brandmark {
  font-size: 17px; letter-spacing: .3em; font-weight: 500;
  display: block; margin-bottom: 1rem;
}
.foot-brand p { margin: 0; max-width: 34ch; color: rgba(247, 243, 237, .72); font-size: 13.5px; }

.foot-col h3 {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(247, 243, 237, .62);
  margin-bottom: 1rem;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.foot-col a { font-size: 13.5px; color: rgba(247, 243, 237, .88); }
.foot-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.foot-bottom {
  border-top: 1px solid rgba(247, 243, 237, .18);
  padding-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(247, 243, 237, .72);
}
.foot-bottom a { text-decoration: underline; text-underline-offset: 3px; }
.pay { display: flex; gap: .45rem; }
.pay span {
  border: 1px solid rgba(247, 243, 237, .3);
  border-radius: 3px;
  padding: .18rem .45rem;
  font-size: 9.5px; letter-spacing: .1em;
}

.demo-note {
  width: 100%;
  border-top: 1px solid rgba(247, 243, 237, .18);
  margin-top: 1.2rem; padding-top: 1.2rem;
  font-size: 11.5px;
  color: rgba(247, 243, 237, .66);
}

/* --- drawers (bag + mobile nav) ------------------------------------------ */

.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28, 22, 18, .42);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.scrim.on { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 110;
  width: min(420px, 100vw);
  background: var(--bone);
  display: flex; flex-direction: column;
  transform: translateX(101%);
  transition: transform .45s var(--ease);
  visibility: hidden;
}
.drawer.on { transform: none; visibility: visible; }
.drawer.left { right: auto; left: 0; transform: translateX(-101%); width: min(340px, 84vw); }
.drawer.left.on { transform: none; }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 1.4rem;
  border-bottom: 1px solid var(--sand);
  flex: none;
}
.drawer-head h2 { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.4rem; }
.drawer-foot { flex: none; padding: 1.4rem; border-top: 1px solid var(--sand); }

.drawer.left nav { display: grid; gap: .2rem; }
.drawer.left nav a {
  font-family: var(--f-display);
  font-size: 1.7rem;
  line-height: 1.3;
  padding-block: .2rem;
}

.bag-empty { color: var(--muted); font-size: 14px; }

.bag-line {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: .9rem;
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--sand);
}
.bag-line img { width: 68px; aspect-ratio: 3 / 4; object-fit: cover; background: var(--oat); }
.bag-line h3 { font-size: 13.5px; font-weight: 500; }
.bag-line .meta { font-size: 12px; color: var(--muted); margin: .15rem 0 .5rem; }
.bag-line .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.qty { display: flex; align-items: center; border: 1px solid var(--sand); }
.qty button { width: 26px; height: 26px; font-size: 14px; line-height: 1; }
.qty button:hover { background: var(--oat); }
.qty span { min-width: 22px; text-align: center; font-size: 12.5px; }

.bag-total {
  display: flex; justify-content: space-between;
  font-size: 14px;
  margin-bottom: .3rem;
}
.bag-note { font-size: 11.5px; color: var(--muted); margin: 0 0 1rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 130;
  transform: translate(-50%, 130%);
  background: var(--espresso); color: var(--bone);
  font-size: 12.5px;
  padding: .8rem 1.3rem;
  transition: transform .45s var(--ease);
  max-width: calc(100vw - 2rem);
}
.toast.on { transform: translate(-50%, 0); }

/* --- product page (PDP) -------------------------------------------------- */

.crumbs {
  padding: 1.2rem 0;
  font-size: 12px;
  color: var(--muted);
}
.crumbs a:hover { color: var(--espresso); text-decoration: underline; text-underline-offset: 3px; }
.crumbs span { padding-inline: .4rem; }

.pdp {
  display: grid;
  grid-template-columns: 1fr min(440px, 34vw);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding-bottom: clamp(3rem, 6vw, 6rem);
}
@media (max-width: 900px) { .pdp { grid-template-columns: 1fr; } }

.pdp-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.pdp-gallery figure { margin: 0; background: var(--oat); aspect-ratio: 3 / 4; overflow: hidden; }
.pdp-gallery figure:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 4.2; }
.pdp-gallery img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) {
  .pdp-gallery { grid-template-columns: 1fr; }
  .pdp-gallery figure:first-child { aspect-ratio: 3 / 4; }
}

/* The buy column tracks the gallery on desktop. Plain sticky — no JS, and it
   degrades to a normal block below 900px where the column is taller than the
   viewport and sticky would never release. */
.pdp-buy { position: sticky; top: 86px; }
@media (max-width: 900px) { .pdp-buy { position: static; } }

.pdp-buy h1 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1;
  letter-spacing: -.015em;
  margin: .5rem 0 .6rem;
}
.pdp-price { font-size: 17px; margin-bottom: .3rem; }
.pdp-tax { font-size: 12px; color: var(--muted); margin: 0 0 1.6rem; }
.pdp-lede { color: var(--muted); margin: 0 0 1.8rem; font-size: 14.5px; }

.opt { margin-bottom: 1.5rem; }
.opt-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: .7rem;
}
.opt-head b { font-weight: 500; letter-spacing: .04em; text-transform: none; font-size: 13px; }
.opt-head a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.colour-row { display: flex; gap: .6rem; }
.colour-row button {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(36, 31, 27, .22);
  transition: box-shadow .2s;
}
.colour-row button[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--bone), 0 0 0 2px var(--espresso); }

.size-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.size-row button {
  min-width: 52px; height: 42px;
  font-size: 13px;
  border: 1px solid var(--sand);
  transition: background .2s, color .2s, border-color .2s;
}
.size-row button:hover { border-color: var(--espresso); }
.size-row button[aria-pressed="true"] { background: var(--espresso); color: var(--bone); border-color: var(--espresso); }
.size-row button[disabled] {
  color: var(--off); border-color: var(--sand);
  cursor: not-allowed; text-decoration: line-through;
}
.size-row button[disabled]:hover { border-color: var(--sand); }

.stock {
  display: flex; align-items: center; gap: .5rem;
  font-size: 12.5px; color: var(--muted);
  margin: 1.2rem 0;
}
.stock i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5d7d55;
  flex: none;
}
.stock.low i { background: var(--clay); }

details.acc { border-top: 1px solid var(--sand); }
details.acc:last-of-type { border-bottom: 1px solid var(--sand); }
details.acc summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: '+'; font-size: 16px; color: var(--muted); }
details.acc[open] summary::after { content: '\2013'; }
details.acc .acc-body { padding-bottom: 1.1rem; font-size: 13.5px; color: var(--muted); }
details.acc .acc-body p { margin: 0 0 .7rem; }
details.acc .acc-body ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }

.pdp-meta { margin-top: 2rem; }
