/* ==========================================================================
   Homepage — hero + listings grid
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(88svh, 820px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: calc(var(--header-h) + var(--space-xl)) var(--gutter) var(--space-xl);
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Darkens the photo just enough for white text to stay legible */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgb(16 18 17 / 0.45) 0%,
      rgb(16 18 17 / 0.30) 45%,
      rgb(16 18 17 / 0.55) 100%);
}

.hero__content {
  max-width: 40rem;
}

.hero__eyebrow {
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.85);
  margin-bottom: var(--space-sm);
}

.hero__title {
  font-size: var(--step-4);
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--space-sm);
  text-wrap: balance;
  text-shadow: 0 2px 24px rgb(0 0 0 / 0.3);
}

.hero__lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: rgb(255 255 255 / 0.92);
  max-width: 34ch;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

/* Ghost button that works on top of a photo */
.btn-hero-ghost {
  background-color: rgb(255 255 255 / 0.1);
  color: #fff;
  border-color: rgb(255 255 255 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.btn-hero-ghost:hover {
  background-color: #fff;
  color: var(--ink);
  border-color: #fff;
}

/* --------------------------------------------------------------------------
   Listings
   -------------------------------------------------------------------------- */

.listings {
  padding-block: var(--space-2xl);
  background-color: var(--bg);
}

/* Replaces the old hardcoded `padding: 3rem 19rem`, which collapsed the grid
   to a single squeezed column at anything below ~1500px. */
.listings-grid {
  display: grid;
  /* 16rem floor -> four columns on a wide screen. Five felt cramped and made
     the cards too tall and narrow. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-lg) var(--space-md);
}

.listings-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-muted);
  padding-block: var(--space-xl);
}

/* --------------------------------------------------------------------------
   Listing card
   -------------------------------------------------------------------------- */

.listing-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  /* Skip layout and paint for cards that are off-screen. The intrinsic size
     keeps the scrollbar honest so nothing jumps as they come into view. */
  content-visibility: auto;
  contain-intrinsic-size: auto 34rem;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #d9d4cb;
}

.listing-card__media {
  position: relative;
  /* 4:5 keeps 70% of a 9:16 photo -- nearly as much as 3:4 (75%) but noticeably
     less tall, which stops the card becoming a narrow column. */
  aspect-ratio: 4 / 5;
  background-color: var(--surface-sunk);
  overflow: hidden;
}

.listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.listing-card:hover .listing-card__media img {
  transform: scale(1.04);
}

.listing-card__placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, var(--surface-sunk) 0%, #e8e3db 100%);
}

.listing-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  /* Deliberately generous: the text block needs real weight to balance the
     image, otherwise the card reads as a photo with a caption stuck under it. */
  padding: var(--space-md) var(--space-md) var(--space-lg);
  flex: 1;
}

.listing-card__name {
  font-size: var(--step-1);
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

.listing-card__desc {
  font-size: var(--step--1);
  color: var(--ink-muted);
  line-height: 1.5;
  margin: 0;
}

.listing-card__price {
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  /* pin the price to the bottom so cards of differing text length line up */
  margin-top: auto;
  padding-top: var(--space-xs);
}

/* --------------------------------------------------------------------------
   "In motion" — video showcase
   Deliberately unlike the rest of the page: a dark band, and a portrait frame
   that matches the clips' own 9:16 so nothing is cropped. Held to ~320px wide
   because the source clips are 320x568 — any larger and they just look soft.
   -------------------------------------------------------------------------- */

.in-motion {
  background-color: #1b3830;
  color: #fff;
  /* Sits between the hero and the grid, so it stays a band rather than a full
     screen -- it should introduce the pieces, not delay them. */
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.in-motion__inner {
  display: grid;
  /* Explicit track: an `auto` column collapses here, because the stage has only
     an aspect-ratio and a percentage width for the browser to work from. */
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.in-motion__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: #000;
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.35);
}

.in-motion__clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.in-motion__clip.is-active {
  opacity: 1;
}

.in-motion__text h2 {
  color: #fff;
  font-size: var(--step-3);
  margin-bottom: var(--space-sm);
  text-wrap: balance;
}

.in-motion__text .eyebrow {
  color: rgb(255 255 255 / 0.65);
}

.in-motion__lede {
  color: rgb(255 255 255 / 0.82);
  max-width: 44ch;
  line-height: 1.65;
  text-wrap: pretty;
  margin-bottom: var(--space-lg);
}

.in-motion__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgb(255 255 255 / 0.16);
}

.in-motion__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  margin: 0;
  flex: 1 1 14ch;
}

.in-motion__price {
  margin: 0;
  font-weight: 600;
  color: rgb(255 255 255 / 0.85);
}

.in-motion__meta .btn-secondary {
  color: #fff;
  border-color: rgb(255 255 255 / 0.4);
}

.in-motion__meta .btn-secondary:hover {
  background-color: #fff;
  color: var(--ink);
  border-color: #fff;
}

.in-motion__dots {
  display: flex;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.in-motion__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgb(255 255 255 / 0.3);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.in-motion__dot.is-active {
  background-color: #fff;
  transform: scale(1.3);
}

@media (max-width: 820px) {
  .in-motion__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: var(--space-lg);
  }

  /* Stage keeps its own cap so the clip isn't upscaled past its 320px source */
  .in-motion__stage {
    max-width: 320px;
  }

  .in-motion__lede {
    margin-inline: auto;
  }

  .in-motion__meta {
    justify-content: center;
  }

  .in-motion__dots {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Phones — two columns instead of one very large card.
   Must stay at the end of the file: these selectors have the same specificity
   as the base rules above, so they only win by coming later in source order.
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .listings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md) var(--space-sm);
  }

  /* Boilerplate descriptions just crowd a narrow card */
  .listing-card__desc {
    display: none;
  }

  .listing-card__body {
    padding: var(--space-sm);
    gap: 0.2rem;
  }

  .listing-card__name {
    font-size: var(--step-0);
    /* `balance` splits these short names over three even lines in a narrow
       column; plain wrapping keeps them to two and the cards shorter. */
    text-wrap: wrap;
  }

  .listing-card__price {
    font-size: var(--step--1);
  }
}
