/* ==========================================================================
   FLUID RESPONSIVE SCALING SYSTEM
   
   This system maintains the EXACT same layout across all screen sizes.
   Only the scale of content (fonts, images, spacing) changes proportionally.
   Design base: 1440px viewport width
   ========================================================================== */

:root {
  /* Base design width for scaling calculations */
  --design-width: 1440;
  
  /* Scale factor: 1vw = (1/100) of viewport width
     At 1440px: 1vw = 14.4px
     We use this to create proportional scaling */
  
  /* Fluid base font size with min/max bounds
     This is the key to fluid scaling - everything using rem will scale proportionally */
  --fluid-base: clamp(10px, calc(16 / var(--design-width) * 100vw), 20px);
  
  /* Fluid spacing scale */
  --fluid-xs: clamp(4px, 0.28vw, 6px);
  --fluid-sm: clamp(8px, 0.56vw, 12px);
  --fluid-md: clamp(12px, 1.1vw, 20px);
  --fluid-lg: clamp(20px, 1.67vw, 32px);
  --fluid-xl: clamp(28px, 2.5vw, 48px);
  --fluid-2xl: clamp(40px, 3.5vw, 64px);
  --fluid-3xl: clamp(60px, 5.5vw, 100px);
  --fluid-4xl: clamp(80px, 7vw, 140px);
}

/* Apply fluid base font size to html for rem-based scaling */
html {
  font-size: var(--fluid-base);
}

/* ==========================================================================
   NAVIGATION - Fluid Scaling
   ========================================================================== */

.nav-inner {
  max-width: none;
  width: 100%;
  padding: clamp(10px, 1vw, 16px) clamp(16px, 2.8vw, 48px);
  gap: clamp(12px, 1.25vw, 24px);
}

.brand {
  gap: clamp(4px, 0.56vw, 10px);
  align-items: center;
}

.brand-name {
  font-size: clamp(14px, 1.25vw, 20px) !important;
}

.spark-star {
  width: clamp(18px, 1.67vw, 28px);
  height: clamp(18px, 1.67vw, 28px);
}

.nav-links {
  gap: clamp(8px, 1.1vw, 20px);
  font-size: clamp(11px, 0.97vw, 15px);
}

.nav-links a {
  padding: clamp(4px, 0.42vw, 8px) clamp(6px, 0.56vw, 10px);
}

.btn {
  padding: clamp(8px, 0.7vw, 12px) clamp(14px, 1.25vw, 22px);
  font-size: clamp(11px, 0.97vw, 15px);
}

/* ==========================================================================
   HERO SECTION - Fluid Scaling
   ========================================================================== */

.hero {
  padding: clamp(100px, 12.5vw, 200px) clamp(20px, 2.8vw, 48px) clamp(80px, 11vw, 180px) !important;
}

.hero-content {
  max-width: clamp(300px, 68vw, 1100px);
}

.hero-brand {
  font-size: clamp(18px, 2.2vw, 40px);
  gap: clamp(8px, 1.1vw, 20px);
}

.hero-brand .spark-star {
  width: clamp(24px, 2.2vw, 40px);
  height: clamp(24px, 2.2vw, 40px);
}

.hero-brand-wrapper {
  line-height: 1;
}

.hero-brand-arrow {
  /* Position below text with small gap */
  bottom: clamp(-3px, -0.25vw, -5px);
  /* Start at middle of 'S' */
  left: 6%;
  /* End at 'i' */
  width: 88%;
  height: clamp(10px, 1vw, 18px);
}

/* Hero title - fluid typography maintaining line breaks */
.hero-title {
  font-size: clamp(24px, 4.2vw, 76px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.025em;
  margin: 0 0 clamp(14px, 1.9vw, 32px) !important;
  max-width: none !important;
}

.hero-title .line {
  display: block;
  white-space: nowrap;
}

/* Hero subtitle */
.hero-sub {
  font-size: clamp(12px, 1.18vw, 19px) !important;
  line-height: 1.6;
  max-width: clamp(280px, 47vw, 720px);
  margin: 0 auto clamp(18px, 2.5vw, 44px) !important;
}

/* Hero buttons */
.hero-actions {
  gap: clamp(8px, 0.97vw, 16px);
}

.hero .btn {
  padding: clamp(8px, 0.7vw, 14px) clamp(14px, 1.4vw, 24px);
  font-size: clamp(11px, 0.97vw, 16px);
  border-radius: clamp(3px, 0.28vw, 5px);
}

/* Star animation elements - fluid sizing */
.star-dot {
  top: clamp(-8px, -0.83vw, -14px);
  width: clamp(12px, 1.25vw, 22px);
  height: clamp(12px, 1.25vw, 22px);
}

.sliding-star {
  /* Position on the arrow - adjusted to match arrow spacing */
  bottom: clamp(-4px, -0.35vw, -6px);
  /* Start at middle of 'S' where arrow begins */
  left: 6%;
  width: clamp(12px, 1.25vw, 22px);
  height: clamp(12px, 1.25vw, 22px);
}

/* ==========================================================================
   SECTIONS - Fluid Scaling
   ========================================================================== */

.section {
  max-width: clamp(320px, 76vw, 1200px);
  padding: clamp(40px, 5.5vw, 100px) clamp(16px, 1.4vw, 24px);
}

.section-head {
  max-width: clamp(280px, 52.8vw, 800px);
  margin: 0 auto clamp(16px, 2.1vw, 36px);
}

.eyebrow {
  font-size: clamp(9px, 0.76vw, 12px);
  letter-spacing: 0.16em;
  margin-bottom: clamp(6px, 0.7vw, 12px);
}

.section h2 {
  font-size: clamp(20px, 2.5vw, 44px);
  margin: 0 0 clamp(6px, 0.7vw, 12px);
  line-height: 1.15;
}

.section p {
  font-size: clamp(12px, 1.04vw, 17px);
  line-height: 1.5;
}

/* ==========================================================================
   CARDS & GRID - Fluid Scaling
   ========================================================================== */

.grid {
  gap: clamp(10px, 1.1vw, 18px);
  /* Keep multi-column layout at all sizes */
  grid-template-columns: repeat(3, 1fr);
}

.grid.plans {
  grid-template-columns: repeat(3, 1fr);
}

.grid.steps {
  grid-template-columns: repeat(3, 1fr);
}

.cards {
  margin-top: clamp(12px, 1.4vw, 24px);
}

.card {
  padding: clamp(12px, 1.25vw, 22px);
  border-radius: clamp(10px, 1.1vw, 18px);
}

/* Metric cards */
.metric-value {
  font-size: clamp(18px, 1.9vw, 32px);
  margin: 0 0 clamp(4px, 0.42vw, 8px);
}

.metric-label {
  font-size: clamp(11px, 0.97vw, 16px);
}

.metric-sub {
  font-size: clamp(10px, 0.9vw, 14px);
  margin: clamp(4px, 0.42vw, 8px) 0 0;
}

/* Feature & Step cards */
.feature h3,
.step h3 {
  font-size: clamp(13px, 1.18vw, 20px);
  margin: 0 0 clamp(4px, 0.56vw, 10px);
}

.feature p,
.step p {
  font-size: clamp(11px, 0.9vw, 15px);
  line-height: 1.5;
}

.step-num {
  font-size: clamp(10px, 0.83vw, 13px);
  top: clamp(10px, 0.97vw, 16px);
  right: clamp(10px, 1.1vw, 18px);
}

/* Plan cards */
.plan-name {
  font-size: clamp(12px, 1.1vw, 18px);
  margin: 0 0 clamp(4px, 0.42vw, 8px);
}

.plan-price {
  font-size: clamp(18px, 1.9vw, 32px);
  margin: 0 0 clamp(8px, 0.83vw, 14px);
}

.plan-list {
  gap: clamp(4px, 0.56vw, 10px);
  font-size: clamp(10px, 0.9vw, 15px);
  margin: 0 0 clamp(10px, 1.1vw, 18px);
}

/* ==========================================================================
   CTA SECTION - Fluid Scaling
   ========================================================================== */

.cta .cta-inner {
  padding: clamp(14px, 1.5vw, 26px);
  border-radius: clamp(10px, 1.1vw, 18px);
  gap: clamp(10px, 1.1vw, 18px);
  /* Keep horizontal layout */
  flex-direction: row;
  align-items: center;
}

.cta h2 {
  font-size: clamp(16px, 1.8vw, 32px);
}

.cta p {
  font-size: clamp(11px, 0.97vw, 16px);
}

/* ==========================================================================
   FAQ SECTION - Fluid Scaling
   ========================================================================== */

.faq {
  max-width: clamp(280px, 62.5vw, 960px);
  gap: clamp(6px, 0.7vw, 12px);
}

details {
  padding: clamp(10px, 0.97vw, 16px) clamp(12px, 1.1vw, 18px);
  border-radius: clamp(8px, 0.83vw, 14px);
}

summary {
  font-size: clamp(12px, 1.04vw, 17px);
}

details p {
  font-size: clamp(11px, 0.9vw, 15px);
  margin-top: clamp(8px, 0.7vw, 12px);
}

/* ==========================================================================
   FOOTER - Fluid Scaling
   ========================================================================== */

.footer-container {
  max-width: none;
  width: 100%;
  padding: clamp(30px, 4.2vw, 70px) clamp(16px, 2.8vw, 48px) clamp(12px, 1.4vw, 24px);
}

.footer-top {
  /* Keep 2-column layout */
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 4.2vw, 70px);
  padding-bottom: clamp(26px, 3.5vw, 56px);
}

.footer-headline {
  font-size: clamp(18px, 2.8vw, 52px);
}

/* Spark.Ai brand with arrow in footer headline */
.footer-headline-brand {
  position: relative;
  display: inline-block;
  padding-bottom: clamp(4px, 0.4vw, 8px);
}

.footer-headline-arrow {
  position: absolute;
  bottom: clamp(-2px, -0.2vw, -4px);
  left: 6%;
  width: 88%;
  height: clamp(8px, 0.8vw, 14px);
  pointer-events: none;
}

.footer-links-group {
  gap: clamp(30px, 5.5vw, 100px);
}

.footer-column {
  gap: clamp(8px, 0.83vw, 14px);
}

.footer-column h4 {
  font-size: clamp(11px, 0.97vw, 15px);
  margin: 0 0 clamp(2px, 0.28vw, 5px) 0;
}

.footer-column a {
  font-size: clamp(11px, 0.97vw, 15px);
}

.footer-bottom-bar {
  /* Keep horizontal layout */
  flex-direction: row;
  padding-top: clamp(14px, 1.67vw, 28px);
}

.footer-brand-small {
  gap: clamp(4px, 0.42vw, 8px);
  font-size: clamp(11px, 0.97vw, 15px);
  align-items: center;
}

.footer-brand-small .spark-star {
  width: clamp(14px, 1.25vw, 20px);
  height: clamp(14px, 1.25vw, 20px);
}

.footer-brand-small .brand-arrow {
  /* Match hero arrow spacing and span */
  bottom: clamp(-6px, -0.5vw, -9px);
  left: 6%;
  width: 88%;
  height: clamp(6px, 0.6vw, 10px);
}

.footer-legal {
  gap: clamp(12px, 1.67vw, 28px);
  /* Keep horizontal layout */
  flex-wrap: nowrap;
}

.footer-legal a {
  font-size: clamp(10px, 0.9vw, 14px);
}

/* ==========================================================================
   IMAGES - Fluid Scaling
   ========================================================================== */

img {
  max-width: 100%;
  height: auto;
  /* Scale images proportionally within their containers */
}

/* ==========================================================================
   NAVIGATION - Desktop: full nav, Mobile: hamburger menu
   ========================================================================== */

/* Desktop - show full navigation */
.nav-links {
  display: flex !important;
}

.nav-toggle {
  display: none !important;
}

.nav-cta {
  display: inline-flex !important;
}

/* ==========================================================================
   MOBILE NAVIGATION - Hamburger menu for phones
   ========================================================================== */

@media (max-width: 768px) {
  /* Hide desktop nav links and CTA button */
  .nav-links {
    display: none !important;
  }
  
  .nav-cta {
    display: none !important;
  }
  
  /* Show hamburger toggle */
  .nav-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: clamp(32px, 4vw, 44px);
    height: clamp(28px, 3.5vw, 38px);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    position: relative;
  }
  
  .nav-toggle span {
    display: block;
    width: clamp(20px, 3vw, 28px);
    height: 2px;
    background: #ffffff !important;
    border-radius: 2px;
    margin: clamp(2px, 0.4vw, 4px) 0;
    transition: all 0.3s ease;
    transform-origin: center;
  }
  
  /* Hamburger to X animation when drawer is open */
  .nav-toggle.active span:nth-child(1) {
    transform: translateY(calc(2px + clamp(2px, 0.4vw, 4px))) rotate(45deg);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: translateY(calc(-2px - clamp(2px, 0.4vw, 4px))) rotate(-45deg);
  }
  
  /* Mobile nav drawer styling */
  .nav-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: clamp(12px, 2vw, 20px) clamp(16px, 2.8vw, 48px);
    flex-direction: column;
    gap: clamp(8px, 1.2vw, 14px);
  }
  
  .nav-drawer a {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: clamp(13px, 1.8vw, 16px);
    padding: clamp(8px, 1vw, 12px) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.2s ease;
  }
  
  .nav-drawer a:last-child {
    border-bottom: none;
  }
  
  .nav-drawer a:hover {
    color: #ffffff !important;
  }
  
  .nav-drawer .btn.primary {
    margin-top: clamp(8px, 1vw, 12px);
    width: 100%;
    text-align: center;
    background: #ffffff;
    color: #000000;
  }
  
  /* Nav inner adjustments for mobile */
  .nav-inner {
    justify-content: space-between;
  }
  
  /* Hero adjustments for mobile */
  .hero {
    min-height: 100vh;
    min-height: 100svh;
  }
  
  /* Footer stays 2-column but scales */
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-bottom-bar {
    flex-direction: row;
    align-items: center;
  }
  
  .footer-legal {
    flex-wrap: nowrap;
  }
}

/* Very small phones - stack footer */
@media (max-width: 480px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: clamp(20px, 4vw, 40px);
  }
  
  .footer-right {
    justify-content: flex-start;
  }
  
  .footer-bottom-bar {
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
    align-items: flex-start;
  }
  
  .footer-legal {
    flex-wrap: wrap;
    gap: clamp(10px, 2vw, 16px);
  }
  
  /* CTA section stacks on very small screens */
  .cta .cta-inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: clamp(100px, 12.5vw, 200px) clamp(20px, 2.8vw, 48px) clamp(80px, 11vw, 180px) !important;
  }
  
  .hero-title {
    line-height: 1.08 !important;
    max-width: none !important;
  }
}

/* ==========================================================================
   VERY SMALL SCREENS - Minimum bounds to prevent unusability
   Below 320px, switch to minimum fixed sizes
   ========================================================================== */

@media (max-width: 320px) {
  html {
    font-size: 10px;
  }
  
  .hero-title {
    font-size: 20px !important;
  }
  
  .hero-sub {
    font-size: 11px !important;
  }
  
  .section h2 {
    font-size: 18px;
  }
}

/* ==========================================================================
   VERY LARGE SCREENS - Maximum bounds to prevent overly large text
   Above 2560px, cap the scaling
   ========================================================================== */

@media (min-width: 2560px) {
  html {
    font-size: 22px;
  }
}

/* ==========================================================================
   PRESERVE REDUCED MOTION PREFERENCES
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
