/* ============================================================
   FusionHost — BASE FRAMEWORK STYLESHEET (Shared Layout & Geometry)
   Contains: Resets, Typography, Keyframes, Components, A11y
   Version: 1.0.0
   ============================================================ */

/* ── 1. CORE VARIABLES & EASING ──────────────────────────────── */
:root {
  --font-primary:       'Plus Jakarta Sans', sans-serif;
  --transition-base:    200ms ease;
  --transition-smooth:  350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. GLOBAL RESET & BASE ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── 3. CUSTOM SCROLLBAR GEOMETRY ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { border-radius: 99px; }
:focus-visible { outline: 2px solid #2563EB; outline-offset: 3px; border-radius: 4px; }

/* ── 4. KEYFRAME ANIMATIONS ─────────────────────────────────── */
@keyframes marquee-left {
  0%   { transform: translateX(5%); }
  100% { transform: translateX(-5%); }
}
@keyframes marquee-right {
  0%   { transform: translateX(-5%); }
  100% { transform: translateX(5%); }
}
@keyframes bar-grow {
  to { transform: scaleX(1); }
}
@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}
@keyframes gauge-fill {
  to { stroke-dashoffset: var(--gauge-offset); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.5); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(-8px); }
  50%      { transform: translateY(8px); }
}
@keyframes float-reverse {
  0%, 100% { transform: translateY(8px); }
  50%      { transform: translateY(-8px); }
}
@keyframes rotate-slow {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes rotate-slow-reverse {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

/* ── 5. MARQUEE TRACKS ───────────────────────────────────────── */
.marquee-track { display: flex; width: max-content; will-change: transform; }
.marquee-track--left  { animation: marquee-left  8s linear infinite; }
.marquee-track--right { animation: marquee-right 8s linear infinite; }
.marquee-band { overflow: hidden; position: relative; }
.marquee-fade-left, .marquee-fade-right { position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2; pointer-events: none; }
.marquee-fade-left  { left: 0; }
.marquee-fade-right { right: 0; }

/* ── 6. BENTO DASHBOARD & CHARTS ────────────────────────────── */
.bento-card { border-radius: 20px; overflow: hidden; position: relative; }
.metric-bar { height: 8px; border-radius: 99px; overflow: hidden; }
.metric-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2563EB, #06B6D4);
  transform-origin: left;
  animation: bar-grow 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform: scaleX(0);
}
.sparkline-path { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw-line 1.8s ease forwards 0.5s; }
.gauge-arc {
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  animation: gauge-fill 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.3s;
  transform-origin: center;
  transform: rotate(-90deg);
}

/* ── 7. ANIMATION UTILITY CLASSES ────────────────────────────── */
.animate-spin-slow     { animation: spin-slow 20s linear infinite; }
.animate-float-slow    { animation: float-slow 5s ease-in-out infinite; }
.animate-float-reverse { animation: float-reverse 6s ease-in-out infinite; }
.animate-rotate-slow   { animation: rotate-slow 40s linear infinite; }
.animate-rotate-reverse{ animation: rotate-slow-reverse 45s linear infinite; }
.float-anim            { animation: float-y 5s ease-in-out infinite; }
.pulse-dot             { animation: pulse-dot 2s ease-in-out infinite; }
.stat-counter          { font-variant-numeric: tabular-nums; }

/* ── 8. MEGA MENU & NAVIGATION DROPDOWNS ─────────────────────── */
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.mega-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── 9. MOBILE DRAWER & FULL-PAGE MENU ───────────────────────── */
.mobile-drawer, #mobile-menu {
  transform: translateX(100%);
  transition: transform var(--transition-smooth), opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-drawer.is-open, #mobile-menu.mobile-menu-open {
  transform: translateX(0);
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
.drawer-overlay {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}
.drawer-overlay.is-open, .drawer-overlay.mobile-menu-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ── 10. TYPOGRAPHY HELPERS ──────────────────────────────────── */
.display-heading { font-size: clamp(2.25rem, 5.5vw, 4.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.section-heading { font-size: clamp(1.75rem, 3.5vw, 2.75rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }

/* ── 11. SKIP LINK & ACCESSIBILITY ───────────────────────────── */
.skip-link {
  position: absolute;
  top: -99px;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: #2563EB;
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── 12. MODAL BACKDROP & PANEL ──────────────────────────────── */
.modal-backdrop { opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease; }
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal-panel { transform: scale(0.95) translateY(20px); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.modal-backdrop.is-open .modal-panel { transform: scale(1) translateY(0); }

/* ── 13. UI PILLS & BADGES ───────────────────────────────────── */
.service-pill { transition: all 200ms ease; }
.service-pill.hidden-pill { display: none; }
.global-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
@media (min-width: 768px) {
  .global-pill {
    font-size: 0.8125rem;
    padding: 0.4rem 1.15rem;
  }
}
.tech-card {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
}
.tech-card img { width: 100%; height: 100%; object-fit: contain; }
.shield-card { position: relative; }

/* ── 14. NO-SCROLLBAR UTILITY ────────────────────────────────── */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ── 15. ACCESSIBLE FEATURE TOOLTIPS & PRICING ELEVATION ─────── */
#pricing ul > li {
  position: relative;
  z-index: 1;
}
#pricing ul > li:hover,
#pricing ul > li:focus-within {
  z-index: 30;
}
#pricing ul > li article {
  position: relative;
}
#pricing ul > li article:hover,
#pricing ul > li article:focus-within {
  z-index: 30;
}

.ttip {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.35rem;
  cursor: help;
  z-index: 20;
}
.ttip:hover,
.ttip:focus-visible,
.ttip:focus-within {
  z-index: 50;
}
.ttip .tip-box {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 60;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
}
.ttip .tip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}
.ttip:hover .tip-box, .ttip:focus-visible .tip-box {
  opacity: 1;
  visibility: visible;
}
@media (min-width: 1024px) {
  #pricing ul > li:last-child .ttip .tip-box,
  #pricing ul > li:nth-child(4n) .ttip .tip-box {
    left: auto;
    right: -10px;
    transform: none;
  }
  #pricing ul > li:last-child .ttip .tip-box::after,
  #pricing ul > li:nth-child(4n) .ttip .tip-box::after {
    left: auto;
    right: 14px;
    transform: none;
  }
}
@media (max-width: 640px) {
  .ttip .tip-box { width: 180px; left: auto; right: -10px; transform: none; }
  .ttip .tip-box::after { left: auto; right: 14px; transform: none; }
}

/* ── 16. SPEED BENCHMARK BARS ────────────────────────────────── */
.bar-track {
  height: 12px;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 9999px;
  width: 0%;
  will-change: width;
}
.bar-typical {
  background: linear-gradient(90deg, #94A3B8, #64748B);
  transition: width 1.35s cubic-bezier(0.25, 1, 0.5, 1);
}
.bar-fusionhost {
  background: linear-gradient(90deg, #2563EB, #06B6D4);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.45);
  transition: width 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}
.speed-animated .bar-typical {
  width: 96%;
}
.speed-animated .bar-fusionhost {
  width: 5%;
  animation: fusionPulseGlow 3s ease-in-out infinite;
}

@keyframes fusionPulseGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4), 0 0 20px rgba(37, 99, 235, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.75), 0 0 30px rgba(37, 99, 235, 0.45);
  }
}

/* ── 17. STICKY MOBILE CTA BAR ──────────────────────────────── */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.75rem 1rem;
}
@media (max-width: 980px) {
  .sticky-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
}

/* ── 18. REGION & CURRENCY SWITCHER ─────────────────────────── */
.region-switch { position: relative; }
.rs-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  border-radius: 12px;
  padding: 6px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 60;
}
.region-switch.is-open .rs-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.rs-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

/* ── 19. WHATSAPP & SUPPORT CTA ─────────────────────────────── */
.btn-wa {
  background-color: #25D366;
  color: #FFFFFF;
  transition: all 0.2s ease;
}
.btn-wa:hover {
  background-color: #1EB455;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

/* ── 20. AMBIENT CURSOR SPOTLIGHT BASE ──────────────────────── */
.ambient-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  height: 140px;
  margin-left: -70px;
  margin-top: -70px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 35;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  transform: translate3d(-999px, -999px, 0);
  will-change: transform, opacity;
}
.ambient-spotlight.is-active {
  opacity: 1;
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .ambient-spotlight {
    display: none !important;
  }
}
