.hero {
  position: relative;
  height: 672px;
  overflow: hidden;
}

.hero__backgrounds,
.hero__background {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__background {
  opacity: 0;
  transition: opacity 1000ms ease-out;
}

.hero__background.is-active {
  opacity: 1;
}

.hero__background--desert {
  background:
    radial-gradient(55% 55% at 82% 32%, rgb(244 180 26 / .25), transparent 70%),
    radial-gradient(45% 45% at 98% 82%, rgb(217 179 134 / .2), transparent 72%);
}

.hero__background--apex {
  background:
    radial-gradient(55% 55% at 82% 32%, rgb(255 0 0 / .25), transparent 70%),
    radial-gradient(45% 45% at 98% 82%, rgb(26 26 26 / .2), transparent 72%);
}

.hero__background--groceries {
  background:
    radial-gradient(55% 55% at 82% 32%, rgb(151 166 126 / .25), transparent 70%),
    radial-gradient(45% 45% at 98% 82%, rgb(241 201 75 / .2), transparent 72%);
}

.hero__grid {
  position: relative;
  display: grid;
  width: min(100%, 1152px);
  height: 100%;
  margin-inline: auto;
  padding: 96px 24px;
  grid-template-columns: 540.875px 515.109px;
  align-items: center;
  gap: 48px;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero__eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 4px 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.hero__eyebrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero h1 {
  margin-top: 24px;
  color: #0f121d;
  font-family: var(--display);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: .95;
  text-wrap: balance;
}

.hero__lead {
  max-width: 448px;
  margin-top: 24px;
  color: var(--muted-foreground);
  font-size: 18px;
  line-height: 29.25px;
  text-wrap: pretty;
}

.hero__cta {
  height: 72px;
  margin-top: 32px;
  padding-inline: 40px;
  gap: 8px;
  font-size: 20px;
  line-height: 28px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}

.hero__cta svg {
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__counter {
  display: flex;
  min-height: 29px;
  margin-top: 24px;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 6px;
  color: var(--muted-foreground);
  font-size: 16px;
  line-height: 24px;
}

.hero__counter-number {
  color: var(--foreground);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;
  font-variant-numeric: tabular-nums;
}

.hero__counter svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
  stroke: var(--background);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__showcase {
  width: 100%;
}

.hero__composition {
  position: relative;
  width: min(100%, 448px);
  aspect-ratio: 1;
  margin-inline: auto;
}

.hero-card {
  position: absolute;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 20px 25px -5px rgb(15 18 29 / .05), 0 8px 10px -6px rgb(15 18 29 / .05);
}

.hero-card > p,
.hero-card > span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.hero-card--primary {
  top: 16px;
  left: 0;
  z-index: 1;
  width: 240px;
  padding: 16px;
  transform: rotate(-4deg);
}

.hero-card__primary-image {
  position: relative;
  display: flex;
  aspect-ratio: 4 / 3;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.hero-card--primary > p {
  margin-top: 12px;
}

.hero-card--palette {
  top: 0;
  right: 0;
  z-index: 2;
  width: 176px;
  padding: 16px;
  transform: rotate(3deg);
}

.hero-card--palette > p {
  margin-bottom: 12px;
  font-weight: 500;
}

.hero-card__swatches {
  display: flex;
  height: 40px;
  gap: 6px;
}

.hero-card__swatches span {
  flex: 1;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgb(15 18 29 / .1);
  transition: background-color 700ms ease-out;
}

.hero-card__swatches span:nth-child(1) {
  background: #d9b386;
}

.hero-card__swatches span:nth-child(2) {
  background: #f4b41a;
}

.hero-card__swatches span:nth-child(3) {
  background: #5c6570;
}

.hero-card__swatches span:nth-child(4) {
  background: #f5f5f3;
}

.hero[data-brand="apex"] .hero-card__swatches span:nth-child(1) {
  background: #ff0000;
}

.hero[data-brand="apex"] .hero-card__swatches span:nth-child(2) {
  background: #1a1a1a;
}

.hero[data-brand="apex"] .hero-card__swatches span:nth-child(3) {
  background: #ffffff;
}

.hero[data-brand="apex"] .hero-card__swatches span:nth-child(4) {
  background: #eef2f7;
}

.hero[data-brand="groceries"] .hero-card__swatches span:nth-child(1) {
  background: #97a67e;
}

.hero[data-brand="groceries"] .hero-card__swatches span:nth-child(2) {
  background: #f1c94b;
}

.hero[data-brand="groceries"] .hero-card__swatches span:nth-child(3) {
  background: #1e314f;
}

.hero[data-brand="groceries"] .hero-card__swatches span:nth-child(4) {
  background: #f3eadf;
}

.hero-card--cover {
  right: 0;
  bottom: 40px;
  z-index: 3;
  width: 240px;
  padding: 12px;
  transform: rotate(-2deg);
  box-shadow: 0 20px 25px -5px rgb(15 18 29 / .1), 0 8px 10px -6px rgb(15 18 29 / .1);
}

.hero-card__cover-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.hero-card--cover > p {
  margin: 10px 4px 0;
}

.hero-card--typeface {
  bottom: 0;
  left: 8px;
  z-index: 2;
  width: 192px;
  padding: 16px;
  transform: rotate(2deg);
}

.hero-card--typeface > p {
  margin-bottom: 4px;
  font-weight: 500;
}

.hero-card--typeface strong {
  display: block;
  font-family: var(--display);
  font-size: 30px;
  line-height: 30px;
  letter-spacing: -.025em;
}

.hero-card--typeface > span {
  display: block;
  margin-top: 4px;
}

.hero-card--symbol {
  display: grid;
  top: 208px;
  left: 64px;
  z-index: 4;
  width: 80px;
  height: 80px;
  padding: 14px;
  place-items: center;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}

.hero-state-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 700ms ease-out;
}

.hero-card__primary-image .hero-state-image {
  padding: 8px;
}

.hero-card__cover-image .hero-state-image {
  object-fit: cover;
}

.hero-state-image.is-active {
  opacity: 1;
}

.hero__controls {
  display: flex;
  margin-top: 16px;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hero__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero__dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  background: rgb(15 18 29 / .2);
  cursor: pointer;
  transition: width 300ms ease, background-color 300ms ease;
}

.hero__dots button:hover {
  background: rgb(15 18 29 / .4);
}

.hero__dots button.is-active {
  width: 24px;
  background: var(--primary);
}

.hero__caption {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

@media (max-width: 1023px) {
  .hero {
    height: auto;
  }

  .hero__grid {
    height: auto;
    padding-block: 64px;
    grid-template-columns: 1fr;
  }

  .hero__copy {
    width: min(100%, 672px);
    margin-inline: auto;
  }

  .hero__showcase {
    max-width: 515px;
    margin-inline: auto;
  }
}

@media (max-width: 767px) {
  .hero__grid {
    padding: 48px 16px 64px;
  }

  .hero h1 {
    font-size: 48px;
    line-height: .95;
  }

  .hero__cta {
    height: 64px;
    padding-inline: 32px;
    font-size: 18px;
    line-height: 28px;
  }

  .hero__counter-number {
    font-size: 20px;
    line-height: 28px;
  }

  .hero__composition {
    width: min(100%, 358px);
  }

  .hero-card--symbol {
    display: none;
  }
}

@media (max-width: 370px) {
  .hero-card--primary,
  .hero-card--cover {
    width: 67%;
  }

  .hero-card--palette {
    width: 49%;
  }

  .hero-card--typeface {
    width: 54%;
  }
}
