/* ShowYouIn: motion, the sticky header, the phone CTA bar, the ticker.
   Every pre-animation state sits under `html.motion`, which js/boot.js adds only when
   JavaScript runs and the reader hasn't asked for reduced motion. Without it, every
   element is already in its final place. Only transform and opacity animate. */

:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
html { scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Header: sticky, solid once scrolled, out of the way on the way down. ---------------- */
header.site {
  position: sticky !important; top: 0; z-index: 40;
  transition: transform .35s var(--ease-out), background-color .25s ease, box-shadow .25s ease, padding .25s ease;
}
header.site::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: var(--hdr-bg, rgba(255,244,226,.86));
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--hdr-line, rgba(29,27,51,.08));
  transition: opacity .25s ease;
}
header.site { max-width: none !important; }
header.site > * { position: relative; }
header.site.scrolled { padding-top: 12px !important; padding-bottom: 12px !important; }
header.site.scrolled::before { opacity: 1; }
header.site.away { transform: translateY(-110%); }
header.site:focus-within { transform: none; }
/* The header is full-width now; keep its content on the page's 1280 grid. */
header.site { padding-left: max(clamp(20px, 4vw, 48px), calc((100vw - 1280px) / 2 + clamp(20px, 4vw, 48px))) !important;
              padding-right: max(clamp(20px, 4vw, 48px), calc((100vw - 1280px) / 2 + clamp(20px, 4vw, 48px))) !important; }

/* Buttons: instant press feedback, a small lift on real hover. ------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
       transition: transform .18s var(--ease-out), box-shadow .25s ease, background-color .2s ease, filter .2s ease; }
.btn:hover { text-decoration: none !important; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(15,14,23,.45); filter: brightness(1.04); }
  .btn .arrow { transition: transform .25s var(--ease-out); }
  .btn:hover .arrow { transform: translateX(4px); }
  .lift { transition: transform .35s var(--ease-out), box-shadow .35s ease; }
  .lift:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -24px rgba(15,14,23,.5); text-decoration: none !important; }
  .lift img { transition: transform .8s var(--ease-out); }
  .lift:hover img { transform: scale(1.05); }
}
.btn:active { transform: scale(.97); transition-duration: .06s; }

/* Reveal ------------------------------------------------------------------------------- */
.motion [data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s ease, transform .9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.motion [data-reveal="fade"] { transform: none; }
.motion [data-reveal="scale"] { transform: scale(.94); }
.motion [data-reveal="left"] { transform: translateX(-28px); }
.motion [data-reveal].in { opacity: 1; transform: none; }

/* Chat: the transcript is in the HTML; with motion it plays message by message. -------- */
.motion [data-chat] [data-msg] { opacity: 0; transform: translateY(10px) scale(.98); transform-origin: bottom left;
  transition: opacity .35s ease, transform .45s var(--ease-out); }
.motion [data-chat] [data-msg="you"] { transform-origin: bottom right; }
.motion [data-chat] [data-msg].shown { opacity: 1; transform: none; }
.typing { position: relative; color: transparent !important; }
.typing > * { visibility: hidden; }
.typing::after {
  content: ""; position: absolute; left: 16px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: currentColor; color: var(--dot, #8E89AD);
  box-shadow: 12px 0 0 var(--dot, #8E89AD), 24px 0 0 var(--dot, #8E89AD);
  animation: typing 1s infinite ease-in-out;
}
@keyframes typing { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.replay { font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 8px 4px; background: none; border: 0;
          color: inherit; opacity: .75; cursor: pointer; display: none; align-items: center; gap: 6px; align-self: flex-start; }
.motion .replay { display: inline-flex; }
.replay:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* Numbers and dots ---------------------------------------------------------------------- */
[data-count] { font-variant-numeric: tabular-nums; }
.motion [data-dots] > * { opacity: .25; transform: scale(.6); transition: opacity .3s ease, transform .4s var(--ease-out);
                          transition-delay: calc(var(--i, 0) * 14ms); }
.motion [data-dots].in > * { opacity: 1; transform: none; }

/* Ticker: real-looking enquiries, in the languages people write. It has a pause button
   (WCAG 2.2.2); reduced motion gets a static, wrapping row. ----------------------------- */
.ticker { position: relative; overflow: hidden;
          -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-row { display: flex; gap: 12px; }
.ticker-track { display: flex; gap: 12px; width: max-content; padding: 4px 0; }
.ticker-track > * { flex: 0 0 auto; }
.ticker-track[aria-hidden="true"] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .ticker-row { display: flex; gap: 12px; width: max-content; animation: ticker var(--ticker-time, 60s) linear infinite; }
  .ticker-track[aria-hidden="true"] { display: flex; }
  .ticker[data-paused] .ticker-row, .ticker.off .ticker-row { animation-play-state: paused; }
  .ticker:hover .ticker-row { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker { -webkit-mask-image: none; mask-image: none; }
  .ticker-row { display: block; }
  .ticker-track { flex-wrap: wrap; width: auto; padding: 0 clamp(20px, 4vw, 48px) !important; }
  .ticker-toggle { display: none !important; }
}
@keyframes ticker { to { transform: translateX(calc(-50% - 6px)); } }

/* Progress-driven (js sets --p from 0 to 1 as the element crosses the screen). ----------- */
.motion [data-progress] .par { transform: translate3d(0, calc((var(--p, .5) - .5) * var(--par, -80px)), 0); will-change: transform; }
.motion [data-progress] .glow { opacity: calc(.35 + var(--p, 1) * .9); transform: scale(calc(.9 + var(--p, 1) * .14)); transform-origin: bottom center; }
.motion [data-progress] .line-fill { transform: scaleX(min(1, calc(var(--p, 1) * 2.2 - .5))); transform-origin: left center; }

/* Phone CTA bar ------------------------------------------------------------------------- */
.mcta { display: none; }
@media (max-width: 760px) {
  .mcta {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50;
    align-items: center; justify-content: center; gap: 10px; min-height: 52px; border-radius: 999px;
    font-weight: 700; font-size: 17px; text-decoration: none !important;
    box-shadow: 0 12px 32px -8px rgba(15,14,23,.55);
    transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none;
    transition: transform .4s var(--ease-out), opacity .25s ease;
  }
  .mcta.show { transform: none; opacity: 1; pointer-events: auto; }
  body:has(.mcta) footer { padding-bottom: 96px !important; }
}

@media (prefers-reduced-motion: reduce) {
  header.site, .mcta { transition: none; }
  header.site.away { transform: none; }
}
