/* Home page. Desktop positions follow the 1512px Figma frame using --u (one
   design pixel, defined on .stage in global.css). */

.home-hero {
  position: relative;
}

.home-hero__video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1620 / 1080;
  object-fit: cover;
}

/* Pause / play: bottom-right corner of the video */
.home-hero__toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--color-mauve);
  color: var(--color-white);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.home-hero__toggle[hidden] {
  display: none;
}

.home-hero__toggle:hover {
  background: #4a3a3c;
}

/* The page colour behind keeps the focus ring visible over the photo */
.home-hero__toggle:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--color-mauve);
}

.home-hero__icon--play,
.home-hero[data-paused] .home-hero__icon--pause {
  display: none;
}

.home-hero[data-paused] .home-hero__icon--play {
  display: block;
}

/* ---------- Intro ---------- */

.home-intro {
  position: relative;
  isolation: isolate;
}

.home-intro__sketch {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.home-intro__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-title);
  color: var(--color-black);
}

.home-intro__text {
  margin: 0;
  font-size: 1rem;
  line-height: 27px;
  letter-spacing: var(--tracking-body);
  color: var(--color-black);
}

/* ---------- Collage / carousel ---------- */

.collage__tile {
  /* Anchors the visually hidden label, so it stays inside the scrolling row on mobile */
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

/* The reels are small (about 145px wide), so they are scaled up to fill each tile */
.collage__tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage__tile:hover video {
  opacity: 0.92;
}

.collage__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Pause / play for the shop reels */
.collage__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--color-mauve);
  color: var(--color-white);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.collage__toggle[hidden] {
  display: none;
}

.collage__toggle:hover {
  background: #4a3a3c;
}

.collage__toggle:focus-visible {
  outline-color: var(--color-mauve);
}

.collage__toggle-icon--play,
.collage[data-paused] .collage__toggle-icon--pause {
  display: none;
}

.collage[data-paused] .collage__toggle-icon--play {
  display: block;
}

.collage__link {
  font-family: var(--font-display);
  color: var(--color-black);
  text-decoration: none;
}

.collage__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Large screens ---------- */

@media (min-width: 900px) {
  .home-hero {
    display: block;
    width: min(86vw, 1300px);
    /* The photo's top band (palms against the page colour) tucks under the header. */
    margin: calc(min(86vw, 1300px) * -0.0646) auto 0;
  }

  .home-intro {
    padding-top: calc(40 * var(--u));
  }

  .home-intro__sketch {
    top: calc(49 * var(--u));
    right: 0;
    width: calc(480 * var(--u));
  }

  .home-intro__title {
    max-width: calc(1041 * var(--u));
    margin-left: calc(136 * var(--u));
    font-size: max(3rem, calc(96 * var(--u)));
    line-height: 1.125;
  }

  .home-intro__text {
    /* Scales with the layout so it never runs into the sketch. */
    max-width: calc(578 * var(--u));
    margin: calc(39 * var(--u)) 0 0 calc(385 * var(--u));
  }

  .collage {
    position: relative;
    height: calc(1687 * var(--u));
    margin-top: calc(129 * var(--u));
  }

  .collage__item {
    position: absolute;
  }

  /* left, top, width, height from the design */
  .collage__item--1 { left: calc(592 * var(--u)); top: 0; width: calc(524 * var(--u)); height: calc(879 * var(--u)); }
  .collage__item--2 { left: calc(160 * var(--u)); top: calc(118 * var(--u)); width: calc(384 * var(--u)); height: calc(644 * var(--u)); }
  .collage__item--3 { left: calc(1167 * var(--u)); top: calc(264 * var(--u)); width: calc(367 * var(--u)); height: calc(615 * var(--u)); }
  .collage__item--4 { left: calc(-18 * var(--u)); top: calc(809 * var(--u)); width: calc(491 * var(--u)); height: calc(825 * var(--u)); }
  .collage__item--5 { left: calc(523 * var(--u)); top: calc(926 * var(--u)); width: calc(347 * var(--u)); height: calc(583 * var(--u)); }
  .collage__item--6 { left: calc(929 * var(--u)); top: calc(926 * var(--u)); width: calc(422 * var(--u)); height: calc(708 * var(--u)); }

  .collage__dots {
    display: none;
  }

  /* Top-left of the collage, above the second tile and beside the first */
  .collage__toggle {
    position: absolute;
    top: 0;
    left: calc(160 * var(--u));
    z-index: 1;
  }

  .collage__actions {
    position: absolute;
    top: calc(1651 * var(--u));
    left: calc(160 * var(--u));
    right: calc(161 * var(--u));
  }

  .collage__link {
    margin-left: auto;
    font-size: 1.25rem;
    line-height: 24px;
    letter-spacing: var(--tracking-nav);
  }

  .collage__link img {
    display: none;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 899px) {
  .home-hero__video {
    aspect-ratio: 786 / 1160;
  }

  .home-hero__toggle {
    right: 12px;
    bottom: 12px;
  }

  .home-intro {
    padding: 27px 31px 0;
  }

  .home-intro__sketch {
    top: 150px;
    right: 0;
    width: 150px;
  }

  .home-intro__title {
    font-size: 3rem;
    line-height: 64px;
  }

  .home-intro__text {
    max-width: 331px;
    margin-top: 115px;
  }

  .collage {
    margin-top: 83px;
  }

  .collage__list {
    display: flex;
    gap: 16px;
    padding: 0 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 30px;
    scrollbar-width: none;
  }

  .collage__list::-webkit-scrollbar {
    display: none;
  }

  .collage__item {
    flex: 0 0 min(332px, 100%);
    aspect-ratio: 332 / 556;
    scroll-snap-align: center;
  }

  .collage__dots {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 4px;
  }

  .collage__dots[hidden] {
    display: none;
  }

  /* 24px tap target around a 12px dot */
  .collage__dot {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .collage__dot::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d9d9d9;
  }

  .collage__dot[aria-current='true']::before {
    background: #8b8b8b;
  }

  .collage__link {
    display: flex;
    align-items: center;
    gap: 5px;
    width: max-content;
    margin-left: auto;
    padding: 5px 0;
    border-bottom: 1px solid currentColor;
    font-size: 0.875rem;
    line-height: 16.8px;
    letter-spacing: var(--tracking-nav);
  }

  .collage__link img {
    width: 24px;
    height: 24px;
    transform: rotate(90deg);
  }

  /* Above the carousel, left-aligned with the first image */
  .collage__toggle {
    margin: 0 0 16px 30px;
    white-space: nowrap;
  }

  .collage__actions {
    margin: 18px 30px 0;
  }
}

/* ---------- Image and text features (Rooted, Discovery, Curated) ---------- */

.feature {
  position: relative;
  isolation: isolate;
}

.feature__sketch {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.feature__media img,
.feature__sketch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-title);
  color: var(--color-black);
}

.feature__text {
  margin: 0;
  color: var(--color-black);
}

.feature__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.feature .text-button {
  color: var(--color-black);
}

.feature--curated .text-button {
  font-size: 0.9375rem;
}

@media (min-width: 900px) {
  .feature__title {
    font-size: max(2.375rem, calc(64 * var(--u)));
    line-height: 1.3125;
  }

  /* Rooted: photo with the title beside its bottom edge, text below. */
  .feature--rooted {
    display: grid;
    grid-template-columns: calc(764 * var(--u)) calc(557 * var(--u));
    column-gap: calc(53 * var(--u));
    align-items: end;
    margin-top: calc(228 * var(--u));
    padding-inline: calc(72 * var(--u));
  }

  .feature--rooted .feature__sketch {
    top: calc(-199 * var(--u));
    right: 0;
    width: calc(533 * var(--u));
    height: calc(587 * var(--u));
  }

  .feature--rooted .feature__media {
    height: calc(509 * var(--u));
  }

  .feature--rooted .feature__text {
    grid-column: 1 / -1;
    max-width: calc(697 * var(--u));
    margin: calc(43 * var(--u)) 0 0 calc(515 * var(--u));
  }

  /* Discovery and Curated: photo and text side by side. */
  .feature--discovery,
  .feature--curated {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .feature--discovery {
    flex-direction: row-reverse;
    gap: calc(78 * var(--u));
    margin-top: calc(97 * var(--u));
  }

  .feature--curated {
    gap: calc(90 * var(--u));
    margin-top: calc(85 * var(--u));
  }

  .feature--discovery .feature__media,
  .feature--curated .feature__media {
    flex: none;
    width: calc(600 * var(--u));
    height: calc(695 * var(--u));
  }

  .feature--discovery .feature__body {
    width: calc(638 * var(--u));
  }

  .feature--discovery .feature__title {
    text-align: right;
  }

  .feature--discovery .feature__copy {
    margin-top: 6px;
    padding-left: calc(176 * var(--u));
  }

  .feature--discovery .feature__text {
    max-width: calc(458 * var(--u));
  }

  .feature--curated .feature__body {
    width: calc(490 * var(--u));
  }

  .feature--curated .feature__title {
    max-width: calc(430 * var(--u));
    line-height: 1.17;
  }

  .feature--curated .feature__copy {
    margin-top: 6px;
  }
}

@media (max-width: 899px) {
  .feature {
    display: flex;
    flex-direction: column;
    padding-inline: 31px;
  }

  .feature__title {
    font-size: 2.375rem;
    line-height: 53px;
  }

  .feature__copy {
    gap: 14px;
    margin-top: 14px;
  }

  .feature__text {
    max-width: 331px;
  }

  .feature--rooted {
    margin-top: 45px;
  }

  /* Flush with the left edge of the screen, 267px wide at 393px. */
  .feature--rooted .feature__media {
    width: 68vw;
    margin-left: -31px;
    aspect-ratio: 267 / 170;
  }

  .feature--rooted .feature__sketch {
    top: 133px;
    right: 0;
    width: 193px;
    aspect-ratio: 193 / 147;
  }

  .feature--rooted .feature__title {
    margin-top: 36px;
  }

  .feature--rooted .feature__text {
    margin-top: 14px;
  }

  .feature--discovery {
    margin-top: 35px;
  }

  .feature--discovery .feature__media {
    align-self: flex-end;
    width: 213px;
    margin-right: 2px;
    aspect-ratio: 213 / 312;
  }

  .feature--discovery .feature__body {
    margin-top: 36px;
  }

  .feature--curated {
    margin-top: 50px;
  }

  .feature--curated .feature__media {
    width: 291px;
    max-width: 100%;
    margin-left: -19px;
    aspect-ratio: 291 / 330;
  }

  .feature--curated .feature__body {
    margin-top: 33px;
  }
}

/* ---------- Upcoming Events ---------- */

.events__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.events__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-title);
  color: var(--color-black);
}

@media (min-width: 900px) {
  .events {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: calc(90 * var(--u));
    margin-top: calc(85 * var(--u));
    padding-right: calc(24 * var(--u));
  }

  .events__media {
    flex: none;
    width: calc(600 * var(--u));
    height: calc(695 * var(--u));
  }

  .events__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: calc(638 * var(--u));
  }

  .events__title {
    font-size: max(2.375rem, calc(64 * var(--u)));
    line-height: 1.3125;
    text-align: right;
  }

  .events__details {
    padding-left: calc(176 * var(--u));
  }

  .events__details .upcoming__text,
  .events__details .upcoming__form {
    max-width: 443px;
  }
}

@media (max-width: 899px) {
  .events {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 92px;
    padding-inline: 31px;
  }

  /* Mobile order: title, photo, details */
  .events__body {
    display: contents;
  }

  .events__title {
    order: 1;
    font-size: 2.375rem;
    line-height: 50px;
    text-align: center;
  }

  .events__media {
    order: 2;
    aspect-ratio: 327 / 380;
  }

  .events__details {
    order: 3;
  }
}

/* ---------- Spotlight spacing (component styles are global) ---------- */

@media (min-width: 900px) {
  .spotlight {
    margin-top: calc(min(100vw, 1512px) * 85 / 1512);
  }
}

@media (max-width: 899px) {
  .spotlight {
    margin-top: 65px;
  }
}

/* ---------- Logo wall ---------- */

.logo-wall__list img {
  width: 100%;
  height: auto;
}

@media (min-width: 900px) {
  .logo-wall {
    padding: calc(70 * var(--u)) calc(60 * var(--u));
  }

  /* Rows of 6, 5 and 4 as designed: two full-width spacers (the list's
     ::before and ::after) are ordered between the rows. Reading order is
     unchanged. */
  .logo-wall__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: calc(70 * var(--u));
    row-gap: calc(58 * var(--u));
  }

  .logo-wall__list::before,
  .logo-wall__list::after {
    content: '';
    flex-basis: 100%;
    height: 0;
    margin-block: calc(-29 * var(--u));
  }

  .logo-wall__list li { order: 1; width: calc(var(--w) * var(--u)); }
  .logo-wall__list::before { order: 2; }
  .logo-wall__list li:nth-child(n + 7) { order: 3; }
  .logo-wall__list::after { order: 4; }
  .logo-wall__list li:nth-child(n + 12) { order: 5; }
}

@media (max-width: 899px) {
  .logo-wall {
    padding: 64px 0;
  }

  .logo-wall__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 98px));
    justify-content: center;
    column-gap: 16px;
    padding-inline: 16px;
    row-gap: 24px;
  }

  .logo-wall__list li {
    display: grid;
    place-items: center;
    height: 56px;
  }

  .logo-wall__list img {
    max-width: 88px;
    max-height: 56px;
    object-fit: contain;
  }
}
