/* Hero, "The latest catalog": words on the left, the current catalog changing slowly in a framed panel on the right */
/* the hero fills the first screen on load; on a very short window it keeps enough height for the garment to read */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: max(640px, 100svh); background: var(--bg); }
/* tablets held upright would stretch the garment panel very tall, so there it stays capped */
@media (orientation: portrait) and (min-width: 821px) { .hero { min-height: min(100svh, 900px); } }
.hero-text { display: grid; align-content: center; justify-items: start; gap: var(--s5); padding: calc(var(--nav-h) + var(--s6)) var(--s8) var(--s8) var(--gutter); max-width: 680px; margin-inline-start: max(0px, calc(100% - 640px)); }   /* the half column: line up with the 1280 column without counting the scrollbar */
.hero-logo { width: clamp(132px, 11.5vw, 168px); height: auto; margin-bottom: var(--s4); }
.hero-h1 { margin: 0; font: 300 clamp(40px, 3.9vw, 56px)/1.06 var(--font-display); letter-spacing: -.01em; max-width: 15ch; text-wrap: balance; }
.hero-lede { margin: 0; font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 40ch; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s3); }

/* The right half is the surface itself, edge to edge; the nav floats over it */
.hero-now { display: grid; background: var(--surface); }
.hero-frame { position: relative; margin: 0; overflow: hidden; min-height: 560px; }
/* the garment is taller than the panel and runs off its top edge, so the photo's chin crop is never seen */
.hero-frame img { position: absolute; left: 50%; bottom: 0; height: 108%; width: auto; max-width: none; object-fit: contain; object-position: 50% 100%; translate: -50% 0; mix-blend-mode: multiply;
  opacity: 0; transition: opacity .4s ease; }
/* the outgoing garment clears quickly; the incoming one fades in after it and settles, so they never double up */
.hero-frame img.on { opacity: 1; transition: opacity .8s ease .3s, filter 1.4s var(--ease-out) .3s; animation: settle 2.4s var(--ease-out) .3s both; }
@keyframes settle { from { scale: 1.025; } to { scale: 1; } }
.still .hero-frame img.on { animation: none; }
/* the tag sits bottom-left as in the approved design, on a small bg chip so it reads cleanly over the garment */
.hero-tag { position: absolute; left: var(--s6); bottom: var(--s6); z-index: 1; display: grid; gap: var(--s1); padding: var(--s4) var(--s5); background: var(--bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }
.hero-tag [data-now-cat] { display: inline-block; }
.hero-tag small { font: 400 13px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hero-tag strong { font: 400 20px/1.3 var(--font-display); }
.hero-ticks { display: flex; gap: var(--s2); margin-top: var(--s2); }
.hero-ticks i { position: relative; width: var(--s5); height: 2px; background: var(--line); overflow: hidden; }
.hero-ticks i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; scale: 0 1; }
.hero-ticks i.on::after { animation: tick 4s linear forwards; }
/* the first tick waits until the opening garment has landed; any tick waits while the hero is out of sight or under the pointer */
.hero:not(.live) .hero-ticks i.on::after, .hero-ticks.paused i.on::after { animation-play-state: paused; }
.hero-ticks i.done::after { scale: 1 1; }
@keyframes tick { to { scale: 1 1; } }
.still .hero-ticks i.on::after { animation: none; scale: 1 1; }

/* The opening moment: while the headline's words come into focus, the first garment does the same
   (blur to sharp, settling from 1.025), then the tag rises into its corner and the first tick starts */
.js:not(.still) .hero:not(.in) .hero-frame img.on { opacity: 0; filter: blur(12px); }
.hero-tag { transition: opacity .6s var(--ease-out) 1.1s, translate .6s var(--ease-out) 1.1s; }
.js:not(.still) .hero:not(.in) .hero-tag { opacity: 0; translate: 0 8px; }
.still .hero-tag { transition: none; }

@media (max-width: 480px) { .hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; } }
/* Phones, "framed card" (owner's choice): headline and lede first, then the garment standing whole inside a rounded
   catalog card on surface, then the two buttons. The text block dissolves into the hero's grid so the card can sit
   between the lede and the buttons; the reading order in the document is unchanged. */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-text { display: contents; }
  .hero-logo { display: none; }
  .hero-h1 { order: 1; padding: calc(var(--nav-h) + var(--s5)) var(--gutter) var(--s3); }
  .hero-lede { order: 2; padding: 0 var(--gutter) var(--s5); font-size: 17px; }
  .hero-now { order: 3; padding-inline: var(--gutter); background: none; }
  .hero-frame { min-height: 0; aspect-ratio: 4 / 5; background: var(--surface); border-radius: var(--radius-lg); }
  /* every photo fills the card edge to edge: shirts and tops keep their hem (the chin crop goes off the top),
     denim and trousers keep the waist (the legs run off the bottom) */
  .hero-frame img { left: 0; width: 100%; height: 100%; translate: none; object-fit: cover; object-position: 50% 100%; }
  .hero-frame img[data-cat="Denim"], .hero-frame img[data-cat="Trousers"] { object-position: 50% 0; }
  .hero-tag { left: var(--s4); bottom: var(--s4); padding: var(--s3) var(--s4); }
  .hero-actions { order: 4; padding: var(--s5) var(--gutter) var(--s7); margin: 0; }
}
