/* ========== EXACT FONTS FROM SOURCE ========== */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');

/* ========== HSL VARIABLES FROM SOURCE ========== */
:root {
  --background: 42 40% 94%;
  --foreground: 166 31% 17%;
  --border: 38 24% 79%;
  --card: 42 38% 97%;
  --primary: 166 45% 24%;
  --primary-foreground: 42 40% 94%;
  --secondary: 35 39% 86%;
  --muted: 40 28% 88%;
  --muted-foreground: 164 15% 41%;
  --accent: 19 70% 49%;
  --accent-foreground: 42 40% 94%;
  --hero-gold: 39 67% 63%;
  
  --font-sans: 'DM Sans', sans-serif;
  --font-serif: 'Fraunces', serif;
  --font-mono: 'DM Mono', monospace;
  
  --shadow-sm: 0 8px 24px rgba(32, 65, 59, .07);
  --shadow-md: 0 20px 48px rgba(32, 65, 59, .12);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --background: 166 31% 11%;
  --foreground: 42 40% 94%;
  --border: 166 20% 25%;
  --card: 166 28% 15%;
  --primary: 39 67% 63%;
  --primary-foreground: 166 31% 11%;
  --secondary: 166 20% 22%;
  --muted: 166 20% 22%;
  --muted-foreground: 42 15% 69%;
  --accent: 19 70% 58%;
  --accent-foreground: 166 31% 11%;
}

/* ========== GLOBAL OVERRIDES ========== */
body {
  font-family: var(--font-sans);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden; /* FIXED: Prevents the marquee from stretching the page */
}

h1, h2, h3, h4, h5, h6, .font-display { font-family: var(--font-serif); }
.font-mono-ui { font-family: var(--font-mono); }
a { text-decoration: none; color: inherit; transition: all 0.2s; }

/* ========== EXACT TYPOGRAPHY SIZING ========== */
.hero-title { font-size: 3.75rem; line-height: 0.9; letter-spacing: -0.055em; }
@media (min-width: 768px) { .hero-title { font-size: 6rem; } }

.section-title { font-size: 2.25rem; line-height: 1.02; letter-spacing: -0.03em; }
@media (min-width: 768px) { .section-title { font-size: 3rem; } }

.eyebrow {
  color: hsl(var(--accent)); font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.17em; text-transform: uppercase;
}

.page-wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ========== NAVIGATION HOVER (From Source) ========== */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
  color: hsl(var(--foreground)) !important;
  font-size: 12px;
  font-weight: 600;
  padding: 0.5rem 0 !important;
  margin: 0 0.5rem;
}
.nav-link::after {
  content: ''; position: absolute; height: 1px;
  left: 0; right: 100%; bottom: 0px;
  background: hsl(var(--accent));
  transition: right 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: hsl(var(--accent)) !important; }
.nav-link:hover::after, .nav-link.active::after { right: 0; }

/* ========== MEGA MENU ========== */
.has-mega-menu { position: static; }
.mega-menu {
  width: 100%; left: 0; right: 0;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0 0 1.15rem 1.15rem;
  box-shadow: var(--shadow-md);
  margin-top: 0; opacity: 0; visibility: hidden;
  transform: translateY(10px); transition: all 0.3s ease;
  display: block;
}
.has-mega-menu:hover .mega-menu, .has-mega-menu .dropdown-toggle.show + .mega-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.mega-menu .dropdown-item {
  color: hsl(var(--foreground)); font-size: 0.875rem;
  border-radius: 0.5rem; padding: 0.5rem 1rem;
}
.mega-menu .dropdown-item:hover {
  background: hsl(var(--secondary)); color: hsl(var(--accent));
}

/* ========== TOP BAR & TICKER ========== */
.top-bar {
  background: hsl(var(--secondary)); color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
  font-size: 11px; font-weight: 600; padding: 6px 0;
}
.top-link:hover { color: hsl(var(--accent)); }

.announcement-ticker {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.15em; padding: 8px 0; overflow: hidden; white-space: nowrap;
}
.ticker-content { display: inline-flex; animation: marquee 35s linear infinite; }
.ticker-item { padding: 0 2rem; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ========== BUTTONS & CARDS ========== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  border-radius: 999px; border: none;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  padding: 0.8rem 1.15rem; font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); background: hsl(166 45% 29%); color: hsl(var(--primary-foreground)); }

.btn-amber {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  border-radius: 999px; border: none;
  background: hsl(var(--accent)); color: hsl(var(--accent-foreground));
  padding: 0.8rem 1.15rem; font-weight: 600;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-amber:hover { transform: translateY(-2px); filter: brightness(1.08); color: hsl(var(--accent-foreground)); }

.btn-quiet {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: hsl(var(--primary)); font-weight: 600; transition: color 0.2s ease, gap 0.2s ease;
}
.btn-quiet:hover { color: hsl(var(--accent)); gap: 0.7rem; }

.lift { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.media-image { background-position: center; background-size: cover; }

/* ========== ANIMATED HERO SLIDER ========== */
.hero-slider-wrap {
  position: relative;
  min-height: 635px;
  overflow: hidden;
}
.hero-slider-wrap .carousel, .hero-slider-wrap .carousel-inner, .hero-slider-wrap .carousel-item {
  height: 100%; min-height: 635px;
}
.hero-bg-anim {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.08); transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 0;
}
.carousel-item.active .hero-bg-anim { transform: scale(1); }
.hero-overlay-gradient {
  position: absolute; inset: 0;
  background-image: linear-gradient(90deg, rgba(18,52,48,.92) 0%, rgba(18,52,48,.56) 42%, rgba(18,52,48,.1) 78%);
  z-index: 1;
}

/* Staggered Text Reveal */
.hero-content-z { position: relative; z-index: 2; height: 100%; }
.hero-content-z .reveal-group { opacity: 0; transform: translateY(20px); transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.carousel-item.active .hero-content-z .reveal-1 { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.carousel-item.active .hero-content-z .reveal-2 { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
.carousel-item.active .hero-content-z .reveal-3 { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }
.carousel-item.active .hero-content-z .reveal-4 { opacity: 1; transform: translateY(0); transition-delay: 0.8s; }

/* ========== GRAIN OVERLAY ========== */
.grain::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: 0.035; z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

/* ========== STATS SECTION ========== */
.stat-number {
  font-size: 3.5rem;
  line-height: 1;
  color: hsl(var(--accent));
  margin-bottom: 0.5rem;
}
@media (min-width: 768px) {
  .stat-number { font-size: 4.5rem; }
}

/* ========== WHY US: REVEAL CARDS ========== */
.reveal-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  height: 400px;
  cursor: pointer;
}
.reveal-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.7s ease;
  z-index: 1;
}
.reveal-card-overlay {
  position: absolute;
  inset: 0;
  /* FIXED: Syntax updated to modern hsl with alpha */
  background: linear-gradient(to top, hsl(var(--background) / 0.95) 0%, hsl(var(--background) / 0.1) 100%);
  z-index: 2;
  transition: opacity 0.4s ease;
}
.reveal-card-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem;
  z-index: 3;
  transform: translateY(45%);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-card:hover .reveal-card-bg {
  transform: scale(1.08);
  filter: brightness(0.6);
}
.reveal-card:hover .reveal-card-content {
  transform: translateY(0);
}
.reveal-card .hidden-text {
  opacity: 0;
  transition: opacity 0.4s ease;
  transition-delay: 0.1s;
}
.reveal-card:hover .hidden-text {
  opacity: 1;
}

/* ========== SAAS TESTIMONIAL MARQUEE ========== */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  width: 100%;
}
.marquee-container::before, .marquee-container::after {
  content: '';
  position: absolute;
  top: 0; width: 150px; height: 100%;
  z-index: 2;
  pointer-events: none;
}
.marquee-container::before {
  left: 0;
  background: linear-gradient(to right, hsl(var(--background)) 0%, transparent 100%);
}
.marquee-container::after {
  right: 0;
  background: linear-gradient(to left, hsl(var(--background)) 0%, transparent 100%);
}

.marquee-track {
  display: inline-flex;
  animation: marquee-scroll 45s linear infinite;
  gap: 1.5rem;
  padding-left: 1.5rem;
}
.marquee-track-reverse {
  display: inline-flex;
  animation: marquee-scroll-reverse 45s linear infinite;
  gap: 1.5rem;
  padding-left: 1.5rem;
}
.marquee-track:hover, .marquee-track-reverse:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes marquee-scroll-reverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.testimonial-card {
  white-space: normal;
  width: 380px;
  flex-shrink: 0;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.25rem;
  padding: 2rem;
  transition: box-shadow 0.3s ease;
}
.testimonial-card:hover {
  box-shadow: var(--shadow-md);
}

/* ========== SCROLL REVEAL "PUZZLE" SYSTEM ========== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.25s; }
.delay-3 { transition-delay: 0.4s; }
.delay-4 { transition-delay: 0.55s; }

/* ========== 3D ENTRANCE FOR "WHY US" CARDS ========== */
.reveal-card-3d {
  opacity: 0;
  transform: translateY(60px) scale(0.9) rotateX(15deg);
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-card-3d.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0deg);
}

/* ========== PARALLAX SECTION ========== */
.parallax-section {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: white;
  overflow: hidden;
}
.parallax-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(31, 71, 54, 0.85) 0%, rgba(10, 10, 10, 0.6) 100%);
  z-index: 1;
}
.parallax-content {
  position: relative;
  z-index: 2;
  padding: 4rem 2rem;
}

/* ========== PACKAGE BUILDER UI ========== */
.custom-input-editorial,
.custom-select-editorial {
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  width: 100%;
}

.custom-input-editorial:focus,
.custom-select-editorial:focus {
  outline: none;
  border-color: hsl(var(--accent));
  box-shadow: 0 0 0 3px hsla(var(--accent), 0.15);
  background-color: hsl(var(--card));
}

/* Specific styling to make date pickers look elegant in dark/light mode */
::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}
[data-theme="dark"] ::-webkit-calendar-picker-indicator {
  filter: invert(1);
}