/* ==========================================================================
   AB Digital — V2.2 shared page layer. Scoped: only affects elements inside
   [data-v22-page] (marketing pages) or [data-v22-app] (portal / admin).
   Inline styles on existing pages still win except where marked !important
   for a deliberate typographic upgrade.
   ========================================================================== */
html.lenis, html.lenis body { height: auto; }

/* ---- Reveal state (rev 2). Applies ONLY to elements ab-scroll.js has armed,
   inside a root it has marked, and only when motion is allowed. If this file,
   the script, or IntersectionObserver is missing, nothing is ever hidden. ---- */
@media (prefers-reduced-motion: no-preference) {
  /* transition only on the way IN, so arming hides instantly (off-screen) instead of fading out */
  [data-v22-reveal-on] [data-v22-armed][data-v22-in] {
    transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
    transition-delay: calc(var(--v22-i, 0) * 80ms);
  }
  [data-v22-reveal-on] [data-v22-armed]:not([data-v22-in]) { opacity: 0; transform: translateY(28px); }
  [data-v22-reveal-on] [data-v22-armed][data-v22-instant] { transition: none !important; }
}
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---- Marketing pages ---- */
[data-v22-page] { overflow-x: clip; }
[data-v22-page] h1 { font-weight: 900 !important; letter-spacing: -0.048em !important; line-height: 1 !important; font-size: clamp(42px, 6.4vw, 92px) !important; text-wrap: balance; }
[data-v22-page] section h2 { font-weight: 900 !important; letter-spacing: -0.042em !important; line-height: 1.04 !important; text-wrap: balance; }
[data-v22-page] p { text-wrap: pretty; }
[data-v22-page] > section:first-of-type { position: relative; isolation: isolate; }
[data-v22-page] > section:first-of-type::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(36,31,26,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(36,31,26,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 25%, transparent 75%);
}
[data-v22-page] a, [data-v22-page] button {
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}
[data-v22-page] a[style*="background:#E4572E"]:hover, [data-v22-page] button[style*="background:#E4572E"]:hover { transform: translateY(-2px); }
[data-v22-page] a:active, [data-v22-page] button:active { transform: scale(.98); }
[data-v22-page] a:focus-visible, [data-v22-page] button:focus-visible,
[data-v22-page] input:focus-visible, [data-v22-page] select:focus-visible, [data-v22-page] textarea:focus-visible {
  outline: 2px solid #E4572E; outline-offset: 3px;
}

/* ---- Portal / Admin (no scroll effects, no Lenis) ---- */
[data-v22-app] a, [data-v22-app] button { transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
[data-v22-app] button:not(:disabled):active { transform: scale(.98); }
[data-v22-app] a:focus-visible, [data-v22-app] button:focus-visible,
[data-v22-app] input:focus-visible, [data-v22-app] select:focus-visible, [data-v22-app] textarea:focus-visible { outline: 2px solid #E4572E; outline-offset: 2px; }
[data-v22-app] main > * { animation: v22-app-in .45s cubic-bezier(.22,1,.36,1) both; }
@keyframes v22-app-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  [data-v22-page] *, [data-v22-app] * { transition-duration: .01ms !important; animation: none !important; }
}
