/* ═══════════════════════════════════════════════════
   Happie Max — Global Design Tokens & Animations
   Premium Dark Enterprise Aesthetic
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --hm-bg:       #090D16;
  --hm-bg-alt:   #0B0F19;
  --hm-surface:  #0E1320;
  --hm-border:   rgba(255,255,255,0.06);
  --hm-blue:     #2563EB;
  --hm-violet:   #7C3AED;
  --hm-cyan:     #38BDF8;
  --hm-text:     #F1F5F9;
  --hm-text-2:   #94A3B8;
  --hm-text-3:   #64748B;
  --hm-grad:     linear-gradient(135deg, var(--hm-blue), var(--hm-violet));
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--hm-bg);
  color: var(--hm-text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────────────── */
.font-heading { font-family: 'Space Grotesk', sans-serif; }
.gradient-text {
  background: var(--hm-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--hm-bg); }
::-webkit-scrollbar-thumb { background: rgba(37,99,235,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(37,99,235,0.45); }

/* ── Keyframes ──────────────────────────────── */
@keyframes hmFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-18px); }
}
@keyframes hmPulse {
  0%,100% { opacity:.35; transform:scale(1); }
  50%     { opacity:.7;  transform:scale(1.06); }
}
@keyframes hmGradShift {
  0%   { background-position:0% 50%; }
  50%  { background-position:100% 50%; }
  100% { background-position:0% 50%; }
}
@keyframes hmFadeUp {
  from { opacity:0; transform:translateY(28px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes hmShimmer {
  0%   { transform:translateX(-100%); }
  100% { transform:translateX(100%); }
}
@keyframes hmSpin {
  to { transform: rotate(360deg); }
}
@keyframes hmOrbitX {
  to { transform: rotateX(360deg); }
}
@keyframes hmOrbitY {
  to { transform: rotateY(360deg); }
}
@keyframes hmScanLine {
  0%   { top:-2px; opacity:1; }
  100% { top:100%; opacity:0; }
}
@keyframes hmScrollDot {
  0%   { transform: translateY(0);    opacity: 0; }
  25%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: translateY(26px); opacity: 0; }
}
@keyframes hmScrollNudge {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(6px); }
}

/* ── Reusable Classes ───────────────────────── */
.hm-glass {
  background: linear-gradient(135deg, rgba(14,19,32,.85), rgba(14,19,32,.45));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hm-border);
}
.hm-section {
  position: relative;
  padding: 80px 48px;
  max-width: 1440px;
  margin: 0 auto;
}
@media (max-width:768px) {
  .hm-section { padding: 60px 20px; }
}
.hm-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 100px;
  background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.2);
  color: #60A5FA;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

/* ── Buttons ────────────────────────────────── */
.hm-btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  position: relative; overflow: hidden;
  padding: 15px 34px;
  border-radius: 14px; font-weight: 600; font-size: 15px;
  font-family: 'Inter', sans-serif;
  border: none; cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s;
  text-decoration: none;
  z-index: 0;
}
.hm-btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 14px;
  padding: 1.5px;
  background: linear-gradient(135deg, #60A5FA, #A78BFA, #38BDF8);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s;
  z-index: -1;
}
.hm-btn-primary::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transition: left .6s ease;
}
.hm-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 20px rgba(37,99,235,.35),
    0 0 60px rgba(124,58,237,.15),
    0 8px 24px rgba(0,0,0,.2);
}
.hm-btn-primary:hover::before { opacity: 1; }
.hm-btn-primary:hover::after { left: 120%; }
.hm-btn-primary:active { transform: translateY(0) scale(.98); }

.hm-btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  position: relative; overflow: hidden;
  padding: 15px 34px;
  border-radius: 14px; font-weight: 600; font-size: 15px;
  font-family: 'Inter', sans-serif;
  cursor: pointer; text-decoration: none;
  color: var(--hm-text);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all .35s cubic-bezier(.4,0,.2,1);
}
.hm-btn-secondary::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(37,99,235,.4), rgba(124,58,237,.2), rgba(56,189,248,.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s;
}
.hm-btn-secondary:hover {
  background: rgba(37,99,235,.06);
  box-shadow: 0 0 24px rgba(37,99,235,.1), 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
  border-color: transparent;
}
.hm-btn-secondary:hover::before { opacity: 1; }
.hm-btn-secondary:active { transform: translateY(0) scale(.98); }

/* Light mode button overrides */
body.light-theme .hm-btn-secondary {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.1);
}
body.light-theme .hm-btn-secondary:hover {
  background: rgba(37,99,235,.04);
  border-color: transparent;
}

/* ── Scroll Reveal ──────────────────────────── */
.hm-reveal {
  opacity: 1;
  transform: none;
}

/* ── Marquee ─────────────────────────────────── */
@keyframes hmMarquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.hm-marquee-track {
  display: flex;
  gap: 48px;
  animation: hmMarquee 30s linear infinite;
  width: max-content;
}
.hm-marquee-track:hover { animation-play-state: paused; }

/* ── Process connector line ──────────────────── */
@keyframes hmDash {
  to { stroke-dashoffset: 0; }
}

/* ═══════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ═══════════════════════════════════════════════ */
body.light-theme {
  --hm-bg:       #F8FAFD;
  --hm-bg-alt:   #EFF3F8;
  --hm-surface:  #FFFFFF;
  --hm-border:   rgba(0,0,0,0.07);
  --hm-text:     #0F172A;
  --hm-text-2:   #475569;
  --hm-text-3:   #94A3B8;
  background: var(--hm-bg);
  color: var(--hm-text);
}

/* Scrollbar */
body.light-theme::-webkit-scrollbar-track { background: #F1F5F9; }
body.light-theme::-webkit-scrollbar-thumb { background: rgba(37,99,235,.25); }

/* Glass cards → white cards with shadow */
body.light-theme .hm-glass {
  background: rgba(255,255,255,.85) !important;
  border-color: rgba(0,0,0,.06) !important;
  backdrop-filter: blur(12px);
}

/* GlowCards (service cards, etc.) */
body.light-theme [data-glowcard] {
  background: rgba(255,255,255,.7) !important;
  border-color: rgba(0,0,0,.06) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.light-theme [data-glowcard]:hover {
  box-shadow: 0 4px 24px rgba(37,99,235,.1), 0 8px 32px rgba(0,0,0,.06) !important;
  background: rgba(255,255,255,.85) !important;
}

/* Navbar */
body.light-theme nav {
  background: rgba(248,250,253,.7) !important;
  border-bottom-color: rgba(0,0,0,.06) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

/* Badges */
body.light-theme .hm-badge {
  background: rgba(37,99,235,.06);
  border-color: rgba(37,99,235,.15);
}

/* Buttons */
body.light-theme .hm-btn-secondary {
  border-color: rgba(0,0,0,.12) !important;
  color: var(--hm-text) !important;
}
body.light-theme .hm-btn-secondary:hover {
  background: rgba(37,99,235,.05) !important;
  border-color: var(--hm-blue) !important;
}

/* Hero section — keep transparent so the particle field shows through */
body.light-theme #home {
  background: transparent !important;
}

/* Section backgrounds — transparent so particles show through */
body.light-theme section {
  background: transparent !important;
}

/* Marquee */
body.light-theme .hm-marquee-wrap {
  background: rgba(241,245,249,.30) !important;
  border-color: rgba(0,0,0,.04) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.light-theme .hm-marquee-wrap .hm-fade-l {
  background: linear-gradient(to right, var(--hm-bg), transparent) !important;
}
body.light-theme .hm-marquee-wrap .hm-fade-r {
  background: linear-gradient(to left, var(--hm-bg), transparent) !important;
}

/* Stats bar */
body.light-theme .hm-stats-bar {
  border-color: rgba(0,0,0,.05) !important;
}

/* CTA banner */
body.light-theme .hm-cta-banner {
  background: rgba(237,242,255,.6) !important;
  border-color: rgba(37,99,235,.1) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Footer */
body.light-theme footer {
  background: rgba(232,237,245,.5) !important;
  border-top-color: rgba(0,0,0,.05) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.light-theme footer a {
  color: var(--hm-text-3);
}
body.light-theme footer a:hover {
  color: var(--hm-blue) !important;
}

/* Social icons in footer */
body.light-theme .hm-social-icon {
  background: rgba(0,0,0,.03) !important;
  border-color: rgba(0,0,0,.06) !important;
  color: var(--hm-text-3) !important;
}
body.light-theme .hm-social-icon:hover {
  background: rgba(37,99,235,.08) !important;
  border-color: rgba(37,99,235,.2) !important;
  color: #2563EB !important;
}

/* Process connector */
body.light-theme .hm-process-connectors {
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.15), rgba(124,58,237,.15), transparent) !important;
}

/* Process step circles */
body.light-theme .hm-step-circle {
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.05)) !important;
  border-color: rgba(37,99,235,.15) !important;
}

/* Mobile drawer */
body.light-theme .hm-mobile-drawer {
  background: rgba(248,250,253,.97) !important;
  border-left-color: rgba(0,0,0,.06) !important;
}
body.light-theme .hm-mobile-drawer a {
  color: var(--hm-text) !important;
  border-bottom-color: rgba(0,0,0,.06) !important;
}

/* Ambient glow blobs — reduce in light mode */
body.light-theme .hm-ambient-blob {
  opacity: 0.3 !important;
}

/* Theme toggle button */
.hm-theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--hm-text-2);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .25s;
}
.hm-theme-toggle:hover {
  background: rgba(37,99,235,.1);
  border-color: rgba(37,99,235,.25);
  color: #60A5FA;
}
body.light-theme .hm-theme-toggle {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
}
body.light-theme .hm-theme-toggle:hover {
  background: rgba(37,99,235,.08);
  border-color: rgba(37,99,235,.2);
}

/* ── Selection ──────────────────────────────── */
::selection {
  background: rgba(37,99,235,.35);
  color: #fff;
}
