/* ==========================================================================
   Homepage sections
   ========================================================================== */

/* ---- Hero slider (full width, copy centred on the calm upper wall) ---- */
.hero__slide { position: relative; }
.hero .media--hero { aspect-ratio: var(--ratio); height: auto; }   /* phones and tablets keep a ratio; from 1024px a fixed banner height (below) */
.hero__slide .media::after {
  /* soft lift behind the copy so it reads on any photo */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 62%;
  background: linear-gradient(to bottom, var(--color-veil), transparent);
  pointer-events: none;
}
.hero__copy {
  position: absolute;
  inset: var(--space-10) 0 auto;
  z-index: var(--z-raised);
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  padding-inline: var(--container-gutter);
  text-align: center;
}
.hero__title { max-width: 18ch; font: var(--fw-black) var(--fs-5xl) / var(--lh-tight) var(--font-family); text-wrap: balance; }
.hero__lead { max-width: 46ch; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--color-text); }
.hero__copy .btn { margin-top: var(--space-2); }
/* ---- Shop by room (sand band + draggable tile carousel) ---- */
.rooms-band { padding: 48px 0; }
.rooms-rail { --rail-cols: 3.2; --rail-gap: var(--space-3); }   /* tiles at half the earlier size (3.2 per row) */
.rooms-rail .tile__label { inset-inline: var(--space-2); bottom: var(--space-2); font-size: var(--fs-sm); }   /* sized for the smaller tiles */
.rooms-band__title { margin-bottom: var(--space-6); text-align: center; font: var(--fw-bold) var(--fs-3xl) / var(--lh-heading) var(--font-family); text-wrap: balance; }
/* ---- Best sellers + New arrivals: the same five columns, so their cards line up ---- */
.best-top,
.arrivals { --five-gap: var(--space-6); }
.best-top { --rail-cols: 1.8; --rail-gap: var(--five-gap); }   /* a rail, so phones swipe it */
.arrivals { display: grid; grid-template-columns: 1fr; gap: var(--five-gap); }
/* New arrivals: the sand panel + four cards */
.arrivals__panel {
  display: grid;
  align-content: space-between;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-sand-100);
}
.arrivals__lead { margin-top: var(--space-3); color: var(--color-text-muted); }
.arrivals__actions { display: grid; gap: var(--space-4); justify-items: start; }
.arrivals .rail { --rail-cols: 1.8; --rail-gap: var(--five-gap); grid-column: auto; }
/* ---- Collection (Kalma, Larkbury range): story + room photo, then the pieces ---- */
.collection { padding-block: var(--space-10); }
.collection__head { display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: center; margin-bottom: var(--space-6); }
.collection__copy { display: grid; justify-items: start; gap: var(--space-4); color: var(--color-text-muted); }
.collection__title { font: var(--fw-black) var(--fs-3xl) / var(--lh-heading) var(--font-family); color: var(--color-text); }
.collection__sum strong { font-size: var(--fs-xl); font-weight: var(--fw-black); color: var(--color-text); }
.collection__sum small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--color-text-subtle); }
/* Room photos: a one-photo rail you drag or swipe, counter in the corner, arrows below */
.collection__rail { --rail-cols: 1; --rail-gap: 0px; height: 100%; }   /* 0px, not 0: a bare 0 breaks the rail's calc() */
.collection__count {
  position: absolute;
  top: var(--space-4);
  inset-inline-end: var(--space-4);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-glass);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  direction: ltr;   /* "1 / 4": RTL text would flip it to "4 / 1" */
}
.collection__arrows { position: absolute; bottom: var(--space-4); inset-inline-start: var(--space-4); }
.collection__pieces { --rail-cols: 1.3; }
.collection__pieces .product-card { --ratio: 5 / 4; }
.collection__pieces .media { background: var(--color-white); }
.collection__pieces .media img + img { position: absolute; inset: 0; opacity: 0; transition: opacity var(--duration-base) var(--ease-out); }
.collection__pieces .product-card:hover .media img + img { opacity: 1; }   /* the piece in the room on hover */
.collection__desc { margin-bottom: var(--space-2); font-size: var(--fs-sm); color: var(--color-text-subtle); }

/* ---- Made to order ---- */
.mto__grid { display: grid; grid-template-columns: 1fr; }
.mto__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* align the text with the container edge while the photo bleeds */
  padding-block: var(--space-10);
  padding-inline: var(--edge-offset);
}
.mto__title { margin-bottom: var(--space-3); font: var(--fw-black) var(--fs-4xl) / var(--lh-tight) var(--font-family); color: var(--color-on-dark); }
.mto__lead { margin-bottom: var(--space-6); font-size: var(--fs-lg); color: var(--color-on-dark-muted); }
.promises { display: grid; grid-template-columns: 1fr; gap: var(--space-4); margin-bottom: var(--space-8); }
.promises li { display: flex; gap: 14px; align-items: flex-start; padding-top: 18px; border-top: 1px solid var(--color-line-on-dark); }
.promises .icon { --icon-size: 26px; color: var(--color-sand); }
.promises strong { display: block; font-weight: var(--fw-semibold); color: var(--color-on-dark); }

/* ---- Shop the look: big photo + promo tile + three photos; a dot opens the product card ---- */
.look__grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 280px 130px 65px 130px; gap: var(--space-3); }
/* The big photo fills the first column. The other four are staggered: in the top row the first is
   shorter than the second, in the bottom row the first is taller (short = 2 rows' share, tall = 3). */
.look__grid > :nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
.look__grid > :nth-child(2) { grid-column: 1; grid-row: 2; }
.look__grid > :nth-child(3) { grid-column: 2; grid-row: 2 / 4; }
.look__grid > :nth-child(4) { grid-column: 1; grid-row: 3 / 5; }
.look__grid > :nth-child(5) { grid-column: 2; grid-row: 4; }
.look__photo { position: relative; overflow: visible; height: 100%; border-radius: var(--radius-md); }
.look__photo > img { border-radius: inherit; }
.look__promo {
  display: grid;
  align-content: space-between;
  gap: var(--space-6);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-white);
}
.look__kicker { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); opacity: .85; }
.look__title { display: block; margin-top: var(--space-2); font: var(--fw-bold) var(--fs-xl) / var(--lh-heading) var(--font-family); }
.look__promo .icon-btn { justify-self: start; background: var(--color-white); color: var(--color-accent); transition: transform var(--duration-base) var(--ease-out); }
.look__promo:hover .icon-btn { transform: translateX(-4px); }
.look__promo:dir(ltr):hover .icon-btn { transform: translateX(4px); }
.hotspot[aria-expanded="true"]::before { background: var(--color-accent); transform: scale(1.3); }
/* The card a dot opens (placed by main.js; a sheet at the bottom on phones) */
.spot-card {
  position: fixed;
  z-index: var(--z-overlay);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-3);
  align-items: center;
  width: auto;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.spot-card[hidden] { display: none; }
.spot-card img { width: 64px; height: 64px; border-radius: var(--radius-xs); object-fit: cover; }
.spot-card__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.4; }
.spot-card__price { margin-top: 2px; font-weight: var(--fw-bold); }
.spot-card__price small { font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.spot-card .btn { grid-column: 1 / -1; justify-content: center; }

/* ---- Trust strip: scrolls without a stop; pauses under the mouse or with its button ---- */
.trust { --trust-cols: 2; --trust-bg: var(--color-sand-100); position: relative; overflow: hidden; border-bottom: 1px solid var(--color-line-strong); }   /* the line marks where the strip ends and the lighter band starts */   /* items on screen at once, each as wide as before */
.trust__track { display: flex; width: max-content; animation: trust-scroll 50s linear infinite; }
.trust__toggle[aria-pressed="true"] ~ .trust__track { animation-play-state: paused; }
@media (hover: hover) { .trust__track:hover { animation-play-state: paused; } }   /* not on touch: a tap there would stay as a hover */
.trust__item {
  display: flex; flex-shrink: 0; gap: var(--space-2); align-items: center; justify-content: center;
  width: calc(var(--container-width) / var(--trust-cols));
  padding: 2px; border-inline-start: 1px solid var(--color-line-strong); white-space: normal; text-align: center;
}
.trust .icon { color: var(--color-accent); }
.trust__toggle { position: absolute; z-index: 2; inset-block: 0; inset-inline-end: var(--space-2); margin-block: auto; background: var(--trust-bg); }
.trust__toggle:hover { background: var(--color-brown); color: var(--color-white); }
.trust::after {   /* the button's own column, so the words never run under it */
  content: ""; position: absolute; z-index: 1; inset-block: 0; inset-inline-end: 0;
  width: calc(var(--control-height) + 2 * var(--space-2)); background: var(--trust-bg); pointer-events: none;
}
@keyframes trust-scroll { to { transform: translateX(-50%); } }
[dir="rtl"] .trust__track { animation-name: trust-scroll-rtl; }
@keyframes trust-scroll-rtl { to { transform: translateX(50%); } }
/* Reduced motion: no scrolling; the first copy can be swiped instead */
@media (prefers-reduced-motion: reduce) {
  .trust { overflow-x: auto; }
  .trust__item[aria-hidden], .trust__toggle, .trust::after { display: none; }
}
.trust strong { display: block; font-weight: var(--fw-semibold); }
.trust span { font-size: var(--fs-sm); color: var(--color-text-muted-on-sand); }

/* ---- Seasonal banner: a wide photo with dots and the copy over it; the products sit right
   under it on one panel ---- */
.season__banner { position: relative; height: 400px; }
.season__banner .look__photo { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.season__banner .look__photo::after {   /* darkens the corner the copy sits on */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(to top, rgb(30 18 10 / .7), transparent 65%);
}
.season .hotspot { z-index: 1; }
.season__copy { position: absolute; inset-inline: var(--space-5); bottom: var(--space-5); color: var(--color-white); pointer-events: none; }
.season__copy a { pointer-events: auto; }
.season__kicker { font-size: var(--fs-sm); font-weight: var(--fw-semibold); opacity: .85; }
.season__title { margin-block: var(--space-2) var(--space-3); font: var(--fw-bold) var(--fs-xl) / var(--lh-heading) var(--font-family); text-wrap: balance; }
.season__text { max-width: 36ch; margin-bottom: var(--space-4); opacity: .9; }
.season__link { display: inline-flex; align-items: center; gap: var(--space-2); padding-bottom: 2px; border-bottom: 1px solid currentColor; font-weight: var(--fw-semibold); }
.season__link .icon { transition: translate var(--duration-base) var(--ease-out); }
.season__link:hover .icon { translate: -4px 0; }
.season__link:dir(ltr):hover .icon { translate: 4px 0; }
.season__rail { --rail-cols: 1.6; --rail-gap: var(--space-4); padding: var(--space-4); border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--color-surface); }

/* ---- Room mosaic: a big photo (title at the top, dots below it) + four labelled photos ---- */
.mosaic__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.mosaic__big { position: relative; grid-column: 1 / -1; height: 380px; }
.mosaic__big .look__photo::after {   /* darkens the top, where the copy sits */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(to bottom, rgb(30 18 10 / .6), transparent 50%);
}
.mosaic .hotspot { z-index: 1; }
.mosaic__copy { position: absolute; inset-inline: var(--space-5); top: var(--space-5); color: var(--color-white); pointer-events: none; }
.mosaic__copy a { pointer-events: auto; }
.mosaic__kicker { font-size: var(--fs-sm); font-weight: var(--fw-semibold); opacity: .85; }
.mosaic__title { margin-block: var(--space-2) var(--space-3); font: var(--fw-bold) var(--fs-2xl) / var(--lh-heading) var(--font-family); text-wrap: balance; }
.mosaic__link, .mosaic__label { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: var(--fw-semibold); }
.mosaic__link { padding-bottom: 2px; border-bottom: 1px solid currentColor; }
.mosaic__tile { position: relative; display: block; height: 180px; color: var(--color-white); }
.mosaic__tile .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(30 18 10 / .6), transparent 50%); pointer-events: none; }
.mosaic__label { position: absolute; inset-inline-start: var(--space-4); bottom: var(--space-4); font-weight: var(--fw-bold); }
.mosaic__link .icon, .mosaic__label .icon { transition: translate var(--duration-base) var(--ease-out); }
.mosaic__link:hover .icon, .mosaic__tile:hover .mosaic__label .icon { translate: -4px 0; }
.mosaic__link:dir(ltr):hover .icon, .mosaic__tile:dir(ltr):hover .mosaic__label .icon { translate: 4px 0; }

/* ---- Sub-categories: tall photo cards moving slowly; the belt holds two copies and moves by
   half its width (same loop as the trust strip), about 5 s per card ---- */
.subcats__head { margin-bottom: var(--space-6); text-align: center; }
.subcats__track { position: relative; overflow: hidden; border-radius: var(--radius-md); }   /* inside the container: the cards slide in and out at its edges */
.subcats__belt { display: flex; gap: var(--space-3); width: max-content; animation: trust-scroll calc(var(--subcats-count) * 5s) linear infinite; }
[dir="rtl"] .subcats__belt { animation-name: trust-scroll-rtl; }
@media (hover: hover) { .subcats__belt:hover, .subcats__belt:focus-within { animation-play-state: paused; } }
.subcats__toggle[aria-pressed="true"] ~ .subcats__belt { animation-play-state: paused; }
.subcats__toggle { position: absolute; z-index: 2; top: var(--space-3); inset-inline-end: var(--space-3); background: var(--color-glass); box-shadow: var(--shadow-sm); }
.subcats__toggle:hover { background: var(--color-brown); color: var(--color-white); }
.subcats__card { position: relative; display: block; width: 220px; color: var(--color-white); }
.subcats__card .media { --ratio: 3 / 4; }
.subcats__card .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(30 18 10 / .6), transparent 45%); pointer-events: none; }
.subcats__cap { position: absolute; inset-inline: var(--space-4); bottom: var(--space-4); display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.subcats__cap strong { font-weight: var(--fw-bold); }
.subcats__cap small { flex: none; font-size: var(--fs-sm); opacity: .85; }
/* Reduced motion: no moving; the first copy can be swiped instead */
@media (prefers-reduced-motion: reduce) {
  .subcats__track { overflow-x: auto; scrollbar-width: none; }
  .subcats__belt { animation: none; }
  .subcats__belt > [aria-hidden], .subcats__toggle { display: none; }
}


/* ==========================================================================
   By screen size, mobile first (breakpoints in tokens.css): what only smaller screens
   have (max-width), then what changes from 640px and from 1024px (min-width)
   ========================================================================== */

@media (max-width: 1023.98px) {
  .hero .media--hero { --ratio: 4 / 3; }
  .hero__copy { inset-block-start: var(--space-10); }
  .arrivals__panel { grid-template-columns: 1fr auto; align-items: end; }
  .mto__grid .media { --ratio: 16 / 9; order: -1; }   /* the photo leads */
}

@media (max-width: 639.98px) {
  .hero .media--hero { --ratio: 4 / 5; }
  .hero__copy { inset-block-start: var(--space-8); }

  .trust__item { flex-direction: column; }
  .trust .icon { --icon-size: 26px; }
  .trust__track { animation-duration: 30s; }
  .look__title { font-size: var(--fs-lg); }
  .spot-card { inset: auto var(--space-4) var(--space-4); }

  .arrivals__panel { grid-template-columns: 1fr; }

  .mto__grid .media { --ratio: 4 / 3; }
}

@media (min-width: 640px) {
  .hero__lead { font-size: var(--fs-md); }

  .trust__item { gap: var(--space-4); padding: 2px var(--space-5); white-space: nowrap; }

  .rooms-band__title { margin-bottom: var(--space-8); }
  .rooms-rail { --rail-cols: 4.6; }
  .look__grid { grid-template-rows: 340px 160px 80px 160px; }
  .look__promo { padding: var(--space-6); }
  .spot-card { position: absolute; width: 260px; }
  .rooms-rail .tile__label { inset-inline: var(--space-3); bottom: var(--space-3); font-size: var(--fs-md); }
  .best-top { --rail-cols: 3.3; }
  .subcats__card { width: 260px; }
  .season__banner { height: 380px; }
  .season__copy { inset-inline: var(--space-8) auto; bottom: var(--space-8); max-width: 60%; }
  .season__title { font-size: var(--fs-2xl); }
  .season__rail { --rail-cols: 3.2; padding: var(--space-5); }
  .mosaic__tile { height: 220px; }
  .mosaic__copy { inset-inline: var(--space-8); top: var(--space-8); }
  .mosaic__title { font-size: var(--fs-3xl); }

  .arrivals__panel { gap: var(--space-8); padding: var(--space-8) var(--space-6); }
  .arrivals .rail { --rail-cols: 3.3; }

  .collection__head { gap: var(--space-8); margin-bottom: var(--space-9); }
  .collection__pieces { --rail-cols: 3; }
  .mto__copy { padding-block: var(--space-11); }
  .mto__lead { margin-bottom: 44px; }
  .promises { grid-template-columns: 1fr 1fr; gap: var(--space-7) var(--space-8); margin-bottom: var(--space-10); }
}

@media (min-width: 1024px) {
  .hero .media--hero { aspect-ratio: auto; height: 475px; }

  .trust { --trust-cols: 4; }

  .rooms-band { padding: 48px; }
  .rooms-band__title { margin-bottom: var(--space-10); }
  .rooms-rail { --rail-cols: 6.4; }
  .best-top { --rail-cols: 5; }
  .subcats__head { margin-bottom: var(--space-8); }
  .subcats__card { width: 300px; }
  .subcats__cap { inset-inline: var(--space-5); bottom: var(--space-5); font-size: var(--fs-md); }
  .season__banner { height: 440px; }
  .season__copy { inset-inline-start: var(--space-10); bottom: var(--space-10); }
  .season__title { font-size: var(--fs-3xl); }
  .season__rail { --rail-cols: 5; }
  .mosaic__grid { grid-template-columns: 1fr 1fr 1.5fr; grid-template-rows: 240px 240px; }
  .mosaic__big { grid-column: 3; grid-row: 1 / 3; height: auto; }   /* the big photo at the end, the four small ones first */
  .mosaic__tile { height: auto; }
  .mosaic__title { font-size: var(--fs-4xl); }

  /* New arrivals: the panel beside the rail */
  .arrivals { grid-template-columns: repeat(5, 1fr); }
  .arrivals .rail { --rail-cols: 4; grid-column: span 4; }
  .collection__head { grid-template-columns: 1fr 1.5fr; gap: var(--space-10); }

  /* the big photo on the start side, the others staggered in two columns */
  .look__grid { grid-template-columns: 1.45fr 1fr 1fr; grid-template-rows: 208px 104px 208px; }
  .look__grid > :nth-child(1) { grid-column: 1; grid-row: 1 / 4; }
  .look__grid > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .look__grid > :nth-child(3) { grid-column: 3; grid-row: 1 / 3; }
  .look__grid > :nth-child(4) { grid-column: 2; grid-row: 2 / 4; }
  .look__grid > :nth-child(5) { grid-column: 3; grid-row: 3; }

  .mto__grid { grid-template-columns: 1fr 1.25fr; }
  .mto__copy { padding-block: var(--space-13); padding-inline-end: var(--space-11); }
}
