*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: 0.002em;
  color: var(--text);
  background: var(--off-white);
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Anchor bounce — JS adds .anchor-bounce to the target section on hash navigation */
@media (prefers-reduced-motion: no-preference) {
  @keyframes anchor-bounce {
    0%   { transform: translateY(0); }
    18%  { transform: translateY(-22px); }
    38%  { transform: translateY(0); }
    54%  { transform: translateY(-11px); }
    70%  { transform: translateY(0); }
    82%  { transform: translateY(-5px); }
    92%  { transform: translateY(0); }
    97%  { transform: translateY(-2px); }
    100% { transform: translateY(0); }
  }

  .anchor-bounce {
    animation: anchor-bounce 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* Scroll reveal — JS adds [data-reveal] to targets, then toggles .is-visible */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(44px);
    transition:
      opacity 0.55s ease,
      transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* use:reveal action — applied via Svelte action on section elements */
.reveal-ready.reveal-block {
  opacity: 0;
  transform: translate3d(0, var(--reveal-distance, 24px), 0);
  transition:
    opacity 0.55s ease,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-visible.reveal-block {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
