* {
  box-sizing: border-box;
  font-family: var(--font-family);
}

html,
body {
  margin: 0;
  padding: 0;
}

header {
  width: 100%;
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) 14rem;
  color: var(--text-primary);
  align-items: center;
  justify-content: space-between;
  align-content: center;
  padding: var(--space-md);
  height: 5rem;
  overflow: visible;

  transition: background-color var(--transition-base),
              box-shadow var(--transition-base);
}

header h1 {
  font-size: var(--font-size-xl);
  margin: 0;
  justify-self: flex-start;
}

header nav ul {
  list-style-type: none;
  padding: 0;
  justify-self: center;
  margin: 0;
}

header nav ul li {
  display: inline;
  margin: 0 var(--space-md);
  font-weight: bold;
}

header nav ul li a {
  color: var(--color-primary);
  text-decoration: none;
}

header nav ul li a:hover {
  color: var(--color-secondary);
}

header #logo {
  width: 140%;
}

.sticky-header {
  position: sticky;
  top: var(--space-lg);
  z-index: 100;
}

/* Hero Background Animation */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-background img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-background img.active {
  opacity: 1;
}

/* Animation keyframes for smooth cycling */
@keyframes heroBackgroundCycle {
  0% { opacity: 1; }
  7.14% { opacity: 1; }
  14.28% { opacity: 0; }
  92.86% { opacity: 0; }
  100% { opacity: 1; }
}

.hero-background.animated img {
  animation: heroBackgroundCycle 42s infinite;
}

/* Stagger the animation for each image */
.hero-background.animated img:nth-child(1) { animation-delay: 0s; }
.hero-background.animated img:nth-child(2) { animation-delay: 3s; }
.hero-background.animated img:nth-child(3) { animation-delay: 6s; }
.hero-background.animated img:nth-child(4) { animation-delay: 9s; }
.hero-background.animated img:nth-child(5) { animation-delay: 12s; }
.hero-background.animated img:nth-child(6) { animation-delay: 15s; }
.hero-background.animated img:nth-child(7) { animation-delay: 18s; }
.hero-background.animated img:nth-child(8) { animation-delay: 21s; }
.hero-background.animated img:nth-child(9) { animation-delay: 24s; }
.hero-background.animated img:nth-child(10) { animation-delay: 27s; }
.hero-background.animated img:nth-child(11) { animation-delay: 30s; }
.hero-background.animated img:nth-child(12) { animation-delay: 33s; }
.hero-background.animated img:nth-child(13) { animation-delay: 36s; }
.hero-background.animated img:nth-child(14) { animation-delay: 39s; }

@media screen and (max-width: 768px) {
  body {
    display: none;
    font-size: 90%;
  }

  .button {
    font-size: var(--font-size-sm);
  }

  header {
    grid-template-columns: 1fr 1fr;
    height: 5rem;
    padding: var(--space-sm);
    top: 0;
  }

  header.mt-md {
    margin-top: 0 !important;
  }

  header.radius-xl {
    border-radius: 0 !important;
  }

  header.sticky-header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 100;
  }

  header #logo {
    width: 10rem;
  }

  header nav.flex {
    display: none !important;
  }

  header h1 {
    font-size: var(--font-size-lg);
    text-align: center;
  }
}
