/*
  The home page.
  Layout for its own sections on top of tokens.css and base.css; the chrome and the
  buttons keep coming from chrome.css and base.css. The home page loads no offer
  script, so nothing in this file depends on the checkout DOM.
*/

/* Section rhythm ---------------------------------------------------------- */

/*
  The source alternates white and cream bands separated by a hairline. Both
  backgrounds and the divider live on one class so a new band only needs the
  modifier.
*/
.home-section {
  border-top: 1px solid var(--line-soft);
  background: var(--cream);
}

.home-section--white {
  background: var(--white);
}

.home-section__inner {
  padding-block: 3.5rem;
}

/* The hero carries the page's first heading, so it needs no top divider. */
.home-hero {
  border-top: 0;
  overflow: hidden;
}

.home-section__title {
  font-size: 1.5rem;
}

.home-section__lead {
  max-width: 42rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Anchored sections sit under the sticky header. */
#product,
#how-to-use,
#ingredients {
  scroll-margin-top: 6rem;
}

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

.home-hero__inner {
  display: grid;
  align-items: center;
  gap: 0;
  max-width: none;
  padding: 0;
}

.home-hero__text {
  width: 100%;
  padding: 3.5rem var(--gutter) 4rem;
}

.home-hero__title {
  margin-top: 0.75rem;
  font-size: 1.875rem;
  letter-spacing: -0.01em;
}

.home-hero__lead {
  max-width: 36rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.home-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.home-hero__note {
  margin-top: 1rem;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.7;
}

.home-hero__media {
  position: relative;
  width: 100%;
  min-height: 24rem;
  overflow: hidden;
  background: #769fa0;
}

.home-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% center;
}

.home-hero__media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--white) 0,
    rgba(255, 255, 255, 0.88) 7%,
    rgba(255, 255, 255, 0.52) 18%,
    rgba(255, 255, 255, 0.18) 32%,
    rgba(255, 255, 255, 0) 44%
  );
  content: "";
  pointer-events: none;
}

/* Pillars ----------------------------------------------------------------- */

.home-cards {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.home-pillar {
  padding: 1.5rem;
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.home-pillar__title {
  font-size: 1.125rem;
}

.home-pillar__body {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Product facts ----------------------------------------------------------- */

.home-fact {
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--cream);
  outline: 1px solid var(--line-soft);
}

/* On a white band the fact cards invert: cream fill instead of white. */
.home-section--white .home-fact {
  background: var(--cream);
}

.home-fact__icon {
  width: 7rem;
  height: 7rem;
  margin: 0 auto 1.25rem;
}

.home-fact__icon--brand {
  width: 10.25rem;
  object-fit: contain;
}

.home-fact__label {
  color: var(--teal);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-fact__body {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* How to use -------------------------------------------------------------- */

.home-how__inner {
  display: grid;
  gap: 2.5rem;
  padding-block: 3.5rem;
}

.home-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.home-steps__item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* The counter is markup, not a list-style, so the circle can be sized freely. */
.home-steps__marker {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--cream);
  font-size: 0.75rem;
  font-weight: 700;
}

.home-steps__text {
  padding-top: 0.25rem;
}

.home-how__note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.home-order-card {
  align-self: start;
  padding: 1.5rem;
  border: 1px solid rgba(37, 143, 140, 0.2);
  border-radius: 1rem;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.home-order-card__title {
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-order-card__body {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.home-order-card__cta {
  margin-top: 1.5rem;
}

/* Ingredients ------------------------------------------------------------- */

.home-ingredients {
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  background: rgba(251, 250, 247, 0.6);
}

/*
  Three columns — name, amount, NRV — shared by the header row and every item so
  the numbers stay aligned without a <table>.
*/
.home-ingredients__row {
  display: grid;
  grid-template-columns: 1fr auto 4.5rem;
  gap: 0.5rem;
  padding: 1rem;
}

.home-ingredients__head {
  border-bottom: 1px solid var(--line);
  background: rgba(238, 245, 244, 0.6);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The header row reuses the column classes purely for alignment. */
.home-ingredients__head .home-ingredients__amount,
.home-ingredients__head .home-ingredients__nrv {
  font: inherit;
  color: inherit;
}

.home-ingredients__item {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.home-ingredients__item:last-child {
  border-bottom: 0;
}

.home-ingredients__name {
  font-weight: 600;
}

.home-ingredients__note {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.home-ingredients__amount {
  text-align: right;
  font-size: 0.875rem;
  font-weight: 500;
}

.home-ingredients__nrv {
  text-align: right;
  color: var(--muted);
  font-size: 0.75rem;
}

.home-ingredients__foot {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.6;
}

.home-ingredients__composition {
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.6;
}

/* Closing disclaimer ------------------------------------------------------ */

.home-legal__inner {
  padding-block: 2.5rem;
}

.home-legal__text {
  max-width: 56rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Breakpoints ------------------------------------------------------------- */

@media (min-width: 640px) {
  .home-how__inner {
    padding-block: 5rem;
  }

  .home-hero__text {
    padding-block: 5rem;
  }

  .home-section__inner {
    padding-block: 3.5rem;
  }

  .home-hero__title {
    font-size: 2.25rem;
  }

  .home-hero__lead,
  .home-section__lead {
    font-size: 1rem;
  }

  .home-hero__actions {
    flex-direction: row;
    align-items: center;
  }

  .home-section__title {
    font-size: 1.875rem;
  }

  .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* The third fact card fills the orphan slot until the 3-up grid kicks in. */
  .home-facts .home-fact:nth-child(3) {
    grid-column: span 2;
  }

  .home-ingredients__row {
    grid-template-columns: 1fr auto 6rem;
    padding-inline: 1.5rem;
  }

  .home-ingredients__foot {
    padding-inline: 1.5rem;
  }

  .home-ingredients__composition {
    padding-inline: 1.5rem;
  }

  .home-order-card {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .home-how__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-hero__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-hero__text {
    max-width: calc(var(--container) / 2);
    justify-self: end;
    padding: 4.5rem clamp(2.5rem, 4vw, 4.5rem) 5rem var(--gutter);
  }

  .home-hero__media {
    align-self: stretch;
    min-height: 0;
  }

  .home-hero__media::after {
    background: linear-gradient(
      90deg,
      var(--white) 0,
      rgba(255, 255, 255, 0.9) 7%,
      rgba(255, 255, 255, 0.56) 18%,
      rgba(255, 255, 255, 0.2) 32%,
      rgba(255, 255, 255, 0) 44%
    );
  }

  .home-hero__title {
    font-size: 3rem;
  }

  .home-pillars .home-cards,
  .home-facts .home-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-facts .home-fact:nth-child(3) {
    grid-column: auto;
  }
}
