/* ============================================================
   DRYFT ANIMATIONS
   ============================================================ */

/* --- Scroll Reveal Base State ---
   CSS pre-hides reveal elements immediately so there's zero FOUC
   even before GSAP fires. GSAP then animates them to visible.
------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  will-change: opacity, transform;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  will-change: opacity, transform;
}

/* ============================================================
   HERO CARD — LIQUID GLASS HOVER
   ============================================================ */
.hero-card-wrapper {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  contain: paint layout;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.08),
    0 32px 64px rgba(0,0,0,0.10);
}

.hero-card {
  width: 100%;
  display: block;
  border-radius: 20px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* Resting state: invisible overlay, image fully visible */
.hero-card-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(0px) saturate(100%);
  -webkit-backdrop-filter: blur(0px) saturate(100%);
  border: 1px solid rgba(255, 255, 255, 0);
  transition:
    background 0.4s ease,
    backdrop-filter 0.4s ease,
    -webkit-backdrop-filter 0.4s ease,
    border 0.4s ease,
    box-shadow 0.4s ease;
  pointer-events: none;
}

/* Hover: very light frost — notifications remain readable */
.hero-card-wrapper:hover .hero-card {
  transform: scale(1.02);
}

.hero-card-wrapper:hover::after {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(3px) saturate(130%);
  -webkit-backdrop-filter: blur(3px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

/* ============================================================
   HERO SECTION LAYOUT
   ============================================================ */
.hero {
  min-height: calc(100vh - 36px);
  display: flex;
  align-items: center;
  padding: 40px 0 60px;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 5fr 6fr;
  align-items: center;
  gap: 56px;
  width: 100%;
}

.hero-text .eyebrow {
  margin-bottom: 16px;
}

/* Hero headline — lighter weight and smaller than global h1.
   Sized to comfortably break into exactly 2 lines at all desktop widths.
   Position: relative enables the glass glow pseudo-element. */
.hero-text h1,
.hero-headline {
  margin-bottom: 16px;
  font-size: clamp(1.875rem, 3.2vw, 2.625rem);
  font-weight: 600;
  line-height: 1.15;
  position: relative;
}

/* Cursor-reactive liquid glass glow — a soft radial gradient sits on the right
   side of the headline by default. On desktop hover, JS tracks cursor position
   and updates --glow-x, moving the glow across the text in real time.
   mix-blend-mode: screen brightens the dark letterforms where the glow passes,
   simulating light refracting through glass (iOS liquid glass feel). */
.hero-text h1::after,
.hero-headline::after {
  content: '';
  position: absolute;
  top: -30%;
  left: calc(var(--glow-x, 78%) - 30%);
  width: 60%;
  height: 160%;
  background: radial-gradient(
    ellipse at center,
    rgba(185, 215, 255, 0.52) 0%,
    rgba(230, 240, 255, 0.28) 35%,
    rgba(205, 185, 255, 0.16) 65%,
    transparent 100%
  );
  filter: blur(8px);
  mix-blend-mode: screen;
  pointer-events: none;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero subhead — lighter weight and colour, smaller than headline. */
.hero-subhead {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.42);
  max-width: 440px;
  margin-bottom: 36px;
  font-weight: 400;
}

.hero-text > p:not(.eyebrow):not(.hero-note):not(.hero-subhead) {
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  margin-bottom: 20px;
}

.hero-note {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.4);
}

/* Image column — large and prominent, bleeds slightly right */
.hero-image {
  position: relative;
}

.hero-image .hero-card-wrapper {
  /* Slight upward float to bleed past the hero bottom */
  margin-bottom: -20px;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-image {
    order: -1;
    width: 100%;
  }

  .hero-image .hero-card-wrapper {
    margin-bottom: 0;
  }

  .hero {
    min-height: auto;
    padding: 40px 0 60px;
  }

  /* Centre all hero text on single-column (tablet + mobile) */
  .hero-text {
    text-align: center;
  }

  .hero-subhead,
  .hero-text > p:not(.eyebrow) {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  /* Static glow centred on mobile — no cursor to track */
  .hero-text h1::after,
  .hero-headline::after {
    left: calc(50% - 30%); /* centred regardless of --glow-x */
    transition: none;
  }
}

/* ============================================================
   HERO — CENTERED SINGLE-COLUMN (homepage only, .hero--centered)
   ============================================================ */

/* Section: position relative so the canvas can be absolute within it.
   z-index: 5 places the hero above the stats section (z-index: 3) so
   the phone can extend below the hero boundary without being covered.
   overflow: visible allows the phone to extend past the hero bottom
   and fade naturally into the gradient overlay.                        */
.hero--centered {
  position: relative;
  align-items: flex-start;
  padding-top: 72px;
  padding-bottom: 0;
  min-height: 140vh;
  overflow: visible;
  z-index: 5;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(255, 92, 0, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 40%, rgba(255, 140, 50, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255, 180, 100, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 10% 20%, rgba(255, 200, 150, 0.06) 0%, transparent 40%),
    #FFFFFF;
}

/* White veil at hero bottom — fades the background/particles out before
   the stats section. z-index: 1 keeps it behind the parallax unit (z-index: 2)
   so the phone always renders above the veil on all screen sizes.           */
.hero--centered::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(
    to bottom,
    transparent                     0%,
    rgba(255, 255, 255, 0.45)      45%,
    rgba(255, 255, 255, 0.85)      78%,
    rgba(255, 255, 255, 1.00)     100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Parallax wrapper — phone + canvas + notifications scroll as one unit.
   GSAP applies yPercent: 40 to this element on scroll.
   Will-change:transform is set by GSAP automatically. */
.hero-parallax-unit {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Full-bleed canvas — z-index: 1 within parallax unit (below cards + phone) */
.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  pointer-events: none;
  isolation: isolate;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hero text — z-index: 5, above the parallax unit (z-2) but below nav (z-100) */
.hero--centered .hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 760px;
  gap: 0;
  position: relative;
  z-index: 5;
  padding-top: 0;
  padding-bottom: 0;
}

/* Headline — matches global hero headline size */
.hero--centered .hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 3.2vw, 2.625rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  margin-bottom: 20px;
  color: var(--black);
}

.hero--centered .hero-headline::after {
  display: none;
}

.hero--centered .hero-subhead {
  max-width: 100%;
  font-size: clamp(0.78rem, 3.0vw, 1.05rem);
  color: rgba(0, 0, 0, 0.45);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.5;
}

.dynamic-word {
  display: inline-block;
  white-space: nowrap;
  vertical-align: baseline;
  clip-path: inset(0);
}

.dynamic-word-inner {
  display: inline-block;
  white-space: nowrap;
  will-change: transform, opacity;
}

.hero--centered .hero-buttons {
  justify-content: center;
  flex-wrap: nowrap;
  margin-bottom: 24px;
}

.hero--centered .hero-note {
  text-align: center;
  white-space: nowrap;  /* keeps text on one line so offsetWidth = true text width */
  margin-bottom: 24px;
}

/* ============================================================
   CSS iPHONE MOCKUP — outer wrapper handles positioning;
   .css-iphone handles visual styling + overflow clipping.
   Buttons live in the wrapper (outside .css-iphone) so they
   aren't clipped by overflow:hidden.
   top is set dynamically by positionPhone() in JS.
   ============================================================ */
.iphone-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.css-iphone {
  width: 340px;
  height: 700px;
  border-radius: 54px;
  position: relative;
  z-index: 10;
  overflow: visible;
  padding: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 0 3px #3a3a3a,
    0 0 0 4px #1a1a1a,
    4px 0 12px rgba(0, 0, 0, 0.4),
    -4px 0 12px rgba(0, 0, 0, 0.4),
    0 60px 120px rgba(0, 0, 0, 0.55),
    0 30px 60px rgba(0, 0, 0, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.2);
  background: linear-gradient(
    145deg,
    #2a2a2a 0%,
    #1a1a1a 30%,
    #111 50%,
    #1a1a1a 70%,
    #252525 100%
  );
}

@media (min-width: 1024px) {
  .css-iphone {
    width: 320px;
    height: 658px;
    border-radius: 51px;
  }
}

/* Left side hardware buttons: mute + 2× volume */
.iphone-buttons-left {
  position: absolute;
  left: -4px;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}

.iphone-btn {
  width: 3px;
  background: #2A2A2A;
  border-radius: 3px 0 0 3px;
}

.iphone-btn-mute { height: 32px; }
.iphone-btn-vol  { height: 36px; }

/* Right side hardware button: power / sleep-wake */
.iphone-buttons-right {
  position: absolute;
  right: -4px;
  top: 160px;
  z-index: 5;
}

.iphone-btn-power {
  width: 3px;
  height: 64px;
  background: #2A2A2A;
  border-radius: 0 3px 3px 0;
}

.iphone-statusbar {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0;
  z-index: 10;
  color: white;
}

/* Time: centered in the region left of the island (phone left → island left edge).
   Island is 102px wide on desktop → half = 51px from center. */
.iphone-time {
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  right: calc(50% + 51px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* Indicators: centered in the region right of the island (island right → phone right) */
.iphone-indicators {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(50% + 51px);
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: white;
}

.iphone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.iphone-dynamic-island {
  width: 102px;
  height: 30px;
  background: #000;
  border-radius: 15px;
  margin: 24px auto 0;
  position: relative;
}

.iphone-camera {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-camera-lens {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #1a3a5c 0deg,
    #2d6a9f 60deg,
    #1e5080 120deg,
    #0d2137 180deg,
    #2d6a9f 240deg,
    #1a3a5c 300deg,
    #1a3a5c 360deg
  );
  box-shadow: 0 0 4px rgba(45, 106, 159, 0.6), inset 0 0 2px rgba(255,255,255,0.15);
}

.iphone-screen {
  position: absolute;
  top: 10px;
  left: 8px;
  right: 8px;
  bottom: 10px;
  border-radius: 42px;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  overflow: hidden;
}

.iphone-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  z-index: 0;
  display: block;
}

@media (max-width: 768px) {
  .css-iphone {
    width: 260px;
    height: 560px;
    border-radius: 42px;
  }
  .iphone-buttons-left  { top: 96px; }
  .iphone-buttons-right { top: 128px; }
  .iphone-screen { border-radius: 34px; }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .iphone-dynamic-island { width: 96px; height: 28px; border-radius: 14px; }
  /* Island 96px → half = 48px */
  .iphone-time      { right: calc(50% + 48px); }
  .iphone-indicators { left: calc(50% + 48px); }
}

@media (max-width: 767px) {
  /* Island: 20px margin gives 10px visible gap above it (screen starts at top:10px) */
  .iphone-dynamic-island { width: 88px; height: 26px; border-radius: 13px; margin-top: 20px; }

  /* Statusbar: top:10px so center = 10+23=33px = island center (20+13=33px) */
  .iphone-statusbar { top: 10px; height: 46px; }

  /* Island 88px → half = 44px from center */
  .iphone-time      { right: calc(50% + 44px); font-size: 14px; }
  .iphone-indicators { left: calc(50% + 44px); }

  /* Scale down SVG indicator icons so they fit comfortably within the available
     space to the right of the island on a 260px phone */
  .iphone-indicators svg { transform: scale(0.80); }

  .iphone-camera      { right: 12px; width: 9px; height: 9px; }
  .iphone-camera-lens { width: 5px; height: 5px; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet / Mobile */
@media (max-width: 768px) {
  .hero--centered {
    padding-top: 52px;
  }
}


/* Mobile — 600px */
@media (max-width: 600px) {
  /* Hero headline: ~12% smaller so fewer orphan words on narrow screens */
  .hero--centered .hero-headline {
    font-size: clamp(1.65rem, 5.5vw, 1.875rem);
  }

  /* Subhead: single line always — short sentence + nowrap prevents wrapping */
  .hero--centered .hero-subhead {
    font-size: clamp(0.72rem, 3.2vw, 0.92rem);
    white-space: nowrap;
    overflow: hidden;
  }

  /* Hero note: slightly smaller */
  .hero--centered .hero-note {
    font-size: 0.72rem;
  }

  /* Buttons: natural width centered side-by-side, equal padding on all sides */
  .hero--centered .hero-buttons {
    width: auto;
    gap: 10px;
  }
  .hero--centered .hero-buttons > * {
    padding: 11px 20px;
    font-size: 0.88rem;
  }
}

/* ============================================================
   HERO ENTRANCE PRE-HIDE
   CSS-level opacity:0 ensures these elements are invisible from
   first paint, covering the ~2s window while CDN scripts download
   on a cold load. GSAP takes over via inline styles once it runs
   and animates them back to opacity:1. Without this, users on
   slow connections see the phone at the wrong position and all
   text fully visible before the entrance animation plays.
   ============================================================ */
.hero--centered .hero-headline,
.hero--centered .hero-subhead,
.hero--centered .hero-buttons,
.hero--centered .hero-note,
.hero--centered .css-iphone {
  opacity: 0;
}

/* ============================================================
   PAGE ENTRY FADE (used on non-hero pages)
   ============================================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.6s ease forwards;
}

/* ============================================================
   STEP SECTIONS
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.step-item {
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 32px;
  right: -20px;
  width: 40px;
  height: 2px;
  background: rgba(255, 92, 0, 0.3);
}

@media (max-width: 768px) {
  .step-item::after {
    display: none;
  }
}

/* ============================================================
   PILLAR CARDS
   ============================================================ */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 768px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }
}

.pillar-card h3 {
  margin-bottom: 12px;
}

/* ============================================================
   SERVICE CARD GRID
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   VIDEO GRID
   ============================================================ */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

@media (max-width: 640px) {
  .videos-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   TIMELINE (How it works launch times)
   ============================================================ */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.2s ease;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-item:hover {
  background: var(--light-grey);
}

.timeline-service {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--black);
  flex: 1;
}

.timeline-arrow {
  color: var(--orange);
  font-size: 1.2rem;
}

.timeline-time {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--charcoal);
  min-width: 200px;
  text-align: right;
}

@media (max-width: 480px) {
  .timeline-time {
    min-width: auto;
    text-align: left;
  }

  .timeline-item {
    flex-wrap: wrap;
  }
}

/* ============================================================
   PHASE SECTIONS (how-it-works)
   ============================================================ */
.phase-section {
  padding: 80px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.phase-section:last-of-type {
  border-bottom: none;
}

.phase-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 768px) {
  .phase-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ============================================================
   CONFIRMATION STATE (apply page)
   ============================================================ */
.confirmation {
  display: none;
  text-align: center;
  padding: 60px 24px;
}

.confirmation.visible {
  display: block;
}

.confirmation h2 {
  margin-bottom: 16px;
}

/* ============================================================
   GSAP-CONTROLLED CLASSES
   (Set initial state for elements that will be animated by GSAP;
    GSAP overrides these on scroll)
   ============================================================ */
.gsap-hidden {
  opacity: 0;
  transform: translateY(40px);
}
