body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  background-color: var(--bg);
  background-image: var(--texture-dots);
  background-size: 20px 20px;
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Soft paper grain sits behind content so text stays crisp */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: var(--texture-noise);
  background-size: 160px 160px;
  background-repeat: repeat;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 5vw, 2.5rem);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  position: relative;
  padding-block: var(--space-section);
  --section-bg: var(--band-paper);
  background:
    var(--texture-dots),
    var(--section-bg);
  background-size: 20px 20px, auto;
}

.section--band-paper { --section-bg: var(--band-paper); }
.section--band-mist { --section-bg: var(--band-mist); }
.section--band-sage { --section-bg: var(--band-sage); }
.section--band-warm { --section-bg: var(--band-warm); }
.section--band-stone { --section-bg: var(--band-stone); }
.section--band-leaf { --section-bg: var(--band-leaf); }

/* Legacy alias */
.section--alt {
  --section-bg: var(--band-stone);
}

.section--tight {
  padding-block: clamp(4rem, 8vw, 6rem);
}

/*
 * Gradient bridges between the two near-white bands.
 * Shape variants keep a soft silhouette; the blend does the transition.
 */
.wave {
  --wave-from: var(--band-light);
  --wave-to: var(--band-soft);
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 34C180 48 320 56 520 44C720 32 880 18 1080 28C1240 36 1360 42 1440 38V80H0Z'/%3E%3C/svg%3E");
  position: relative;
  display: block;
  width: 100%;
  height: clamp(4rem, 8vw, 6.5rem);
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    var(--texture-dots),
    linear-gradient(
      180deg,
      var(--wave-from) 0%,
      color-mix(in srgb, var(--wave-from) 82%, var(--wave-to)) 22%,
      color-mix(in srgb, var(--wave-from) 55%, var(--wave-to)) 48%,
      color-mix(in srgb, var(--wave-from) 28%, var(--wave-to)) 74%,
      var(--wave-to) 100%
    );
  background-size: 20px 20px, auto;
}

.wave svg {
  display: none;
}

/* From / to band colours */
.wave--from-paper { --wave-from: var(--band-paper); }
.wave--from-mist { --wave-from: var(--band-mist); }
.wave--from-sage { --wave-from: var(--band-sage); }
.wave--from-warm { --wave-from: var(--band-warm); }
.wave--from-stone { --wave-from: var(--band-stone); }
.wave--from-leaf { --wave-from: var(--band-leaf); }

.wave--to-paper { --wave-to: var(--band-paper); }
.wave--to-mist { --wave-to: var(--band-mist); }
.wave--to-sage { --wave-to: var(--band-sage); }
.wave--to-warm { --wave-to: var(--band-warm); }
.wave--to-stone { --wave-to: var(--band-stone); }
.wave--to-leaf { --wave-to: var(--band-leaf); }

/* Legacy aliases */
.wave--to-alt {
  --wave-from: var(--band-light);
  --wave-to: var(--band-soft);
}

.wave--to-bg {
  --wave-from: var(--band-soft);
  --wave-to: var(--band-light);
}

/* Soft organic silhouette of the lower band */
.wave::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    var(--texture-dots),
    linear-gradient(
      180deg,
      transparent 0%,
      color-mix(in srgb, var(--wave-to) 35%, transparent) 35%,
      var(--wave-to) 100%
    );
  background-size: 20px 20px, auto;
  -webkit-mask-image: var(--wave-mask);
  mask-image: var(--wave-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  opacity: 0.55;
}

/* Quiet centre accent — reads as a paper fold, not a border */
.wave::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(12rem, 32vw);
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--brand-grey) 45%, transparent) 35%,
    color-mix(in srgb, var(--accent) 30%, transparent) 50%,
    color-mix(in srgb, var(--brand-grey) 45%, transparent) 65%,
    transparent
  );
  opacity: 0.55;
}

/* Shape variants */
.wave--curve {
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 34C180 48 320 56 520 44C720 32 880 18 1080 28C1240 36 1360 42 1440 38V80H0Z'/%3E%3C/svg%3E");
}

.wave--slope {
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 22C360 22 720 48 1080 52C1260 54 1360 50 1440 46V80H0Z'/%3E%3C/svg%3E");
}

.wave--arc {
  height: clamp(4.5rem, 9vw, 7rem);
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 48C240 18 480 8 720 20C960 32 1200 58 1440 42V80H0Z'/%3E%3C/svg%3E");
}

.wave--ripple {
  height: clamp(4.25rem, 8.5vw, 6.75rem);
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M0 36C160 52 320 58 480 40C640 22 800 18 960 34C1120 50 1280 54 1440 38V80H0Z'/%3E%3C/svg%3E");
}

.wave--fade {
  height: clamp(5rem, 10vw, 7.5rem);
}

.wave--fade::before,
.wave--fade::after {
  display: none;
}

.wave--fold {
  height: clamp(3.25rem, 6vw, 4.75rem);
}

.wave--fold::before {
  display: none;
}

.wave--fold::after {
  width: min(14rem, 42vw);
  opacity: 0.7;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--primary) 22%, transparent) 40%,
    color-mix(in srgb, var(--accent) 32%, transparent) 50%,
    color-mix(in srgb, var(--primary) 22%, transparent) 60%,
    transparent
  );
}

/* Keep consecutive same-tint sections as one continuous band */
.section--alt + .section--alt,
.section--band-sage + .section--band-sage,
.section--band-leaf + .section--band-leaf,
.section--band-stone + .section--band-stone,
.section--band-mist + .section--band-mist,
.section--band-warm + .section--band-warm,
.section--band-paper + .section--band-paper {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.section-header {
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.section-header--center {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.section-eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.section-header--center .section-eyebrow::before {
  display: none;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 56ch;
}

.section-header--center .section-subtitle {
  margin-inline: auto;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 999;
  padding: var(--space-sm) var(--space-md);
  background: var(--primary);
  color: var(--text-on-accent);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-sm);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid { gap: var(--space-xl); }
}

@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
