/* ==========================================================================
   Homepage
   A black page with one light section ("The latest editions"). The Season 8
   packshots are shot on pure #000, so the ground is #000 too and they sit in
   the page without a visible frame.

   Shared header, footer and cart come from styles.css. Everything here is
   scoped to the homepage: classes are prefixed .hm-*, and overrides of shared
   elements are scoped with body:has(#hm-root).

   Typography follows /editions: NOE Display for headings, NOE Text for
   running text, Larsseit for UI (eyebrows, labels, buttons, specs).
   ========================================================================== */

:root {
  --hm-bg: #000;
  --hm-surface: #111;            /* brand ink: one step up from the ground */
  --hm-ink: #ecebe7;             /* light ink on black */
  --hm-muted: #b4b0a8;           /* secondary text on black, 9:1 */
  --hm-accent: #fff;             /* the solid action colour */
  --hm-m: clamp(16px, 2.2vw, 32px);           /* page margin */
  --hm-section: clamp(120px, 12vw, 180px);    /* vertical rhythm between sections */
  --hm-h2: clamp(44px, 6vw, 88px);
  --hm-ease: cubic-bezier(.16, 1, .3, 1);
}

body:has(#hm-root) { background: var(--hm-bg); }

#hm-root {
  background: var(--hm-bg);
  color: var(--hm-ink);
  font-family: 'Larsseit', system-ui, sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
}
#hm-root a { color: inherit; }
#hm-root p { margin: 0; }

/* Headings: NOE Display Medium, sentence case. The two caps headings
   ("The latest editions" is not one of them) opt in below. */
#hm-root h1,
#hm-root h2,
#hm-root h3 {
  margin: 0;
  font-family: 'NOE Display', Georgia, serif;
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.02em;
}

/* Running text, as #editions-intro */
.hm-lead {
  font-family: 'NOE Text', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Eyebrow, as #editions-eyebrow */
.hm-eyebrow {
  display: block;
  margin-bottom: 12px;
  font-family: 'Larsseit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .5;
}

/* Button, as .edition-card-buy: square, 1px border, Larsseit Bold caps.
   Light fill on the black page; hover inverts. */
.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 22px;
  border: 1px solid var(--hm-accent);
  background: var(--hm-accent);
  color: #000;
  font-family: 'Larsseit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s var(--hm-ease);
}
#hm-root .hm-btn { color: #000; }
#hm-root .hm-btn:hover { background: transparent; color: var(--hm-accent); }
.hm-btn:active { transform: scale(.98); }
.hm-btn span:last-child { transition: transform .3s var(--hm-ease); }
.hm-btn:hover span:last-child { transform: translateX(4px); }

#hm-root :focus-visible,
body:has(#hm-root) #site-header :focus-visible { outline: 2px solid var(--hm-accent); outline-offset: 3px; }

/* ---------- Shared header, homepage overrides ----------
   Elsewhere the header uses mix-blend-mode; over the grey sky of the hero
   that turned the logo muddy, so here it is plain ink. Over the white
   section the script adds .hm-header-on-light and the ink flips to dark. */
body:has(#hm-root) #site-header,
body:has(#hm-root) #header-logo { mix-blend-mode: normal; color: var(--hm-ink); }
body:has(#hm-root) #site-header,
body:has(#hm-root) #header-nav a,
body:has(#hm-root) #cart-indicator { transition: color .3s ease, border-color .3s ease, background-color .3s ease, opacity .2s ease; }
body:has(#hm-root) #header-nav a { color: var(--hm-ink); }
body:has(#hm-root) #header-nav a:hover { opacity: .6; }
body:has(#hm-root) #cart-indicator { background: transparent; color: var(--hm-ink); border-color: rgba(236, 235, 231, .5); }
body:has(#hm-root) #cart-indicator:hover { background: var(--hm-ink); color: #000; }
body:has(#hm-root) #cart-indicator-count { background: var(--hm-ink); color: #000; }

body:has(#hm-root).hm-header-on-light #site-header,
body:has(#hm-root).hm-header-on-light #header-nav a { color: #111; }
body:has(#hm-root).hm-header-on-light #cart-indicator { color: #111; border-color: rgba(17, 17, 17, .5); }
body:has(#hm-root).hm-header-on-light #cart-indicator:hover { background: #111; color: #fff; }
body:has(#hm-root).hm-header-on-light #cart-indicator-count { background: #111; color: #fff; }
body:has(#hm-root).hm-header-on-light #header-footer-logo { filter: brightness(0); }

/* ---------- Hero: fullscreen slideshow ---------- */
#hm-hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: #000;
  color: var(--hm-ink);
}
.hm-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease;
}
.hm-slide.is-active { opacity: 1; }
.hm-slide-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.08);
  transition: transform 7.5s linear;
}
.hm-slide.is-active .hm-slide-media { transform: scale(1); }

/* Object slides: a packshot on black, standing right of the headline */
.hm-slide-object .hm-slide-media {
  inset: auto;
  top: 52%;
  left: 68%;
  width: auto;
  height: min(76svh, 50vw);
  object-fit: contain;
  transform: translate(-50%, -48%) scale(1.04);
}
.hm-slide-object.is-active .hm-slide-media { transform: translate(-50%, -50%) scale(1); }

/* Neutral scrim under the text (photographs only) */
.hm-slide-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .22) 50%, rgba(0, 0, 0, .18) 80%, rgba(0, 0, 0, .45) 100%); /* taste-skill-ignore: scrim */
}

#hm-hero-copy {
  position: absolute;
  z-index: 2;
  left: var(--hm-m);
  bottom: clamp(96px, 14svh, 150px);
  max-width: min(1040px, 74vw);
}
/* "Football scarves," is about 7.1× its font size wide, so the size follows
   the viewport and the headline is always exactly two lines. */
#hm-hero-copy h1 { font-size: clamp(40px, 7vw, 120px); white-space: nowrap; }
#hm-hero-copy .hm-lead { margin-top: 20px; max-width: 30em; opacity: .9; }
#hm-hero-copy .hm-btn { margin-top: 30px; }

/* Index: one progress bar + name per slide */
#hm-hero-index {
  position: absolute;
  z-index: 2;
  left: var(--hm-m);
  right: var(--hm-m);
  bottom: 28px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.hm-index-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0 0;
  border: 0;
  background: none;
  color: var(--hm-muted);
  font-family: 'Larsseit', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: color .3s ease;
}
.hm-index-item:hover,
.hm-index-item.is-active { color: var(--hm-ink); }
.hm-index-bar { display: block; height: 2px; overflow: hidden; background: rgba(236, 235, 231, .24); }
.hm-index-bar i { display: block; width: 100%; height: 100%; background: var(--hm-ink); transform: scaleX(0); transform-origin: left; }
.hm-index-item.is-active .hm-index-bar i { animation: hmProgress var(--hm-slide-ms, 6000ms) linear forwards; }
.hm-index-item.is-done .hm-index-bar i { transform: scaleX(1); }
#hm-hero.is-paused .hm-index-item.is-active .hm-index-bar i { animation-play-state: paused; }
@keyframes hmProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Tap zones (touch): tap the left or right edge to step through the
   slides, like stories. Hidden on desktop, which has the index. */
.hm-tap {
  display: none;
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 34%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hm-tap-prev { left: 0; }
.hm-tap-next { right: 0; }

/* ---------- Latest editions: the light section ---------- */
#hm-latest {
  --hm-ink: #111;
  --hm-muted: #5b5955;
  --hm-accent: #111;
  padding: var(--hm-section) var(--hm-m);
  background: #fff;
  color: var(--hm-ink);
  /* the hero button lands on the heading, not on the section padding */
  scroll-margin-top: calc(24px - var(--hm-section));
}
#hm-latest-head { max-width: 820px; margin-bottom: 56px; }
#hm-latest-head h2 { margin-bottom: 16px; font-size: var(--hm-h2); }
#hm-latest-head .hm-lead { max-width: 36em; opacity: .75; }

#hm-latest-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 72px 24px;
}
.hm-product { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hm-product-feature { grid-column: 1 / 7; grid-row: span 2; }
.hm-product-small { grid-column: span 3; }

.hm-product-photo { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; background: #000; }
.hm-product-feature .hm-product-photo { flex: 1 1 auto; min-height: 520px; aspect-ratio: auto; }
.hm-product-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .6s ease, transform 1.2s var(--hm-ease);
}
.hm-product-feature .hm-product-photo img:first-child { object-position: center 42%; }
.hm-product-photo img + img { opacity: 0; }
.hm-product:hover .hm-product-photo img + img { opacity: 1; }
.hm-product:hover .hm-product-photo img { transform: scale(1.03); }
#hm-latest .edition-card-badge { z-index: 1; }

/* Card text: .edition-card-name / -spec / -buy / -info from styles.css */
.hm-product-meta { display: flex; flex-direction: column; gap: 10px; }
.hm-product-small .hm-product-meta { flex: 1; }   /* keeps spec rows aligned per row */
#hm-root .hm-product-meta h3.edition-card-name {
  margin: 0 0 4px;
  font-family: 'Larsseit', system-ui, sans-serif;
  font-weight: 300;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: .01em;
  text-transform: uppercase;
}
#hm-root .hm-product-feature h3.edition-card-name { font-size: clamp(34px, 3.4vw, 48px); }
.hm-product-meta h3 a { transition: opacity .2s ease; }
.hm-product-meta h3 a:hover { opacity: .6; }
#hm-root .hm-product-desc {
  margin: 0 0 6px;
  max-width: 36em;
  font-family: 'NOE Text', Georgia, serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  opacity: .75;
}
#hm-root .hm-product-small .hm-product-desc { margin-bottom: auto; padding-bottom: 6px; }
#hm-latest .edition-card-actions { margin-top: auto; padding-top: 8px; }
#hm-root #hm-latest .edition-card-info:hover { color: #fff; }

/* ---------- Gallery strip ---------- */
#hm-gallery { position: relative; padding: var(--hm-section) 0; }
#hm-gallery-title { margin: 0 var(--hm-m) 32px; }
#hm-gallery-title h2 { font-size: var(--hm-h2); }
#hm-gallery-row {
  display: flex;
  gap: clamp(16px, 2.4vw, 36px);
  overflow-x: auto;
  padding: 0 var(--hm-m) 10px;
  scroll-snap-type: x proximity;
  scroll-padding: 0 var(--hm-m);
  scrollbar-width: none;
  cursor: grab;
}
#hm-gallery-row::-webkit-scrollbar { display: none; }
.hm-gallery-frame {
  flex: 0 0 auto;
  width: clamp(220px, 22vw, 340px);
  aspect-ratio: 2 / 3;
  margin: 0;
  overflow: hidden;
  scroll-snap-align: start;
}
.hm-gallery-frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--hm-ease); }
.hm-gallery-frame:hover img { transform: scale(1.06); }

/* ---------- Closing: last photograph, text beside ---------- */
#hm-close { position: relative; height: 90svh; min-height: 560px; overflow: hidden; }
#hm-close > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 50%;
  filter: brightness(.8);
}
#hm-close-copy { position: absolute; z-index: 1; left: 56%; right: var(--hm-m); bottom: 14svh; }
#hm-close-copy h2 { font-size: clamp(40px, 4.6vw, 72px); text-transform: uppercase; letter-spacing: -.01em; line-height: .88; }
#hm-close-copy .hm-lead { margin-top: 18px; max-width: 30em; opacity: .9; }
#hm-close-copy .hm-btn { margin-top: 30px; }

/* ---------- Entrances (only when the script runs) ---------- */
.hm-js .hm-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--hm-ease), transform .9s var(--hm-ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}
.hm-js .hm-reveal.is-in { opacity: 1; transform: none; }
.hm-js #hm-hero-copy > * { opacity: 0; transform: translateY(22px); animation: hmRise 1.1s var(--hm-ease) forwards; }
.hm-js #hm-hero-copy > :nth-child(2) { animation-delay: .12s; }
.hm-js #hm-hero-copy > :nth-child(3) { animation-delay: .24s; }
@keyframes hmRise { to { opacity: 1; transform: none; } }

/* ---------- Tablet and phone (touch layouts) ---------- */
@media (max-width: 1000px) {
  #hm-hero-copy { max-width: min(620px, calc(100% - 2 * var(--hm-m))); pointer-events: none; }
  #hm-hero-copy .hm-btn { pointer-events: auto; }
  .hm-tap { display: block; }
  .hm-index-label { display: none; }
  .hm-index-item { padding: 14px 0; }
  .hm-slide-object .hm-slide-media { top: 35%; left: 50%; height: min(46svh, 72vw); }

  .hm-product-feature { grid-column: 1 / -1; grid-row: auto; }
  .hm-product-feature .hm-product-photo { flex: none; min-height: 0; aspect-ratio: 4 / 5; }
  .hm-product-small { grid-column: span 6; }
}

/* Tablet header: the centred text logo collided with the nav here */
@media (min-width: 681px) and (max-width: 1000px) {
  body:has(#hm-root) #site-header { display: flex; justify-content: space-between; align-items: center; padding: 20px var(--hm-m); }
  body:has(#hm-root) #header-logo { display: none; }
  body:has(#hm-root) #header-footer-logo { display: block; height: 40px; filter: brightness(0) invert(.93); }
  body:has(#hm-root) #header-nav-wrap { padding-right: 64px; }
  body:has(#hm-root) #header-nav { gap: 20px; padding-top: 0; }
}

@media (max-width: 680px) {
  /* Shared header: a solid black bar */
  body:has(#hm-root) #site-header { background: #000; color: var(--hm-ink); }
  body:has(#hm-root) #header-footer-logo { filter: brightness(0) invert(.93); }
  body:has(#hm-root) #header-menu-toggle span { background: var(--hm-ink); }
  body:has(#hm-root) #cart-indicator { top: 16px; right: 12px; border: 0; }
  body:has(#hm-root) #header-nav-mobile { background: #000; }
  body:has(#hm-root) #header-nav-mobile a { color: var(--hm-ink); }

  #hm-hero { height: calc(100svh - 76px); min-height: 520px; margin-top: 76px; }
  .hm-slide-object .hm-slide-media { top: 33%; width: 84vw; height: auto; max-height: 44svh; }
  .hm-slide-cover::after { background: linear-gradient(to top, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .12) 75%, rgba(0, 0, 0, .2) 100%); } /* taste-skill-ignore: scrim */
  #hm-hero-copy { left: 16px; right: 16px; bottom: 92px; max-width: none; }
  #hm-hero-copy h1 { font-size: 12vw; }
  #hm-hero-copy .hm-lead { margin-top: 14px; font-size: 16px; }
  #hm-hero-copy .hm-btn { width: 100%; margin-top: 20px; justify-content: space-between; }
  #hm-hero-index { gap: 6px; bottom: 22px; }

  #hm-latest-grid { gap: 44px 12px; }
  .hm-product-small { grid-column: 1 / -1; }

  .hm-gallery-frame { width: 58vw; }

  #hm-close { display: flex; flex-direction: column; height: auto; min-height: 0; background: var(--hm-surface); }
  #hm-close > img { position: relative; height: 70svh; filter: none; }
  #hm-close-copy { position: static; padding: 40px 16px 56px; }
  #hm-close-copy .hm-btn { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-slide,
  .hm-slide-media,
  .hm-product-photo img,
  .hm-gallery-frame img { transition: none !important; }
  .hm-slide-media,
  .hm-slide.is-active .hm-slide-media { transform: none; }
  .hm-slide-object .hm-slide-media,
  .hm-slide-object.is-active .hm-slide-media { transform: translate(-50%, -50%); }
  .hm-js .hm-reveal,
  .hm-js #hm-hero-copy > * { opacity: 1; transform: none; animation: none; transition: none; }
  .hm-index-item.is-active .hm-index-bar i { animation: none; transform: scaleX(1); }
}
