/* ---------------------------------------------------------------- Hero */

/* Full bleed, flush under the nav: the design's inset card framed a nav drawn on the photo, which ours isn't.
   The partial's inline script meets the nav's real edge and sets --jy-hero-top to it; the offsets here are
   body.html's .main-body, the no-JS fallback. --jy-hero-below is what sits under the frame. */
.jy-hero {
  --jy-hero-top: 105px;
  --jy-hero-below: 16px;
  padding-bottom: var(--jy-hero-below);
}

@media (max-width: 768px) {
  .jy-hero {
    --jy-hero-top: 94px;
  }
}

.jy-hero--many {
  --jy-hero-below: 40px;
  padding-bottom: 4px;
}

/* The nav logo (body.html, 234x169) has a width but no height until it loads, so on phones the nav grew 15px after
   the hero had measured it; its shape is reserved from the first layout. */
.nv .logoImg {
  aspect-ratio: 234 / 169;
}

/* The frame keeps the creative's shape and gives way only to the screen height, where cover trims
   top and bottom evenly (marketing keeps text out of the outer 10%). */
.jy-hero__frame {
  position: relative;
  width: 100%; /* with an auto width, the height cap would narrow the frame through the ratio */
  aspect-ratio: 2500 / 1166;
  max-height: calc(100vh - var(--jy-hero-top) - var(--jy-hero-below));
  max-height: calc(100svh - var(--jy-hero-top) - var(--jy-hero-below));
  overflow: hidden;
  background: var(--jy-fog);
  touch-action: pan-y pinch-zoom;
}

.jy-hero__frame.is-dragging {
  cursor: grabbing;
  user-select: none;
}

@media (max-width: 576px) {
  .jy-hero:not(.jy-hero--wide) .jy-hero__frame {
    aspect-ratio: 739 / 1080;
  }

  /* A slide saved without a phone creative, in a set that has them: show all of it rather than its middle third. */
  .jy-hero:not(.jy-hero--wide) .jy-hero__slide.is-wide .jy-hero__img {
    object-fit: contain;
  }
}

.jy-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
}

/* The incoming slide fades in over the outgoing one, which stays opaque underneath: no dip to the background. */
.jy-hero__slide.is-prev {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.jy-hero__slide.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transition: opacity 700ms ease;
}

.jy-hero__link,
.jy-hero__slide picture {
  display: block;
  height: 100%;
}

.jy-hero__link {
  position: relative;
}

.jy-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Edge to edge, a ring outside the frame falls off the screen: a two-tone ring inside reads on any photo. */
.jy-hero__link::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.jy-hero__link:focus-visible {
  outline: none;
}

.jy-hero__link:focus-visible::after {
  box-shadow: inset 0 0 0 3px var(--jy-focus), inset 0 0 0 5px var(--jy-white);
}

.jy-hero__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin-top: 4px;
}

/* Space kept from the first paint, so the band below never moves when home.js arrives. */
.jy-hero:not(.is-ready) .jy-hero__controls {
  visibility: hidden;
}

.jy-hero__dots {
  display: flex;
}

/* One fixed-size segment per slide, so nothing moves under the pointer: slides already shown stay filled, the
   current one fills over its hold (home.js animates the fill), and while stopped it stands full. */
.jy-hero__dot {
  position: relative;
  width: 40px;
  height: 32px;
  border-radius: var(--jy-radius-sm);
}

.jy-hero__dot::before,
.jy-hero__fill {
  position: absolute;
  inset: 14px 4px;
  border-radius: 2px;
}

.jy-hero__dot::before {
  content: "";
  background: var(--jy-star-tile);
}

@media (hover: hover) {
  .jy-hero__dot:hover::before {
    background: var(--jy-sapphire);
  }
}

.jy-hero__fill {
  background: var(--jy-navy);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform; /* its own layer, so the fill stays smooth while the page is still busy loading */
}

.jy-hero__dot.is-done .jy-hero__fill,
.jy-hero:not(.is-playing) .jy-hero__dot.is-active .jy-hero__fill {
  transform: none;
}

.jy-hero__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--jy-navy);
  border-radius: var(--jy-radius-sm);
}

.jy-hero__toggle .jy-icon {
  width: 10px;
  height: 10px;
}

.jy-hero.is-playing .jy-hero__toggle .jy-icon:last-child,
.jy-hero:not(.is-playing) .jy-hero__toggle .jy-icon:first-child {
  display: none;
}

/* ---------------------------------------------------------------- Statement banner */

.jy-statement {
  position: relative;
  background: var(--jy-charcoal);
}

.jy-statement > picture {
  position: absolute;
  inset: 0;
}

.jy-statement__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jy-statement__link {
  position: absolute;
  inset: 0;
}

.jy-statement__link:focus-visible {
  outline-offset: -4px;
}

/* min-height rather than aspect-ratio: the frame keeps the artboard's shape yet grows when content needs it. */
.jy-statement__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 200vw;
  padding: min(64px, 16.3vw) var(--jy-gutter) 64px;
}

.jy-statement__card,
.jy-statement__checker {
  flex-shrink: 0;
}

.jy-statement__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.jy-statement__sun {
  width: min(12.2vw, clamp(48px, 40.91px + 1.804vw, 64px));
}

/* On phones the photo scales with the width, so the top spacing, sun and heading scale too and the
   heading stays one line on the light wall, never on the sofa below it. --jy-statement-em is the heading's
   width in ems (home_content.heading_em); 23 is the design's own heading. */
.jy-statement__title {
  margin-top: clamp(9px, 7.23px + 0.451vw, 13px);
  font-size: min(var(--jy-fs-lead), (100vw - 2 * var(--jy-gutter)) / max(23, var(--jy-statement-em, 23)));
  font-weight: 400;
  line-height: 1.2;
}

.jy-statement__lead {
  align-self: stretch;
  margin-top: clamp(10px, 8.01px + 0.507vw, 14.5px);
  padding: 16px;
  font-weight: 400;
  line-height: 20px;
  text-wrap: balance;
  color: var(--jy-charcoal);
  background: var(--jy-stone);
}

.jy-statement__checker {
  --cols: 20;
  --rows: 2;
  --cell: min(16px, (100vw - 2 * var(--jy-gutter)) / 20);
}

@media (min-width: 577px) {
  .jy-statement__inner {
    min-height: calc(100vw * 680 / 1280);
    padding-top: 5vw;
  }

  .jy-statement__card {
    width: auto;
    max-width: 480px;
  }

  .jy-statement__sun {
    width: min(64px, 5vw);
  }

  /* One line in the 480px card too. */
  .jy-statement__title {
    font-size: min(var(--jy-fs-lead), 480px / max(23, var(--jy-statement-em, 23)));
    font-weight: 300;
    color: #8aa3c9;
    mix-blend-mode: screen;
  }

  .jy-statement__checker {
    --cell: 20px;
  }
}

/* ---------------------------------------------------------------- Shop by Category */

/* The framed heading's top rule reads as the section's edge, so the design sits it closer. */
.jy-categories {
  margin-top: 64px;
}

/* First on the page (hero and statement switched off): a margin would collapse into the nav offset. */
.jy-home > section.jy-categories:first-of-type {
  margin-top: 0;
  padding-top: 32px;
}

.jy-categories__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 14px;
  margin-inline: calc(-1 * var(--jy-gutter));
}

.jy-cat {
  display: block;
  text-align: center;
}

.jy-cat__media {
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: var(--jy-fog);
}

.jy-cat__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--jy-dur) var(--jy-ease);
}

.jy-cat:hover .jy-cat__img {
  transform: scale(1.03);
}

.jy-cat__label {
  display: block;
  padding: 8px 2px 0;
  line-height: 20px;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .jy-categories__grid {
    grid-template-columns: repeat(6, 1fr);
    margin-inline: 0;
  }
}

/* ---------------------------------------------------------------- Most Loved */

.jy-loved {
  --jy-defer-size: 700px;
}

/* Until home.js can filter, every card shows. */
.jy-loved__tabs {
  visibility: hidden;
}

.jy-loved.is-ready .jy-loved__tabs {
  visibility: visible;
}

.jy-loved__rail {
  --rail-gap: clamp(16px, 8.91px + 1.804vw, 32px);
}

.jy-loved__tabs + .jy-loved__rail {
  margin-top: clamp(16px, 8.91px + 1.804vw, 32px);
}

/* Room for the focus ring inside the scroller. */
.jy-loved__track {
  margin-block: -6px;
  padding-block: 6px;
}

.jy-loved__track > li {
  width: clamp(200px, (100% - 16px) / 1.25, 275px);
}

@media (min-width: 768px) {
  .jy-loved {
    --jy-defer-size: 760px;
  }

  .jy-loved__track > li {
    width: 275px;
  }
}

/* 3.5 across, so a part card always shows. */
@media (min-width: 1024px) {
  .jy-loved__track > li {
    width: clamp(256px, (100% - 3 * var(--rail-gap)) / 3.5, 320px);
  }
}

@media (min-width: 1280px) {
  .jy-loved {
    --jy-defer-size: 820px;
  }
}

/* ---------------------------------------------------------------- Celebs */

.jy-celebs {
  --jy-defer-size: 724px;
  --jy-heading: var(--jy-stone);
  position: relative;
  isolation: isolate;
}

/* Stronger than the artboards' ~8% lines, which vanish on a screen. */
.jy-celebs__paper {
  --cell: 21.5px;
  --line: rgb(135 137 142 / 0.2);
  position: absolute;
  inset: 180px 0 72px;
  z-index: -1;
}

.jy-celebs__head {
  text-align: center;
}

.jy-celebs__title {
  margin: clamp(13.5px, 18.94px - 0.417vw, 17.3px) 0 clamp(32px, 25.8px + 1.6vw, 46.3px);
  font-size: var(--jy-fs-h2);
}

.jy-celebs__track {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: auto auto;
  grid-auto-columns: 200px;
}

.jy-celeb {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--jy-midnight);
}

.jy-celeb__link {
  --jy-link: var(--jy-white);
  display: block;
  height: 100%;
}

.jy-celeb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--jy-dur) var(--jy-ease);
}

.jy-celeb:hover .jy-celeb__img {
  transform: scale(1.03);
}

.jy-celeb__name {
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  padding: 36px 12px 16px;
  font-family: var(--jy-font-display);
  font-size: var(--jy-fs-h3);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
  color: var(--jy-white);
  text-shadow: 0 1px 10px rgb(17 19 24 / 0.35);
}

.jy-celeb__name::before,
.jy-celeb__name::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.jy-celeb__name::before {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(transparent, #000 70%);
  mask-image: linear-gradient(transparent, #000 70%);
}

.jy-celeb__name::after {
  background: linear-gradient(rgb(253 253 253 / 0), rgb(140 136 132 / 0.62) 40%, rgb(70 66 62 / 0.95));
}

/* Navy arrows vanish on midnight. */
.jy-celebs .jy-rail__btn {
  color: var(--jy-midnight);
  background: var(--jy-stone);
}

.jy-celebs .jy-rail__btn:hover {
  background: var(--jy-white);
}

@media (min-width: 768px) {
  .jy-celebs {
    --jy-defer-size: 550px;
  }

  /* Faded sides keep the artboard's patch from reading as a box. */
  .jy-celebs__paper {
    inset: 120px auto 50px 50%;
    width: 640px;
    transform: translateX(-50%);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15% 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 15% 85%, transparent);
  }

  /* 4.5 cards across: the half card signals there is more. */
  .jy-celebs__track {
    grid-template-rows: auto;
    grid-auto-columns: clamp(220px, (100% - 4 * 16px) / 4.5, 280px);
  }
}

/* ---------------------------------------------------------------- Good Hands */

/* Phones put the stats on the page's white below a stone top; 768px+ keeps stone behind a white stats card. */
.jy-hands {
  --jy-defer-size: 770px;
  margin-block: 0;
  padding-bottom: var(--jy-section-y);
}

.jy-hands__top {
  background: var(--jy-stone);
}

.jy-hands__head {
  position: relative;
  padding: 96px 0 24px;
  text-align: center;
}

.jy-hands__paper {
  --line: rgb(135 137 142 / 0.12);
  position: absolute;
  inset: 40px 0 0;
  max-width: 960px;
  margin-inline: auto;
}

.jy-hands__head .jy-container {
  position: relative;
}

.jy-hands__title {
  font-size: var(--jy-fs-h2);
  text-wrap: balance;
}

.jy-rating {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  max-width: 410px;
  margin: 18px auto 0;
  padding: 16px;
  background: var(--jy-white);
}

.jy-rating__stars {
  display: flex;
  gap: 2px;
}

.jy-rating__star {
  display: grid;
  place-items: center;
  width: clamp(24px, 21.34px + 0.676vw, 30px);
  aspect-ratio: 1;
  color: var(--jy-star);
  background: var(--jy-star-tile);
}

.jy-rating__star .jy-icon {
  width: 54%;
  height: 54%;
}

.jy-rating__text {
  line-height: clamp(20px, 18.23px + 0.451vw, 24px);
  text-align: right;
  color: var(--jy-midnight);
}

.jy-rating__text > span {
  display: block;
  white-space: nowrap;
}

/* Stars and text need 361px side by side; narrower phones stack them. */
@media (max-width: 370px) {
  .jy-rating {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .jy-rating__text {
    text-align: center;
  }
}

/* Unbounded's taller ascent would push each line past the 24px grid. */
.jy-rating__text strong {
  margin-inline: 0.15em;
  line-height: 1;
}

.jy-rating__text strong,
.jy-stat__value {
  font-family: var(--jy-font-display);
  font-size: var(--jy-fs-lead);
  font-weight: 400;
  color: var(--jy-navy);
}

.jy-hands__rail {
  padding: 48px 0 32px;
}

.jy-review {
  display: flex;
  flex-direction: column;
  width: 260px;
  height: 100%;
  padding: 0 24px 14px 16px;
  color: var(--jy-charcoal);
  border-right: 2px solid var(--jy-white);
}

.jy-review__head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.jy-review__photo {
  flex: none;
  width: 80px;
  height: 80px;
  object-fit: cover;
  background: var(--jy-fog);
  border-radius: 50%;
}

.jy-review__stars {
  display: flex;
  gap: 4px;
  color: var(--jy-star);
}

.jy-review__stars .jy-icon {
  width: clamp(16px, 15.11px + 0.225vw, 18px);
  height: clamp(16px, 15.11px + 0.225vw, 18px);
}

.jy-review__star-off {
  display: flex;
  color: var(--jy-star-tile);
}

.jy-review__initials {
  display: grid;
  place-items: center;
  font-family: var(--jy-font-display);
  font-size: 24px;
  color: var(--jy-navy);
}

.jy-review__name {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.05em;
}

.jy-review__text {
  margin-top: 12px;
  padding-left: 2px;
  line-height: 20px;
}

.jy-review__text.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.jy-review__more {
  align-self: flex-end;
  margin-top: 8px;
  line-height: 20px;
  text-transform: uppercase;
}

.jy-review__more:hover {
  text-decoration: underline;
}

.jy-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.jy-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 8px 22px;
  text-align: center;
}

.jy-stat:nth-child(odd) {
  border-right: 1px solid var(--jy-sky);
}

.jy-stat:nth-child(-n + 2) {
  border-bottom: 1px solid var(--jy-sky);
}

.jy-stat__icon {
  width: clamp(18px, 14.46px + 0.902vw, 26px);
}

.jy-stat__value {
  margin-top: 4px;
  line-height: 1.3;
}

.jy-stat__label {
  margin-top: 6px;
  font-size: var(--jy-fs-caps);
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--jy-midnight);
}

@media (min-width: 768px) {
  .jy-hands {
    --jy-defer-size: 790px;
    background: var(--jy-stone);
  }

  .jy-review {
    padding-top: 16px;
  }

  .jy-review__text.is-clamped {
    -webkit-line-clamp: 5;
  }

  /* Four 256px columns centred in the card, as drawn at 1280. */
  .jy-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-inline: max(0px, (100% - 1024px) / 2);
    background: var(--jy-white);
  }

  .jy-stats .jy-stat {
    padding-bottom: 23px;
    border: 0;
  }

  .jy-stats .jy-stat + .jy-stat {
    border-left: 1px solid var(--jy-sky);
  }
}

/* ---------------------------------------------------------------- Style Highlights */

.jy-highlights {
  --jy-defer-size: 775px;
  --jy-heading: var(--jy-stone);
  --jy-rule: var(--jy-stone);
  --jy-focus: var(--jy-sky);
  position: relative;
  isolation: isolate;
  padding-top: 64px;
  background: var(--jy-charcoal);
}

.jy-highlights__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.jy-highlights__bg picture,
.jy-highlights__bg-img {
  width: 100%;
  height: 100%;
}

.jy-highlights__bg-img {
  object-fit: cover;
  object-position: 50% 0;
}

/* 1px lines are heavier than the artboard's 0.4-0.9px ones, so the ink is lighter. */
.jy-highlights .jy-grid-paper {
  --line: rgb(135 137 142 / 0.25);
  position: absolute;
  inset: 0;
}

/* The artboards leave more photo between heading and tiles on phones (63 -> 47). */
.jy-highlights .jy-heading {
  margin-bottom: clamp(46.5px, 70.09px - 1.804vw, 63px);
}

.jy-highlights__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.jy-hl {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px;
  background: var(--jy-white);
}

.jy-hl__media {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--jy-fog);
}

.jy-hl__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--jy-dur) var(--jy-ease);
}

.jy-hl:hover .jy-hl__img {
  transform: scale(1.03);
}

/* Caps take the chip floor (11px, as drawn), so "Trending Trousers" stays one line at 393. A label that
   still wraps on narrower phones grows its bar, and flex: 1 grows the neighbour's to match. */
.jy-hl__label {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 2px;
  font-size: var(--jy-fs-caps);
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--jy-aubergine);
  background: var(--jy-white);
  border: solid var(--jy-aubergine);
  border-width: 1px 12px;
}

@media (max-width: 767px) {
  /* The portrait puts the light wall behind the heading (1.7:1); this shade lifts it past 4.5:1. */
  .jy-highlights__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgb(17 19 24 / 0.45) 120px, transparent 260px);
  }

  .jy-highlights__grid > :first-child {
    grid-column: 1 / -1;
  }

  .jy-highlights__grid > :first-child .jy-hl__media {
    aspect-ratio: 329 / 345;
  }

  .jy-highlights__grid > :first-child .jy-hl__img {
    object-position: 50% 0;
  }
}

@media (min-width: 768px) {
  .jy-highlights {
    --jy-defer-size: 675px;
  }

  .jy-highlights__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------- As Seen On */

.jy-as-seen {
  --jy-defer-size: 750px;
}

/* Logos keep the artboards' width (80 -> 120) and gap (24 -> 64); phones get 3 + 2 rows. */
.jy-press {
  --logo: clamp(80px, 62.28px + 4.51vw, 120px);
  --gap: clamp(24px, 6.28px + 4.51vw, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px var(--gap);
  max-width: calc(3 * var(--logo) + 2 * var(--gap));
  margin-inline: auto;
}

/* Keeps 3 across on 320px screens. */
@media (max-width: 359px) {
  .jy-press {
    --gap: 16px;
  }
}

.jy-press__link {
  display: block;
  transition: opacity var(--jy-dur-fast) var(--jy-ease);
}

.jy-press__link:hover {
  opacity: 0.7;
}

.jy-press__logo {
  width: var(--logo);
}

.jy-usp {
  --n: 17;
}

.jy-container + .jy-usp {
  margin-top: var(--jy-section-y);
}

.jy-usp .jy-usp__band {
  --cols: var(--n);
  --rows: 1;
  --ink: var(--jy-charcoal);
}

/* The 1px gaps over a charcoal ground draw the cell dividers. */
.jy-usp__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--jy-charcoal);
  border: 1px solid var(--jy-charcoal);
}

.jy-usp__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 12px;
  text-align: center;
  background: var(--jy-white);
}

.jy-usp__art {
  margin-bottom: 12px;
}

.jy-usp__text {
  max-width: 9em;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--jy-charcoal);
  text-wrap: balance;
}

@media (min-width: 576px) {
  .jy-usp {
    --n: 25;
  }
}

@media (min-width: 768px) {
  .jy-as-seen {
    --jy-defer-size: 560px;
  }

  .jy-press {
    max-width: none;
  }

  .jy-usp {
    --n: 21;
    width: calc(100% - 2 * var(--jy-gutter));
    max-width: 786px;
    margin-inline: auto;
  }

  .jy-usp__list {
    grid-template-columns: repeat(4, 1fr);
  }

  .jy-usp__item {
    padding-bottom: 24px;
  }
}

/* ---------------------------------------------------------------- Workwear Edit */

.jy-workwear {
  --jy-defer-size: 1150px;
}

.jy-workwear__grid {
  display: grid;
  gap: 24px;
}

/* The photo sits under the card inside an isolated stack, so the link's hit area can cover the whole tile.
   min-width: 0 stops a tall card widening the tile through its aspect ratio; the tile grows taller instead. */
.jy-look {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  aspect-ratio: 1;
  background: var(--jy-fog);
}

.jy-look__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.jy-look__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--jy-dur) var(--jy-ease);
}

.jy-look:hover .jy-look__img {
  transform: scale(1.03);
}

/* The % top margin keeps the artboard's photo band (66% of the width) above the card, so a card that wraps
   grows the tile instead of covering more photo. */
.jy-look__card {
  margin: 66% 8px 8px;
  padding: 14px 8px 12px 16px;
  color: var(--jy-charcoal);
  background: rgb(255 255 255 / 0.95);
}

.jy-look__title {
  font-family: var(--jy-font-body);
  font-size: var(--jy-fs-title);
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
}

/* A 10em column holds each line in two rows; with less room the button drops under the text. */
.jy-look__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.jy-look__text {
  flex: 1 1 10em;
  font-weight: 400;
  line-height: 20px;
  text-wrap: balance;
}

.jy-look__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

@media (min-width: 768px) {
  .jy-workwear {
    --jy-defer-size: 440px;
  }

  .jy-workwear__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .jy-look {
    aspect-ratio: 368 / 345;
  }
}

/* ---------------------------------------------------------------- The Jaey Story */

.jy-story {
  --jy-defer-size: 1320px;
  display: grid;
}

/* The image is taken out of flow so its own height never sizes the row. */
.jy-story__media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 80vh;
  max-height: 80svh;
  background: var(--jy-fog);
}

.jy-story__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
}

.jy-story__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px var(--jy-gutter);
  background: var(--jy-stone) url("../images/home/story-grid.svg") no-repeat 50% -215px / 350px 350px;
}

.jy-story__body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 465px;
}

.jy-story__title,
.jy-story__text {
  margin-inline: clamp(16px, 8.1vw, 32px);
}

.jy-story__title {
  font-size: var(--jy-fs-display);
  line-height: 1.17;
}

.jy-story__tagline {
  margin-top: 16px;
  padding: 14px 16px;
  font-size: var(--jy-fs-title);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--jy-midnight);
  border: 1px solid var(--jy-midnight);
  text-wrap: balance;
}

.jy-story__text {
  margin-top: clamp(24px, 21.34px + 0.676vw, 30px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--jy-charcoal);
}

/* Bootstrap's p margin is replaced by a gap a little under one line. */
.jy-story__text p {
  margin: 0;
  text-wrap: pretty;
}

.jy-story__text p + p {
  margin-top: 0.8em;
}

.jy-story .jy-btn {
  align-self: center;
  margin-top: clamp(24px, 19.57px + 1.127vw, 34px);
}

@media (min-width: 768px) {
  .jy-story {
    --jy-defer-size: 760px;
    grid-template-columns: 1fr 1fr;
    min-height: min(50vw, 720px);
  }

  /* The phone height cap would leave a gap under the photo. */
  .jy-story__media {
    aspect-ratio: auto;
    max-height: none;
  }

  .jy-story__panel {
    background-position: 50% -124px;
  }
}

/* ---------------------------------------------------------------- Women in Jaey */

.jy-reels {
  --jy-defer-size: 540px;
}

.jy-reels__rail {
  --rail-gap: clamp(16px, 8.91px + 1.804vw, 32px);
}

.jy-reels__track {
  margin-block: -6px;
  padding-block: 6px;
}

/* Positioned so its screen-reader text is clipped by the track instead of widening the page. */
.jy-reel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 200px;
}

.jy-reel__watch {
  position: relative;
  display: block;
  align-self: stretch;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: var(--jy-fog);
}

.jy-reel__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--jy-dur) var(--jy-ease);
}

.jy-reel__watch .jy-icon {
  position: absolute;
  inset: 0;
  width: 40px;
  height: 40px;
  margin: auto;
  color: var(--jy-coral);
}

.jy-reel__by {
  --jy-link: var(--jy-text);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
}

.jy-reel__by span:not(.jy-visually-hidden) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.jy-reel__by .jy-icon {
  width: 16px;
  height: 16px;
}

.jy-reel__shop {
  margin-top: auto;
}

@media (hover: hover) {
  .jy-reel__watch:hover .jy-reel__img {
    transform: scale(1.03);
  }

  .jy-reel__by:hover span {
    text-decoration: underline;
  }
}

.jy-reels__invite {
  margin-top: clamp(24px, 13.37px + 2.706vw, 48px);
  padding: 9px var(--jy-gutter) 8px;
  line-height: 18px;
  text-align: center;
  background: var(--jy-stone);
  border-bottom: 1px solid var(--jy-sky);
}

.jy-reels__invite a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 768px) {
  .jy-reels {
    --jy-defer-size: 620px;
  }

  .jy-reel {
    width: clamp(200px, (100% - 4 * var(--rail-gap)) / 4.5, 280px);
  }
}

@media (min-width: 1280px) {
  .jy-reels {
    --jy-defer-size: 700px;
  }
}

/* ---------------------------------------------------------------- Global Fabrics */

.jy-fabrics {
  --jy-defer-size: 1220px;
}

/* The design sits the lead closer to the heading than other sections sit their content. */
.jy-fabrics .jy-heading {
  margin-bottom: 24px;
}

/* Below ~505px the title wraps, and a wrapped box spans the whole row; the phone artboard draws it 280 wide. */
@media (max-width: 519px) {
  .jy-fabrics .jy-heading__title {
    max-width: 280px;
  }
}

.jy-fabrics__lead {
  max-width: 760px;
  margin: 0 auto clamp(32px, 25.25px + 1.793vw, 48px);
  font-size: var(--jy-fs-lead);
  font-weight: 400;
  line-height: 1.43;
  text-align: center;
  color: var(--jy-charcoal);
}

.jy-fabrics__rail {
  --rail-gap: 24px;
}

@media (max-width: 767px) {
  .jy-fabrics__track {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    scroll-snap-type: none;
  }
}

/* A container, so the notes go side by side by the card's own width (phones and wide desktops), not the
   viewport's: three cards on a tablet are too narrow for two columns. */
.jy-fabric {
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--jy-charcoal);
}

.jy-fabric__swatch {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  color: var(--jy-white);
  background: var(--tone, var(--jy-fog));
}

.jy-fabric__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--jy-dur) var(--jy-ease);
}

.jy-fabric:hover .jy-fabric__img {
  transform: scale(1.03);
}

.jy-fabric__name {
  position: relative;
  z-index: 1;
  font-size: 24px;
  line-height: 1.2;
  color: inherit;
  text-shadow: 0 1px 2px rgb(21 32 50 / 0.3), 0 0 18px rgb(21 32 50 / 0.28);
}

.jy-fabric__notes {
  display: grid;
  gap: 12px 16px;
  margin: 17px 0 16px;
  color: var(--jy-charcoal);
}

.jy-fabric__notes dt {
  font-size: var(--jy-fs-caps);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--jy-midnight);
}

.jy-fabric__notes dd {
  margin-top: 4px;
  font-weight: 400;
  line-height: 20px;
}

@container (min-width: 300px) {
  .jy-fabric__notes {
    grid-template-columns: 1fr 1fr;
  }
}

/* The artboards pad this button 24 on phones but 16 on desktop, the reverse of the other tile buttons. */
.jy-fabric__link {
  align-self: flex-start;
  margin-top: auto;
  padding-inline: clamp(16px, 27.55px - 0.902vw, 24px);
}

.jy-fabric__link::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
}

@media (min-width: 768px) {
  .jy-fabrics {
    --jy-defer-size: 500px;
  }

  .jy-fabrics__track > .jy-fabric {
    width: calc((100% - 2 * var(--rail-gap)) / 3);
  }
}
