/* ==========================================================================
   CloudV24 — Premium Hero (homepage only)
   Loaded after styles.css / responsive.css / nav-enhance.css so it can
   override the older generic `.hero` rules. Everything is scoped to
   `.hero.hero-v2` to avoid touching other sections or pages.
   Brand tokens come from :root in styles.css (--primary, --secondary, --dark…)
   ========================================================================== */

.hero.hero-v2 {
  --hero-violet: #a78bfa;
  --hero-pink: #e8508f;
  --hero-grad: linear-gradient(90deg, var(--primary) 0%, var(--hero-pink) 48%, var(--hero-violet) 100%);
  --hero-ease: cubic-bezier(.22, .8, .24, 1);

  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 55% 65% at 76% 48%, rgba(79, 70, 229, .20) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 12% 30%, rgba(255, 90, 60, .07) 0%, transparent 65%),
    radial-gradient(ellipse 45% 40% at 90% 90%, rgba(124, 58, 237, .14) 0%, transparent 70%),
    var(--dark);
}

/* soft ambient glow that gently breathes behind everything */
.hero.hero-v2::before {
  content: "";
  position: absolute;
  inset: auto -10% 6% 30%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, .22), transparent 65%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
  animation: heroGlow 9s ease-in-out infinite;
}

.hero-v2 .hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3.5rem);
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 8.25rem 24px 4rem;
  position: relative;
  z-index: 2;
}

/* ───────── LEFT COLUMN ───────── */
.hero-v2 .hero-text-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  animation: none;
}

/* Promo badge */
.hero-v2 .badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  max-width: 100%;
  margin: 0 0 1.6rem;
  padding: .55rem 1rem .55rem .9rem;
  font-size: .875rem;
  line-height: 1.3;
  color: #e6e9f2;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(255, 90, 60, .10), rgba(124, 58, 237, .12));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: none;
  animation: none;
  transition: border-color .3s, background .3s, transform .3s var(--hero-ease);
}
.hero-v2 .badge:hover {
  border-color: rgba(255, 90, 60, .55);
  transform: translateY(-2px);
}
.hero-v2 .badge strong { color: #fff; font-weight: 700; }
.hero-v2 .badge-dot { width: 8px; height: 8px; flex: none; }
.hero-v2 .badge-arrow {
  width: 14px; height: 14px; flex: none; opacity: .75;
  transition: transform .3s var(--hero-ease), opacity .3s;
}
.hero-v2 .badge:hover .badge-arrow { transform: translateX(3px); opacity: 1; }

/* Headline — first two lines white, last line brand gradient */
.hero.hero-v2 h1 {
  margin: 0 0 1.4rem;
  font-size: clamp(2.6rem, 5.1vw, 4.4rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.03em;
  text-align: left;
  color: #fff;
  background: none;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}
.hero-v2 .hero-gradient-text {
  display: inline-block;
  padding-bottom: .08em;           /* keeps descenders from being clipped */
  background: var(--hero-grad);
  background-size: 160% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  animation: heroShimmer 7s ease-in-out infinite alternate;
}

/* Description */
.hero.hero-v2 p {
  max-width: 540px;
  margin: 0 0 2rem;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.7;
  text-align: left;
  color: rgba(203, 213, 225, .82);
}

/* Trust metrics */
.hero-v2 .hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 0 0 2.25rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
}
.hero-v2 .hero-stat {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: .75rem;
  align-items: center;
  justify-items: start;
  padding: .7rem 1.15rem .7rem .95rem;
  background: rgba(21, 26, 46, .6);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .3s, transform .3s var(--hero-ease), background .3s;
}
.hero-v2 .hero-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, .45);
  background: rgba(30, 36, 66, .7);
}
.hero-v2 .hero-stat-ico {
  grid-row: 1 / span 2;
  width: 26px; height: 26px;
  color: var(--hero-violet);
}
.hero-v2 .hero-stat-val {
  font-size: 1.05rem;
  line-height: 1.15;
  font-weight: 800;
  background: linear-gradient(135deg, #8b7bff, var(--hero-violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-v2 .hero-stat-label {
  font-size: .72rem;
  line-height: 1.2;
  color: #cbd5e1;
  text-transform: none;
  letter-spacing: .01em;
}

/* CTAs — reuse existing .btn-primary / .btn-outline, refined for the hero */
.hero-v2 .hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  justify-content: flex-start;
}
.hero-v2 .btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 56px;
}
.hero-v2 .btn-primary.btn-glow {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  box-shadow: 0 10px 30px rgba(255, 90, 60, .32), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: transform .3s var(--hero-ease), box-shadow .3s, filter .3s;
}
.hero-v2 .btn-primary.btn-glow:hover {
  transform: translateY(-3px);
  filter: brightness(1.06);
  box-shadow: 0 16px 40px rgba(255, 90, 60, .5), 0 0 0 1px rgba(255, 255, 255, .1) inset;
}
.hero-v2 .btn-outline {
  color: #fff;
  background: rgba(10, 14, 39, .35);
  border: 1.5px solid rgba(255, 90, 60, .75);
  transition: transform .3s var(--hero-ease), background .3s, border-color .3s, box-shadow .3s;
}
.hero-v2 .btn-outline:hover {
  color: #fff;
  background: rgba(255, 90, 60, .12);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(255, 90, 60, .22);
  transform: translateY(-3px);
}
.hero-v2 .btn-arrow { display: inline-block; transition: transform .3s var(--hero-ease); }
.hero-v2 .btn:hover .btn-arrow { transform: translateX(5px); }
.hero-v2 .btn:focus-visible,
.hero-v2 .badge:focus-visible {
  outline: 2px solid var(--hero-violet);
  outline-offset: 3px;
}

/* ───────── RIGHT COLUMN — visual ───────── */
.hero-v2 .hero-visual {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1072 / 901;
  max-height: 78vh;
  justify-self: end;
  contain: layout;
}

/* floating wrapper: the slow, shared float of cloud + servers + orbits */
.hero-v2 .hero-visual-float {
  position: absolute;
  inset: 0;
  animation: heroFloat 9s ease-in-out infinite;
  will-change: transform;
}
.hero-v2 .hero-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  /* feathers the supplied image into the page's navy background */
  -webkit-mask-image: radial-gradient(ellipse closest-side at 52% 50%, #000 58%, transparent 100%);
          mask-image: radial-gradient(ellipse closest-side at 52% 50%, #000 58%, transparent 100%);
}

/* orbit overlay (SVG scaled with the image) */
.hero-v2 .hero-orbits {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.hero-v2 .orbit-ring {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 6 18;
  opacity: .8;
  animation: orbitDash 30s linear infinite;
}
.hero-v2 .orbit-ring--a { stroke: rgba(255, 138, 76, .65); }
.hero-v2 .orbit-ring--b { stroke: rgba(167, 139, 250, .6); animation-duration: 44s; animation-direction: reverse; }
.hero-v2 .orbit-ring--c { stroke: rgba(56, 189, 248, .55); animation-duration: 38s; }
.hero-v2 .orbit-dot { filter: drop-shadow(0 0 6px currentColor); }

/* glow that pulses behind the cloud */
.hero-v2 .hero-cloud-glow {
  position: absolute;
  left: 32%; top: 12%;
  width: 52%; height: 38%;
  background: radial-gradient(ellipse at center, rgba(96, 120, 255, .38), rgba(139, 92, 246, .16) 45%, transparent 70%);
  filter: blur(26px);
  animation: heroGlow 6s ease-in-out infinite;
  pointer-events: none;
}

/* floating network particles (pure CSS, transform/opacity only) */
.hero-v2 .hero-particles { position: absolute; inset: 0; pointer-events: none; }
.hero-v2 .hero-particles i {
  position: absolute;
  width: var(--s, 4px);
  height: var(--s, 4px);
  left: var(--x);
  top: var(--y);
  border-radius: 50%;
  background: var(--c, #60a5fa);
  box-shadow: 0 0 10px var(--c, #60a5fa), 0 0 22px var(--c, #60a5fa);
  opacity: 0;
  animation: particleDrift var(--d, 9s) ease-in-out var(--delay, 0s) infinite;
}

/* glass feature chips (from the reference design) */
.hero-v2 .hero-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem 1.05rem .8rem .85rem;
  font-size: .85rem;
  line-height: 1.25;
  font-weight: 500;
  color: #f1f5f9;
  background: linear-gradient(145deg, rgba(37, 56, 120, .55), rgba(18, 24, 58, .6));
  border: 1px solid rgba(125, 150, 255, .28);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 22px rgba(80, 100, 255, .18) inset;
  white-space: nowrap;
  animation: chipFloat 7s ease-in-out infinite;
}
.hero-v2 .hero-chip svg { width: 28px; height: 28px; flex: none; color: #38bdf8; }
.hero-v2 .hero-chip--speed    { left: 0;   top: 17%; transform: rotate(-4deg); }
.hero-v2 .hero-chip--security { right: 0;  top: 9%;  transform: rotate(4deg);  animation-delay: -2.2s; }
.hero-v2 .hero-chip--global   { right: -2%; top: 47%; transform: rotate(3deg);  animation-delay: -4.4s; }
.hero-v2 .hero-chip--security svg { color: #60a5fa; }
.hero-v2 .hero-chip--global svg   { color: #818cf8; }

/* ───────── ENTRANCE ANIMATIONS ─────────
   Content is only hidden when JS is available (class set by hero.js), and
   starts after the site preloader has finished. */
.hero-js .hero-v2 .hero-reveal,
.hero-js .hero-v2 .hero-visual-reveal { opacity: 0; }
/* `backwards` fill so hover transforms still work once the entrance is done */
.hero-v2.is-ready .hero-reveal {
  opacity: 1;
  animation: heroRise .9s var(--hero-ease) backwards;
  animation-delay: calc(var(--i, 0) * 110ms);
}
.hero-v2.is-ready .hero-visual-reveal {
  opacity: 1;
  animation: heroVisualIn 1.3s var(--hero-ease) .2s backwards;
}

/* pause the infinite animations while the hero is scrolled out of view */
.hero-v2.is-paused *,
.hero-v2.is-paused::before { animation-play-state: paused !important; }

/* ───────── KEYFRAMES ───────── */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroVisualIn {
  from { opacity: 0; transform: translateX(40px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes chipFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}
@keyframes heroGlow {
  0%, 100% { opacity: .65; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}
@keyframes heroShimmer {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}
@keyframes orbitDash { to { stroke-dashoffset: -240; } }
@keyframes particleDrift {
  0%   { opacity: 0; transform: translate3d(0, 10px, 0) scale(.7); }
  25%  { opacity: .95; }
  60%  { opacity: .7; }
  100% { opacity: 0; transform: translate3d(var(--dx, 12px), -48px, 0) scale(1.1); }
}

/* ───────── RESPONSIVE ───────── */
@media (max-width: 1100px) {
  .hero-v2 .hero-chip { font-size: .78rem; padding: .65rem .85rem .65rem .7rem; }
  .hero-v2 .hero-chip svg { width: 22px; height: 22px; }
}

/* Tablet */
@media (max-width: 900px) {
  .hero.hero-v2 { min-height: 0; text-align: center; }
  .hero-v2 .hero-split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 7.5rem 24px 3rem;
  }
  .hero-v2 .hero-text-col { align-items: center; }
  .hero.hero-v2 h1 { font-size: clamp(2.3rem, 7.4vw, 3.3rem); text-align: center; }
  .hero.hero-v2 p { font-size: 1.05rem; text-align: center; margin-left: auto; margin-right: auto; }
  .hero-v2 .hero-stats,
  .hero-v2 .hero-buttons { justify-content: center; }
  .hero-v2 .hero-visual {
    justify-self: center;
    max-width: 640px;
    max-height: none;
    margin-top: .5rem;
  }
  .hero-v2 .hero-chip--speed    { left: 2%; }
  .hero-v2 .hero-chip--security { right: 2%; }
}

/* Mobile */
@media (max-width: 600px) {
  .hero-v2 .hero-split { padding: 6.75rem 18px 2.5rem; gap: 1rem; }
  .hero-v2 .badge { font-size: .8rem; padding: .5rem .85rem; margin-bottom: 1.25rem; text-align: left; }
  .hero.hero-v2 h1 { font-size: clamp(2.05rem, 9.6vw, 2.6rem); line-height: 1.08; }
  .hero.hero-v2 p { font-size: 1rem; margin-bottom: 1.5rem; }

  .hero-v2 .hero-stats { gap: .5rem; margin-bottom: 1.75rem; }
  .hero-v2 .hero-stat { padding: .55rem .85rem .55rem .7rem; column-gap: .5rem; }
  .hero-v2 .hero-stat-ico { width: 20px; height: 20px; }
  .hero-v2 .hero-stat-val { font-size: .92rem; }
  .hero-v2 .hero-stat-label { font-size: .66rem; }

  .hero-v2 .hero-buttons { flex-direction: column; align-items: stretch; width: 100%; gap: .75rem; }
  .hero-v2 .hero-buttons .btn-large { width: 100%; }

  .hero-v2 .hero-visual { margin-top: 1rem; }
  .hero-v2 .hero-chip { padding: .45rem .65rem .45rem .5rem; font-size: .68rem; gap: .45rem; border-radius: 10px; }
  .hero-v2 .hero-chip svg { width: 17px; height: 17px; }
  .hero-v2 .hero-chip--speed    { left: 0;  top: 12%; }
  .hero-v2 .hero-chip--security { right: 0; top: 4%; }
  .hero-v2 .hero-chip--global   { right: 0; top: 56%; }
}

@media (max-width: 360px) {
  .hero-v2 .hero-chip--global { display: none; }
}

/* Short landscape screens: don't force full-viewport height */
@media (max-height: 640px) and (min-width: 901px) {
  .hero.hero-v2 { min-height: 0; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .hero.hero-v2 *,
  .hero.hero-v2::before {
    animation: none !important;
    transition: none !important;
  }
  .hero-js .hero-v2 .hero-reveal,
  .hero-js .hero-v2 .hero-visual-reveal { opacity: 1; }
  .hero-v2 .hero-particles { display: none; }
}

/* Icons that replaced emoji in the hero */
.hero-v2 .badge .badge-ico { display: inline-block; width: 16px; height: 16px; margin: -2px .45rem -2px 0; vertical-align: middle; color: #ff8a6a; }
.hero-v2 .btn-large > svg { width: 20px; height: 20px; flex: none; }
.hero-v2 .btn-arrow { width: 18px; height: 18px; }
