/* -------------------------------------------------------- */
/* 🔹 Hero Section                                          */
/* -------------------------------------------------------- */
/* Landing page hero — title, subtitle, App Store badge      */
/* Primary green panel; the courses section below is white    */

.hero {
  /* Fills the viewport below the 64px navbar, content centered */
  min-height: calc(100dvh - 64px);
  display: flex;
  align-items: center;
  padding-block: var(--space-xxxl);
  background: var(--color-primary);
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: var(--website-section-spacing);
}

.hero__content {
  flex: 1;
  max-width: 520px;
}

.hero__title {
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-on-primary);
  text-wrap: balance;
  margin-bottom: var(--space-l);
}

.hero__subtitle {
  font-size: var(--text-body-large);
  line-height: 1.6;
  color: var(--color-on-primary);
  margin-bottom: var(--space-xxl);
  text-wrap: balance;
}

.hero__rating {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-top: var(--space-l);
  font-size: var(--text-body-medium);
  color: var(--color-on-primary);
}

/* Dimmed base row with a filled overlay clipped at the rating percentage */
.hero__rating-stars {
  position: relative;
  display: inline-flex;
}

.hero__rating-row {
  display: inline-flex;
  gap: var(--space-xxs);
  opacity: 0.35;
}

.hero__rating-row--filled {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
  opacity: 1;
}

.hero__rating-star {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Separator to the rating count, dropped when the line stacks on mobile */
.hero__rating-score::after {
  content: " –";
}

.hero__mockup {
  flex-shrink: 0;
}

/* Bezel composite from optimize-images.js — the frame is in the image */
.hero__mockup img {
  width: auto;
  max-height: min(640px, 70vh);
}


/* -------------------------------------------------------- */
/* 🔹 Tablet                                                */
/* -------------------------------------------------------- */

@media (max-width: 999px) {
  .hero__inner {
    flex-direction: column;
    text-align: center;
  }

  .hero__content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__subtitle {
    max-width: 520px;
  }

  .hero__rating {
    justify-content: center;
  }

  .hero__mockup img {
    max-height: 480px;
  }
}


/* -------------------------------------------------------- */
/* 🔹 Mobile                                                */
/* -------------------------------------------------------- */

@media (max-width: 767px) {
  /* Stacked content decides its own height on mobile */
  .hero {
    min-height: auto;
    padding-block: var(--space-xxxl);
  }

  .hero__inner {
    gap: var(--space-xxxl);
  }

  .hero__title {
    font-size: var(--text-display-small);
  }

  /* Stars, score, count on one line is the widest row in the hero —
     the count drops to a line of its own */
  .hero__rating {
    flex-wrap: wrap;
    row-gap: var(--space-xs);
  }

  .hero__rating-score::after {
    content: none;
  }

  .hero__rating-count {
    flex-basis: 100%;
  }

  .hero__mockup img {
    max-height: min(420px, 55vh);
  }
}


/* -------------------------------------------------------- */
/* 🔹 Desktop                                               */
/* -------------------------------------------------------- */

@media (min-width: 1000px) {
  .hero__title {
    font-size: clamp(48px, 4vw, 60px);
  }

  .hero__subtitle {
    font-size: 20px;
  }

  /* Phone takes the remaining width and centers within it, so it never
     hugs the far edge and the text↔phone spacing stays even */
  .hero__mockup {
    flex: 1;
    display: flex;
    justify-content: center;
  }
}
