/* Snap on every screen while allowing long sections to grow with their content. */
html {
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--site-header-height);
}

[data-snap] {
  scroll-snap-align: start;
}

.site-section {
  min-height: calc(100vh - var(--site-header-height));
  min-height: calc(100svh - var(--site-header-height));
  padding: clamp(48px, 10vh, 88px) clamp(24px, 6vw, 80px);
  padding: clamp(48px, 10svh, 88px) clamp(24px, 6vw, 80px);
}

.site-content {
  justify-content: center;
  gap: clamp(32px, 6vh, 56px);
  gap: clamp(32px, 6svh, 56px);
}

.site-contact {
  justify-content: center;
  gap: clamp(48px, 8vh, 80px);
  gap: clamp(48px, 8svh, 80px);
}

/* Preserve the existing layout on large screens. */
@media (min-width: 900px) and (min-height: 640px) {
  html {
    scroll-padding-top: 88px;
  }

  .site-section {
    min-height: 0;
  }

  .site-hero {
    min-height: calc(100vh - 116px);
    padding: clamp(160px, 30vh, 340px) clamp(24px, 6vw, 80px) clamp(64px, 12vh, 140px);
  }

  .site-hero--error {
    padding-top: clamp(120px, 24vh, 280px);
  }

  .site-content {
    min-height: calc(100vh - 88px);
    padding: clamp(96px, 16vh, 180px) clamp(24px, 6vw, 80px);
    gap: clamp(56px, 9vh, 96px);
  }

  .site-contact {
    justify-content: normal;
    padding: clamp(96px, 16vh, 180px) clamp(24px, 6vw, 80px) 40px;
    gap: clamp(80px, 14vh, 160px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
    scroll-behavior: auto;
  }
}
