/* ============================================================
   AI360 HERO — Apple Glassmorphism / MainLabs Motion
   Background: #D8DCE0 uniform across all beats (locked)
   Accent:     #FE7B07 amber (orbs only)
   Chrome:     #C8CCD1 (rings only)
   ============================================================ */

:root {
  --slate-bg:      #D8DCE0;
  --slate-bg-mid:  #DFE3E8;
  --amber:         #FE7B07;
  --amber-soft:    rgba(254, 123, 7, 0.12);
  --chrome:        #C8CCD1;
  --ink:           #1A1D21;
  --ink-soft:      #3A3F47;
  --glass-border:  rgba(255, 255, 255, 0.45);
  --glass-tint:    rgba(255, 255, 255, 0.28);
  --shadow-soft:   0 12px 40px rgba(20, 25, 35, 0.08);
  --shadow-ring:   0 20px 60px rgba(20, 25, 35, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--slate-bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ------------------------------------------------------------
   SECTION FRAME — scroll spacer drives pinned stage
   ------------------------------------------------------------ */

.ai360-hero {
  position: relative;
  width: 100%;
  background: var(--slate-bg);
}

.hero-scroll-spacer {
  /* 15 beats × 100vh — bumped from 1200vh so the cube approach + "Compressed
     Into Intelligence." + slow "Deployed Everywhere." reveal each get real
     screen time. Each progress unit is now 15vh of scroll. */
  height: 1500vh;
  pointer-events: none;
}

.hero-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, var(--slate-bg-mid) 0%, var(--slate-bg) 70%);
}

/* ------------------------------------------------------------
   THREE.JS CANVAS — Beat 0 cards + Beat 4 particles
   ------------------------------------------------------------ */

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ------------------------------------------------------------
   BEAT IMAGE LAYERS — fixed, stacked, scroll-driven fade
   ------------------------------------------------------------ */

.beat-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  will-change: opacity, transform;
  z-index: 3;
}

/* FULL-BLEED IMAGES — edges go off the viewport so no rectangle ever shows.
   Image fills 100vw × 100vh and covers (crops aspect as needed). Subject is
   centered in every source image, so cropping the corners is safe.
   Subtle edge feather retained as a belt-and-suspenders guard at the borders. */
.beat-layer img {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  transform: translateZ(0);

  /* Soft feather only on the extreme outer 8% — kills any residual boundary */
  -webkit-mask-image: radial-gradient(
    ellipse 120% 120% at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 82%,
    rgba(0,0,0,0.6) 92%,
    rgba(0,0,0,0) 100%
  );
          mask-image: radial-gradient(
    ellipse 120% 120% at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 82%,
    rgba(0,0,0,0.6) 92%,
    rgba(0,0,0,0) 100%
  );

  mix-blend-mode: multiply;
  filter: contrast(1.04) saturate(1.05);
}

/* Per-beat aspect/positioning tweaks (cover still applies; these fine-tune focus) */
.beat-layer.beat-5 img { object-position: center 30%; } /* cascade — keep top visible */
.beat-layer.beat-6 img { object-position: 65% center; } /* desk — nudge right so iPad side bleeds, coffee/left stays clear for caption */

/* Compression beats — switch to contain so the full falling→approaching→compressed
   progression is visible. Widened out past viewport + stronger edge feather so
   no square/rectangular boundary is ever visible at the corners. User rule:
   "no sharp square edges — everything blends with the background." */
.beat-layer.beat-4 img,
.beat-layer.beat-4a img,
.beat-layer.beat-4b img {
  /* ZOOMED OUT per user — `contain` shows the full comet/cube composition
     (no cropped top/bottom), oversized frame keeps edges off-screen, radial
     mask feathers any residual boundary into slate BG. */
  object-fit: contain;
  object-position: center;
  width: 118vw;
  height: 118vh;
  max-width: none;
  max-height: none;

  -webkit-mask-image: radial-gradient(
    ellipse 90% 90% at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 50%,
    rgba(0,0,0,0.8) 70%,
    rgba(0,0,0,0.35) 88%,
    rgba(0,0,0,0) 100%
  );
          mask-image: radial-gradient(
    ellipse 90% 90% at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 50%,
    rgba(0,0,0,0.8) 70%,
    rgba(0,0,0,0.35) 88%,
    rgba(0,0,0,0) 100%
  );
}

/* ------------------------------------------------------------
   BEAT 2 — SINGLE UNIFIED ORB + RINGS RENDER
   One image (orb + chrome orbital rings baked in). Centered at natural aspect,
   with a soft amber glow and gentle scale pulse so the whole assembly breathes.
   ------------------------------------------------------------ */
.beat-layer.beat-2 img {
  width: auto !important;
  height: auto !important;
  max-width: 72vh;
  max-height: 72vh;
  position: absolute;
  top: 50%;
  /* Shifted LEFT from 50% → 32% so the chrome-iris doesn't pulse behind
     the caption "AI360 makes them work as one" which sits right-side */
  left: 32%;
  object-fit: contain;
  -webkit-mask-image: none !important;
          mask-image: none !important;
  mix-blend-mode: normal !important;
  /* Pure brand-orange halo — hue-rotate nudges any baked-in yellow in the PNG
     toward brand amber so the vibration around the orb reads ORANGE, never
     yellow. Saturation bump locks the orange character. Drop-shadow stack
     paints the 3-layer glow in pure brand orange (#FE7B07). */
  filter: hue-rotate(-10deg) saturate(1.15)
          drop-shadow(0 0 50px  rgba(254, 123, 7, 0.65))
          drop-shadow(0 0 110px rgba(254, 123, 7, 0.40))
          drop-shadow(0 0 180px rgba(254, 123, 7, 0.20))
          drop-shadow(0 22px 60px rgba(20, 25, 35, 0.18));
  /* Iris rotation (10s) + stronger breath (scale 1.00 → 1.07) so the
     pulse is clearly felt, not just subliminal. */
  animation: irisFocus 10s ease-in-out infinite;
}

@keyframes irisFocus {
  0%   { transform: translate(-50%, -50%) rotate(0deg)   scale(1.00); }
  50%  { transform: translate(-50%, -50%) rotate(180deg) scale(1.07); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1.00); }
}

/* ------------------------------------------------------------
   PERSISTENT LOGO — top-left. Orange ring on the OUTSIDE, wordmark
   "Ai360° Network" stacked INSIDE. Ring closes from arc → full circle
   on page load, then gently pulses. Matches brand-reference lockup.
   ------------------------------------------------------------ */
.hero-logo {
  position: fixed;
  top: 1.4rem;
  left: 1.6rem;
  width: 6.2rem;
  height: 6.2rem;
  display: inline-grid;
  place-items: center;
  z-index: 10;
  pointer-events: none;
  text-decoration: none;
}
.hero-logo .logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.hero-logo .logo-ring::before,
.hero-logo .logo-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--amber);
  box-sizing: border-box;
}
.hero-logo .logo-ring::before {
  /* Closing ring — starts as a quarter arc, sweeps to a full circle */
  clip-path: polygon(50% 50%, 50% 0%, 50% 0%, 50% 50%);
  animation: logoRingClose 1.6s cubic-bezier(0.65, 0, 0.35, 1) forwards,
             logoRingPulse 3.6s ease-in-out 1.8s infinite;
}
.hero-logo .logo-ring::after {
  /* Outer soft glow that fades in after the ring completes */
  opacity: 0;
  box-shadow: 0 0 18px rgba(254, 123, 7, 0.55);
  animation: logoGlowIn 0.6s ease-out 1.4s forwards,
             logoGlowPulse 3.6s ease-in-out 2.0s infinite;
}
.hero-logo .logo-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 0.1rem;
}
.hero-logo .logo-mark {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.hero-logo .logo-mark .mark-letters { color: var(--amber); }
.hero-logo .logo-mark .mark-360 {
  color: var(--ink);
  position: relative;
  padding-right: 0.18em;
}
/* degree ring rendered as real inline element — positioned via vertical-align so
   it locks to font metrics (no em/line-height guesswork). Sits on top of the "0". */
.hero-logo .logo-mark .mark-360 .deg-mark {
  display: inline-block;
  width: 0.22em;
  height: 0.22em;
  border: 0.045em solid var(--amber);
  border-radius: 50%;
  vertical-align: 0.55em;
  margin-left: 0.02em;
}
.hero-logo .logo-network {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

@keyframes logoRingClose {
  0%   { clip-path: polygon(50% 50%, 50% 0%,   50% 0%,   50% 50%); }
  25%  { clip-path: polygon(50% 50%, 50% 0%, 100% 0%,  100% 50%, 50% 50%); }
  50%  { clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 50% 50%); }
  75%  { clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%,   0% 100%,   0% 50%, 50% 50%); }
  100% { clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%,   0% 100%,   0% 0%,  50% 0%, 50% 50%); }
}
@keyframes logoRingPulse {
  0%, 100% { transform: scale(1.00); opacity: 1; }
  50%      { transform: scale(1.04); opacity: 0.85; }
}
@keyframes logoGlowIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes logoGlowPulse {
  0%, 100% { opacity: 0.85; box-shadow: 0 0 18px rgba(254, 123, 7, 0.45); }
  50%      { opacity: 1.00; box-shadow: 0 0 28px rgba(254, 123, 7, 0.70); }
}

/* ------------------------------------------------------------
   COPY LAYER — scroll-synced captions, right side
   ------------------------------------------------------------ */

.hero-copy {
  position: absolute;
  top: 0;
  right: 0;
  width: 42%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 6vw 0 3vw;
  z-index: 4;
  pointer-events: none;
}

/* Beat 6 caption — image has the iPad on the right side of the desk,
   so flip the caption over to the LEFT where the coffee/empty surface lives.
   `.flip-left` class is toggled by hero.js when beat 6 caption is active. */
.hero-copy.flip-left {
  left: 0;
  right: auto;
  justify-content: flex-end;
  padding: 0 3vw 0 6vw;
}

.caption {
  position: absolute;
  opacity: 0;
  transform: translateY(16px);
  max-width: 460px;
  will-change: opacity, transform;
  pointer-events: auto;
  /* Soft shadow behind text — full-bleed images are busy, text must stay legible */
  text-shadow: 0 2px 24px rgba(216, 220, 224, 0.85);
}

/* OPENING caption — centered on the stage, alone before cards. Overrides the
   right-aligned hero-copy column so the architect hook lands dead-center. */
.caption.caption-opening {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 860px;
  width: min(86vw, 860px);
  text-align: center;
  padding: 0 2vw;
}
.caption.caption-opening .eyebrow { margin-bottom: 1.8rem; }
.caption.caption-opening h1 {
  font-size: clamp(2.6rem, 4.6vw, 4.2rem);
  line-height: 1.05;
}
.caption.caption-opening p {
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.5;
  color: var(--amber);   /* brand orange — lifts the channel list off the slate BG */
  font-weight: 500;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Centered caption wrapper — used by captions 1 and 2 so split-text lines
   form a single centered sentence rather than a right-rail stack. */
.caption.caption-centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 1100px;
  width: min(92vw, 1100px);
  text-align: center;
}

/* Word-by-word reveal — sentence forms as scroll progresses, each word fades
   in sequentially. Opacity is driven from hero.js by scroll position so the
   animation is scroll-paced, not time-paced. */
.caption-reveal h1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em;
}
.caption-reveal .word {
  display: inline-block;
  opacity: 0;
  will-change: opacity, transform;
}

/* "Deployed Everywhere." — split caption, centered on viewport.
   Inherits caption-split + caption-centered layout; no width overrides needed. */

/* White-text variant — "Every Business Runs Systems." stands out against the
   scattered cards background better in white than in ink. */
.caption.caption-white h1,
.caption.caption-white h1 .slide-from-left,
.caption.caption-white h1 .slide-from-right {
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(20, 25, 35, 0.45),
               0 0 40px rgba(20, 25, 35, 0.25);
}

.caption .eyebrow {
  display: inline-block;
  /* Bumped from 0.72rem so the business name stands out on the opening frame.
     Scales with viewport width; capped so it never overpowers the h1 below it. */
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 1.4rem;
  /* Keep the lowercase "ai" in the brand mark — do NOT uppercase. */
}

.caption h1 {
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--ink);
}

/* Split-caption animation — two halves meeting to form ONE sentence.
   Left half slides in from offscreen-left, right half from offscreen-right.
   Inline row layout (not stacked) — they meet in the middle. */
.caption-split h1 {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35em;
}
.caption-split .slide-from-left,
.caption-split .slide-from-right {
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity;
}

/* AI360 logo inline inside captions — matches header ring-mark style */
.ai360-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ai360-mark .mark-letters { color: var(--amber); }
.ai360-mark .mark-360 {
  color: var(--ink);
  position: relative;
  display: inline-block;
  padding-right: 0.18em;
}
.ai360-mark .mark-360 .deg-mark {
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  border: 0.035em solid var(--amber);
  border-radius: 50%;
  vertical-align: 0.55em;
  margin-left: 0.02em;
}

.caption p {
  margin-top: 1.4rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-soft);
  font-weight: 400;
}

.caption p strong {
  color: var(--ink);
  font-weight: 600;
}

.caption .cta {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.95rem 1.8rem;
  background: var(--amber);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(254, 123, 7, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.caption .cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(254, 123, 7, 0.36);
}

/* ------------------------------------------------------------
   BEAT 6 CAPTION — DARKER TEXT + CTA FOR DESK IMAGE READABILITY
   The desk image is visually busy (iPad + coffee + surfaces) and the default
   slate halo was washing out the heading. Force darker ink, a tighter halo,
   and a deeper amber CTA so the copy reads clearly against the photograph.
   ------------------------------------------------------------ */
/* Beat 6 caption — match the rest of the site's lettering weight (no heavy
   black stroke, no synthetic bold). Color drives readability instead:
     - h1 "Your pipeline never sleeps."  → amber, matches brand + desk orb
     - body "Voice AI answers every call..." → white, pops against desk photo */
.caption[data-caption="6"] h1,
.caption[data-caption="6"] h1 .slide-from-left,
.caption[data-caption="6"] h1 .slide-from-right {
  color: #ffffff;
  font-weight: 600;
  text-shadow:
    0 2px 16px rgba(0, 0, 0, 0.55),
    0 1px 4px rgba(0, 0, 0, 0.6);
}

.caption[data-caption="6"] p {
  color: #ffffff;                              /* white body copy */
  font-weight: 400;                            /* site-standard body weight */
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.6);              /* strong dark halo lets white read on any desk tone */
}

.caption[data-caption="6"] p strong {
  color: #ffffff;                              /* stays white, just heavier weight */
  font-weight: 600;                            /* site-standard strong emphasis */
}

/* CTA matches the amber orb sitting on the desk (brand amber #FE7B07) */
.caption[data-caption="6"] .cta {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 10px 28px rgba(254, 123, 7, 0.45),
              0 0 40px rgba(254, 123, 7, 0.25);
}

.caption[data-caption="6"] .cta:hover {
  background: #FF8A1F;
  box-shadow: 0 14px 36px rgba(254, 123, 7, 0.55),
              0 0 50px rgba(254, 123, 7, 0.35);
}

/* ------------------------------------------------------------
   SCROLL HINT — bottom center
   ------------------------------------------------------------ */

.scroll-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  z-index: 5;
  pointer-events: none;
}

.scroll-hint span {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  color: var(--ink-soft);
  font-weight: 500;
}

.scroll-bar {
  width: 1px;
  height: 56px;
  background: rgba(26, 29, 33, 0.12);
  position: relative;
  overflow: hidden;
}

.scroll-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--amber);
  transition: height 0.15s linear;
}

/* ------------------------------------------------------------
   RESPONSIVE — mobile collapses to vertical stack
   ------------------------------------------------------------ */

@media (max-width: 820px) {
  .hero-scroll-spacer { height: 960vh; }

  .hero-copy {
    width: 100%;
    align-items: flex-end;
    justify-content: center;
    padding: 0 6vw 22vh;
  }

  .caption {
    max-width: 100%;
    text-align: center;
    padding: 0 0.5rem;
  }

  .caption h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.2; }

  /* MOBILE FULL-BLEED — on desktop, Beats 2 (orb) and 4/4a/4b (cube/orbs) use
     `contain` to show the full subject; on portrait mobile that creates a
     visible rectangle framed by the slate background. Override to full-bleed
     cover so every beat edges the viewport. Subjects are centered in every
     source image, so cover-cropping the sides is safe. Default .beat-layer img
     rule already does 100vw/100vh cover — we just remove the old 88%/60%
     constraint and specifically rewrite the `contain` beats. */
  .beat-layer.beat-4 img,
  .beat-layer.beat-4a img,
  .beat-layer.beat-4b img {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  .beat-layer.beat-2 img {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    top: 0 !important;
    left: 0 !important;
    /* Desktop breathe animation relies on translate(-50%,-50%) — disable on
       mobile so image anchors edge-to-edge. Scene still reads. */
    animation: none !important;
    transform: none !important;
  }

  .beat-layer {
    align-items: flex-start;
    padding-top: 10vh;
  }

  /* Hide SCROLL hint on mobile — captions need the vertical room */
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .beat-layer { opacity: 1; transition: none; }
  .caption { opacity: 1; transform: none; }
  .hero-scroll-spacer { height: auto; min-height: 100vh; }
}
