/* Desktop scroll shrink (Apple-like) — disabled on mobile / reduced-motion */

html.ah-ss-on {
  scroll-behavior: auto;
}

html.ah-ss-on .ah-ss-frame {
  --ss-scale: 1;
  --ss-y: 0px;
  --ss-r: 0px;
  --ss-fade: 0;
  transform: translate3d(0, var(--ss-y), 0) scale(var(--ss-scale));
  transform-origin: 50% 0%;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hero already has radius — deepen only while shrinking */
html.ah-ss-on .ah-ss-frame--hero.is-ss-shrinking {
  border-radius: var(--ss-r);
}

/* Sections gently become “cards” as they recede (paint-only — no layout thrash) */
html.ah-ss-on .ah-ss-frame--section {
  position: relative;
  border-radius: var(--ss-r);
  background: rgba(255, 255, 255, calc(var(--ss-fade) * 0.03));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, calc(var(--ss-fade) * 0.07)),
    0 28px 64px -28px rgba(0, 0, 0, calc(var(--ss-fade) * 0.55)),
    inset 0 1px 0 rgba(255, 255, 255, calc(var(--ss-fade) * 0.08));
}

/* Soft veil — depth without muddy overlay */
html.ah-ss-on .ah-ss-frame--section::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(7, 8, 12, calc(var(--ss-fade) * 0.12)) 0%,
    rgba(7, 8, 12, calc(var(--ss-fade) * 0.28)) 100%
  );
  opacity: var(--ss-fade);
  transition: none;
  z-index: 2;
}

html.ah-ss-on .ah-ss-frame--section > * {
  position: relative;
  z-index: 1;
}

/* Keep content interactive while shrinking */
html.ah-ss-on .ah-ss-frame.is-ss-shrinking {
  pointer-events: auto;
}

@media (max-width: 1023px), (hover: none), (pointer: coarse) {
  html.ah-ss-on .ah-ss-frame {
    transform: none !important;
    will-change: auto;
  }

  html.ah-ss-on .ah-ss-frame--section {
    background: transparent !important;
    box-shadow: none !important;
  }

  html.ah-ss-on .ah-ss-frame--section::after {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ah-ss-on .ah-ss-frame {
    transform: none !important;
  }
}
