/* Home: hero / slider, intro and category boxes. */
/* Hero: as on the live site, a light patterned plate with the product photo on the left,
   logo and headline on the right; the photo slides in from the right, logo and headline follow. */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--color-heading);
  background: #fff url("../img/overlay-abstract.png") center / cover no-repeat;
}

.hero__slide[hidden] {
  display: none;
}

.hero__inner {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  padding-block: var(--space-6);
}

.hero--slider .hero__inner {
  padding-bottom: calc(var(--space-6) + 2.5rem); /* room for the controls */
}

.hero__media {
  display: flex;
  justify-content: center;
}

.hero__media img {
  width: 100%;
  max-width: 40rem;
  height: auto;
}

.hero__text {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  text-align: center;
}

.hero__logo {
  width: min(16rem, 70%);
  height: auto;
}

.hero__title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: var(--leading-tight);
}

.hero__lead {
  max-width: 48ch;
  margin: 0;
  font-size: var(--text-lg);
}

.hero__cta {
  display: inline-block;
  padding: var(--space-2) var(--space-5);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

.hero__cta:hover {
  background: var(--color-primary);
  color: var(--color-on-brand);
}

@media (min-width: 800px) {
  .hero__inner {
    grid-template-columns: 1.15fr 0.85fr;
    min-height: 29rem;
  }
}

/* Entrance, the same order as the live slider. */
@keyframes hero-in-right {
  from { transform: translateX(110vw); }
  to { transform: none; }
}

@keyframes hero-in-top {
  from { transform: translateY(-300%); }
  to { transform: none; }
}

@keyframes hero-in-bottom {
  from { transform: translateY(300%); }
  to { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__slide:not([hidden]) .hero__media img {
    animation: hero-in-right 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
  }

  .hero__slide:not([hidden]) .hero__logo {
    animation: hero-in-top 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.4s backwards;
  }

  .hero__slide:not([hidden]) .hero__title,
  .hero__slide:not([hidden]) .hero__lead,
  .hero__slide:not([hidden]) .hero__cta {
    animation: hero-in-bottom 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.4s backwards;
  }
}

/* Slider controls */
.hero__controls {
  position: absolute;
  inset: auto 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.hero__dots {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__dot {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  background: transparent;
}

.hero__dot::after { /* larger tap target */
  content: "";
  position: absolute;
  inset: -0.75rem;
}

.hero__dot[aria-current="true"] {
  background: var(--color-primary);
}

.hero__btn {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 119 175 / 0.12);
  color: var(--color-primary);
}

.hero__btn:hover {
  background: rgb(0 119 175 / 0.25);
}

.hero__btn .icon {
  width: 1rem;
  height: 1rem;
}

.hero__prev .icon {
  transform: rotate(90deg);
}

.hero__next .icon {
  transform: rotate(-90deg);
}

/* Without JS the slider shows its first slide only and has no controls. */
html:not(.js) .hero__controls {
  display: none;
}

/* Intro */
.home-intro__body {
  max-width: none;
}

.home-intro__body h1 {
  font-size: var(--text-2xl);
  text-align: center;
}

/* Category boxes (same look as the product cards) */
.home-boxes {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

@media (min-width: 1100px) {
  .home-boxes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-box {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--accent, var(--color-primary));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.home-box:hover,
.home-box:focus-within {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.home-box__media {
  aspect-ratio: 4 / 3;
  background: var(--accent-tint, var(--color-bg-soft));
  overflow: hidden;
}

.home-box__media picture,
.home-box__media img {
  width: 100%;
  height: 100%;
}

.home-box__media img {
  object-fit: cover;
}

.home-box__body {
  flex: 1;
  padding: var(--space-4);
}

.home-box__title {
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
}

.home-box__link {
  color: var(--color-heading);
  text-decoration: none;
}

.home-box__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.home-box__link:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.home-box__link:focus-visible {
  outline: none;
}

.home-box:has(.home-box__link:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.home-box__summary {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .home-box:hover,
  .home-box:focus-within {
    transform: none;
  }
}

.hero__pause {
  font-size: 0.6rem;
  line-height: 1;
  letter-spacing: -0.1em;
}
