/* ══════════════════════════════════════════════════════════════════════
   XS IMPACT — ENHANCEMENT LAYER  v1
   Modular & additive. Pairs with assets/js/enhancements.js.
   ROLLBACK: remove the enhancements.css / enhancements.js tags from the
   page <head>. No existing file depends on this one.

   Notes:
   - .xs-motion is set on <html> by enhancements.js ONLY when JS is running
     AND prefers-reduced-motion is NOT set. Anything gated behind it fails
     safe (fully visible, no motion) for no-JS and reduced-motion users.
   - The site's existing prefers-reduced-motion overrides live inside
     @layer overrides with !important, which also neutralizes everything
     here. Belt and suspenders.
   - Transform/opacity only. Nothing below changes layout on animate.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Shared keyframes ─────────────────────────────────────────────────── */

@keyframes xs-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes xs-ambient-drift {
  0% {
    transform: translate3d(-4%, -3%, 0) scale(1);
  }

  50% {
    transform: translate3d(4%, 3%, 0) scale(1.08);
  }

  100% {
    transform: translate3d(-4%, -3%, 0) scale(1);
  }
}

@keyframes xs-heartbeat {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.035);
    opacity: .8;
  }
}

@keyframes xs-menu-in {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes xs-menu-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §9 SCROLL BEHAVIOR — smooth scroll (class set by JS, motion-gated)
   ══════════════════════════════════════════════════════════════════════ */

html.xs-smooth {
  scroll-behavior: smooth;
}

/* ══════════════════════════════════════════════════════════════════════
   §1 HERO — ambient background, staggered intro, parallax
   ══════════════════════════════════════════════════════════════════════ */

/* Ambient layer (div injected by JS as first child of .hero):
   slow-drifting dark radial glow over a faint geometric grid.
   Sits under .hero-content (z2) and .hero-image (later in DOM). */
.xs-hero-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.xs-hero-ambient::before {
  /* faint geometric mesh — sharp, dark */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 175, 55, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, .045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 0%, transparent 75%);
}

.xs-hero-ambient::after {
  /* slow-moving dark gold glow */
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 28% 35%, rgba(212, 175, 55, .07) 0%, transparent 42%),
    radial-gradient(circle at 75% 70%, rgba(255, 255, 255, .03) 0%, transparent 38%);
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .xs-hero-ambient::after {
    animation: xs-ambient-drift 26s ease-in-out infinite;
  }
}

/* Parallax (transform driven by JS; base scale prevents edge gaps) */
.hero .hero-image {
  overflow: hidden;
}

.xs-parallax {
  transform: scale(1.08);
  will-change: transform;
}

/* Headline line-by-line entrance.
   Hidden states ONLY exist under .xs-motion + .xs-hero-split (both set by
   JS after the DOM is rebuilt), so nothing can be stranded invisible. */
.xs-line {
  display: block;
}

.xs-line-inner {
  display: inline-block;
}

.xs-motion .xs-hero.xs-hero-split .xs-line-inner {
  opacity: 0;
  transform: translateY(.55em);
}

.xs-motion .xs-hero.xs-hero-split.xs-hero-live .xs-line-inner {
  /* sharp rise — per-line delay set inline by JS */
  animation: xs-rise .6s cubic-bezier(.22, 1, .36, 1) forwards;
}

/* Subheadline, description, CTA — staggered after the headline */
.xs-motion .xs-hero .hero-subtitle,
.xs-motion .xs-hero .hero-description,
.xs-motion .xs-hero .hero-content>.btn {
  opacity: 0;
}

.xs-motion .xs-hero.xs-hero-live .hero-subtitle {
  animation: xs-rise .55s cubic-bezier(.22, 1, .36, 1) .50s forwards;
}

.xs-motion .xs-hero.xs-hero-live .hero-description {
  animation: xs-rise .55s cubic-bezier(.22, 1, .36, 1) .64s forwards;
}

.xs-motion .xs-hero.xs-hero-live .hero-content>.btn {
  animation: xs-rise .55s cubic-bezier(.22, 1, .36, 1) .78s forwards;
}

/* ══════════════════════════════════════════════════════════════════════
   §2 NAVIGATION — past-hero frosted state, underline hovers, mobile menu
   ══════════════════════════════════════════════════════════════════════ */

/* Deeper frosted-glass state once scrolled past the hero (JS toggles) */
.navbar.xs-past-hero {
  /* Distinctly more glassy than the near-opaque resting state, so the
     shift is visible on every page, not just over the home hero. */
  background-color: rgba(10, 10, 10, .62) !important;
  backdrop-filter: blur(20px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.5) !important;
  border-bottom-color: rgba(212, 175, 55, .35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}

/* Underline sweep on desktop nav links.
   Uses ::before — ::after is taken by the dropdown caret. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  .nav-links>li>a {
    position: relative;
  }

  .nav-links>li>a::before {
    content: "";
    position: absolute;
    left: .5rem;
    right: .5rem;
    bottom: .55rem;
    height: 2px;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform .35s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
  }

  .nav-links>li>a:hover::before,
  .nav-links>li.dropdown:hover>a::before {
    transform: scaleX(1);
    transform-origin: left center;
  }
}

/* Hamburger icon rotation (state class set by JS) */
.menu-toggle i {
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.menu-toggle.xs-open i {
  transform: rotate(90deg);
}

/* Mobile panel open/close animation. .xs-closing is held by JS for the
   duration of the exit animation before display goes back to none. */
@media (max-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .nav-links.active {
    animation: xs-menu-in .32s cubic-bezier(.22, 1, .36, 1);
  }

  .nav-links.xs-closing {
    display: flex;
    animation: xs-menu-out .24s ease forwards;
    pointer-events: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §3 LOGO CAROUSEL — seamless loop polish
   (Infinite loop + edge fade masks already exist in index.css;
    this adds GPU hinting and pause-on-hover.)
   ══════════════════════════════════════════════════════════════════════ */

.logo-carousel-track,
.marquee-track,
.carousel-track {
  will-change: transform;
  backface-visibility: hidden;
}

@media (hover: hover) and (pointer: fine) {
  .logo-carousel:hover .logo-carousel-track {
    animation-play-state: paused;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §4 X'S FORMULA CARDS — watermark numbers, hover shift
   (Staggered entrance delay is applied inline by JS so it never slows
    down the hover transitions afterwards.)
   ══════════════════════════════════════════════════════════════════════ */

.philosophy-grid .clause-card {
  padding-top: 4.5rem;
  /* restate the existing transition + add background-color */
  transition:
    transform .5s cubic-bezier(.19, 1, .22, 1),
    box-shadow .5s cubic-bezier(.19, 1, .22, 1),
    border-color .5s cubic-bezier(.19, 1, .22, 1),
    background-color .5s ease;
}

/* 01 / 02 / 03 as large faded watermarks behind the card title */
.philosophy-grid .clause-card .clause-number {
  position: absolute;
  top: .75rem;
  right: 1.25rem;
  margin: 0;
  font-size: 8.5rem;
  line-height: 1;
  letter-spacing: -.04em;
  opacity: .16;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.philosophy-grid .clause-card h3,
.philosophy-grid .clause-card p {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .philosophy-grid .clause-card:hover {
    background-color: rgba(58, 58, 52, .78);
    /* subtle background shift */
  }
}

@media (max-width: 480px) {
  .philosophy-grid .clause-card .clause-number {
    font-size: 6.5rem;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §5 STAT STRIP — proof points with count-up values
   (Markup lives in index.html; count-up driven by JS.)
   ══════════════════════════════════════════════════════════════════════ */

.stat-strip {
  background-color: var(--bg-deeper);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 4rem var(--section-padding-x);
}

.stat-strip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .stat-strip-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-value {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  /* no width jitter while counting */
  background: var(--gold-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════
   §6 BIO — directional reveals + accent X behind the photo
   (reveal-left/reveal-right classes are applied by JS and re-use the
    site's existing reveal transitions.)
   ══════════════════════════════════════════════════════════════════════ */

.bio-image.xs-bio-accent {
  position: relative;
}

.bio-image.xs-bio-accent::before {
  /* bold outlined X, faded, behind the photo */
  content: "X";
  position: absolute;
  top: 50%;
  left: -2.5rem;
  transform: translateY(-50%);
  font-size: clamp(14rem, 24vw, 24rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(212, 175, 55, .05);
  -webkit-text-stroke: 2px rgba(212, 175, 55, .14);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.bio-image.xs-bio-accent::after {
  /* offset gold frame for visual weight */
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  right: -1.25rem;
  bottom: -1.25rem;
  border: 1px solid rgba(212, 175, 55, .3);
  z-index: 0;
  pointer-events: none;
}

.bio-image.xs-bio-accent picture,
.bio-image.xs-bio-accent img {
  position: relative;
  z-index: 1;
}

@media (max-width: 767px) {
  .bio-image.xs-bio-accent::after {
    right: .75rem;
    bottom: -.75rem;
    left: 2rem;
    top: 2rem;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §7 TESTIMONIALS — rotating carousel with controls + dots
   (DOM built by JS inside #testimonials-container on the home page.
    Slides are stacked in one grid cell: container height = tallest slide,
    so transitions cause zero layout shift.)
   ══════════════════════════════════════════════════════════════════════ */

.carousel-container.xs-tc-host {
  -webkit-mask-image: none;
  mask-image: none;
  overflow: visible;
}

.xs-tc-viewport {
  display: grid;
  max-width: 860px;
  margin: 0 auto;
}

.xs-tc-slide {
  grid-area: 1 / 1;
  position: relative;
  margin: 0;
  padding: 3.5rem 1.5rem 1rem;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateX(32px);
  transition:
    opacity .5s ease,
    transform .55s cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear .55s;
}

/* entering-from / exiting-to side flips with travel direction */
.xs-tc[data-dir="prev"] .xs-tc-slide {
  transform: translateX(-32px);
}

.xs-tc-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

.xs-tc-slide::before {
  /* large decorative quote mark — dark, bold, on-brand */
  content: "\201C";
  position: absolute;
  top: -.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(212, 175, 55, .16);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .6);
  pointer-events: none;
  user-select: none;
}

.xs-tc-quote {
  font-size: var(--fs-18);
  line-height: 1.5;
  font-style: italic;
  font-weight: 700;
  margin: 0 0 1.75rem;
}

@media (min-width: 768px) {
  .xs-tc-quote {
    font-size: var(--fs-25);
    line-height: 1.45;
  }
}

.xs-tc-author {
  font-size: var(--fs-14);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-style: normal;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.xs-tc-author span {
  display: block;
  margin-top: 5px;
  font-size: var(--fs-11);
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.xs-tc-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.25rem;
}

.xs-tc-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--accent-gold);
  font-size: var(--fs-14);
  cursor: pointer;
  transition: border-color .3s ease, background-color .3s ease, color .3s ease, transform .3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .xs-tc-btn:hover {
    border-color: var(--accent-gold);
    background-color: rgba(212, 175, 55, .12);
    transform: scale(1.08);
  }
}

.xs-tc-btn:focus-visible,
.xs-tc-dot:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

.xs-tc-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.xs-tc-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--accent-gold);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  transition: background-color .3s ease, width .3s cubic-bezier(.22, 1, .36, 1), opacity .3s ease;
  opacity: .55;
}

.xs-tc-dot.is-active {
  width: 26px;
  background: var(--accent-gold);
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════════════
   §8 CTA — heartbeat on the giant X
   (Button hover/fill handled by §10 global button treatment.)
   ══════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: no-preference) {
  .bottom-cta .bg-x {
    animation: xs-heartbeat 6s ease-in-out infinite;
    will-change: transform, opacity;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §9 SCROLL UI — progress bar + back-to-top (elements injected by JS)
   ══════════════════════════════════════════════════════════════════════ */

.xs-progress {
  position: fixed;
  top: 0;
  /* JS pins it to the navbar's bottom edge */
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gold-gradient);
  box-shadow: 0 0 10px rgba(212, 175, 55, .45);
  transform: scaleX(0);
  transform-origin: 0 50%;
  /* Above the navbar (100) but BELOW dropdown menus (1000) and the
     urgency banner (1001), so open menus are never striped by the bar. */
  z-index: 101;
  pointer-events: none;
}

.xs-top-btn {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(17, 17, 17, .85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, .5);
  border-radius: 50%;
  color: var(--accent-gold);
  font-size: var(--fs-16);
  cursor: pointer;
  z-index: 95;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.22, 1, .36, 1),
    background-color .3s ease, color .3s ease, border-color .3s ease;
}

.xs-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .xs-top-btn:hover {
    background-color: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
  }
}

@media print {

  .xs-progress,
  .xs-top-btn {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §10 MICRO-INTERACTIONS — buttons, body links, heading reveals
   ══════════════════════════════════════════════════════════════════════ */

/* Buttons: unified lift/scale + sheen sweep on hover */
.btn {
  position: relative;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -140%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .3) 50%, transparent 80%);
    transform: skewX(-18deg);
    pointer-events: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-4px) scale(1.03);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .btn:hover::after {
    left: 150%;
    transition: left .55s ease;
  }
}

/* Body-copy links: animated underline sweep (background-image = no CLS) */
main p a:not(.btn),
main cite a,
main blockquote a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent-gold), var(--accent-gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1.5px;
  transition: background-size .35s cubic-bezier(.22, 1, .36, 1);
  padding-bottom: 2px;
}

@media (hover: hover) and (pointer: fine) {

  main p a:not(.btn):hover,
  main cite a:hover,
  main blockquote a:hover {
    background-size: 100% 1.5px;
  }
}

/* Heading reveals (class applied by JS only to below-the-fold headings) */
.xs-motion .xs-h {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}

.xs-motion .xs-h.xs-h-in {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════════════
   REDUCED MOTION — final hard stop for everything in this file
   ══════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

  .xs-hero-ambient::after,
  .bottom-cta .bg-x,
  .xs-line-inner,
  .nav-links.active,
  .nav-links.xs-closing {
    animation: none !important;
  }

  .xs-parallax {
    transform: none !important;
    will-change: auto;
  }

  .xs-tc-slide {
    transition: none !important;
  }

  .xs-h,
  .xs-line-inner,
  .xs-hero .hero-subtitle,
  .xs-hero .hero-description,
  .xs-hero .hero-content>.btn {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   §11 BOOKING PAGE — conversion microcopy styles
   ══════════════════════════════════════════════════════════════════════ */

.xs-form-note {
  margin-top: 1rem;
  font-size: var(--fs-11);
  letter-spacing: .5px;
  line-height: 1.5;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
}

.xs-optional {
  font-size: var(--fs-11);
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   §12 ACCESSIBILITY — skip-to-content link (visible only on focus)
   ══════════════════════════════════════════════════════════════════════ */

.xs-skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  background: var(--accent-gold);
  color: #000;
  font-weight: 700;
  font-size: var(--fs-14);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  transition: top .2s ease;
}

.xs-skip-link:focus {
  top: 1rem;
  outline: 2px solid #000;
  outline-offset: 2px;
}
/* ══════════════════════════════════════════════════════════════════════
   §13 BOOKING PAGE, MOBILE — form first, tighter arrival
   Most booking traffic is mobile; the pitch panel was pushing the form
   a full screen down. The form now leads and the pitch follows.
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {
  .inquiry-grid .funnel-container { order: -1; }

  /* less dead space above the form on arrival */
  .hero-book { padding-top: 110px !important; padding-bottom: 50px !important; }

  .inquiry-grid { gap: 2.5rem; }
}

/* §13b — mobile form intro (hidden on desktop, where the pitch panel leads) */

.xs-form-intro { display: none; }

@media (max-width: 1023px) {
  .xs-form-intro {
    display: block;
    text-align: center;
    margin-bottom: 2rem;
  }

  .xs-form-intro-title {
    font-size: var(--fs-35);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.75rem;
  }

  .xs-form-intro-sub {
    font-size: var(--fs-14);
    color: var(--text-muted);
    line-height: 1.65;
  }
}

/* §11b — step buttons centered (note removed, button is the sole focus) */

.step-actions--next {
  display: flex;
  justify-content: center;
}
