/* 
 * Chaodinator Design System 2025
 * 
 * A comprehensive design system implementing cutting-edge UI/UX patterns 
 * aligned with 2025 design trends, combining glassmorphism, spatial 
 * computing principles, and modern web capabilities.
 */

/* Define cascade layers for proper CSS architecture */
@layer reset, base, components, utilities;

/* Modern CSS Custom Properties with @property for animations */
@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --glow-x {
  syntax: '<percentage>';
  initial-value: 50%;
  inherits: false;
}

@property --blur-amount {
  syntax: '<length>';
  initial-value: 20px;
  inherits: false;
}

@property --spring-translate {
  syntax: "<length>";
  initial-value: 0px;
  inherits: false;
}

@property --spring-rotate {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* Base Design Tokens */
@layer base {

  /* Dark Mode (Default) - Sunset Dusk Theme */
  [data-theme="dark"],
  :root {
    /* Rich, deep gradient backgrounds */
    --bg-primary: linear-gradient(135deg, #2D1B2E, #4A2545, #6B2E5F);
    --bg-accent: linear-gradient(135deg, #4A2545, #6B2E5F, #8B3A62);

    /* Peachy-pink accents (vibrant against dark) */
    --accent-peach: #FFB3BA;
    --accent-coral: #FF8FA3;
    --accent-rose: #FFC4D0;
    --accent-sunset: #FF6B9D;
    --accent-teal: #4ECDC4;
    /* Complementary for special uses */
    --accent-purple: #9b59b6;
    /* Keep for backward compatibility */

    /* Glass effects optimized for dark backgrounds */
    --glass-white: rgba(255, 183, 186, 0.08);
    --glass-black: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 183, 186, 0.15);
    --glass-glow: rgba(255, 143, 163, 0.1);
    --glass-shadow: 0 8px 32px rgba(255, 107, 157, 0.15);
    --ambient-glow: 0 0 80px rgba(255, 183, 186, 0.3);

    /* Text hierarchy */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-on-accent: #2D1B2E;

    /* Dynamic Gradients */
    --gradient-aurora: linear-gradient(135deg,
        hsl(350, 100%, 88%),
        hsl(340, 100%, 85%),
        hsl(330, 80%, 82%));

    /* Vibrant CTA Gradients - Multi-stop for visual interest */
    --gradient-cta: linear-gradient(135deg,
        #FFB08E 0%,
        /* Warm peach-orange */
        #FF8FA3 25%,
        /* Coral-pink */
        #FF6B9D 50%,
        /* Hot pink */
        #C74375 75%,
        /* Deep magenta */
        #A8367F 100%
        /* Rich purple-pink */
      );

    --gradient-cta-hover: linear-gradient(135deg,
        #FFA07A 0%,
        /* Intensified peach */
        #FF7F94 25%,
        /* Intensified coral */
        #FF5A8D 50%,
        /* Intensified hot pink */
        #B73365 75%,
        /* Intensified magenta */
        #982670 100%
        /* Intensified purple */
      );

    /* Ambient Glow Colors */
    --glow-warm: hsl(350, 100%, 70%);
    --glow-cool: hsl(180, 70%, 70%);
    --glow-accent: hsl(340, 100%, 70%);

    /* Depth Shadows with warm glow */
    --shadow-near: 0 8px 32px rgba(255, 107, 157, 0.15);
    --shadow-far: 0 24px 60px rgba(255, 107, 157, 0.25);
    --shadow-glow: 0 0 40px rgba(255, 183, 186, 0.3);

    /* Typography */
    --font-display: "SF Pro Display", -apple-system, system-ui;
    --font-body: "SF Pro Text", -apple-system, system-ui;
    --font-mono: "SF Mono", ui-monospace, monospace;

    /* Optical Sizing */
    --font-size-adaptive: clamp(1rem, 2vw + 0.5rem, 1.25rem);
    --line-height-adaptive: calc(1em + 0.5vw);
  }

  /* Base body setup for spatial design */
  body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
  }

  /* Light Mode (Future) - Peachy Dream Theme */
  [data-theme="light"] {
    --bg-primary: linear-gradient(135deg, #FFE5CC, #FFB3BA, #FF8FA3);
    --bg-accent: linear-gradient(135deg, #FFDDD2, #FFC4D0, #FFACC5);

    --accent-peach: #FF8FA3;
    --accent-coral: #FF6B9D;
    --accent-rose: #E74C73;
    --accent-sunset: #C9184A;
    --accent-teal: #45B7AA;
    --accent-purple: #8E44AD;

    --glass-white: rgba(255, 255, 255, 0.6);
    --glass-black: rgba(255, 143, 163, 0.05);
    --glass-border: rgba(255, 143, 163, 0.2);
    --glass-glow: rgba(255, 107, 157, 0.08);

    --text-primary: #2D1B2E;
    --text-secondary: rgba(45, 27, 46, 0.85);
    --text-muted: rgba(45, 27, 46, 0.6);
    --text-on-accent: #FFFFFF;

    /* Same vibrant gradients for light mode */
    --gradient-cta: linear-gradient(135deg,
        #FFB08E 0%,
        #FF8FA3 25%,
        #FF6B9D 50%,
        #C74375 75%,
        #A8367F 100%);

    --gradient-cta-hover: linear-gradient(135deg,
        #FFA07A 0%,
        #FF7F94 25%,
        #FF5A8D 50%,
        #B73365 75%,
        #982670 100%);

    --shadow-near: 0 8px 32px rgba(255, 107, 157, 0.1);
    --shadow-far: 0 24px 60px rgba(255, 107, 157, 0.15);
    --shadow-glow: 0 0 40px rgba(255, 143, 163, 0.2);
  }
}

/* Floating Background Orbs - Pure CSS */
@layer base {

  body::before,
  body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
  }

  /* Option A: Matching Peachy Tones (Default) */
  body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at center, var(--accent-peach), transparent);
    top: -300px;
    left: -300px;
    animation-duration: 25s;
    opacity: 0.3;
    /* Reduced for subtlety */
  }

  body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at center, var(--accent-coral), transparent);
    bottom: -200px;
    right: -200px;
    animation-duration: 30s;
    animation-delay: -5s;
    opacity: 0.3;
    /* Reduced for subtlety */
  }

  /* Third orb using a utility class */
  .cds-orb {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle at center, var(--accent-rose), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    /* Reduced for subtlety */
    animation: float 35s ease-in-out infinite;
    animation-delay: -10s;
    pointer-events: none;
    z-index: -1;
  }

  /* Option B: Complementary Colors (Enable by adding class to body) */
  body.orbs-complementary::before {
    background: radial-gradient(circle at center, #4ECDC4, transparent);
  }

  body.orbs-complementary::after {
    background: radial-gradient(circle at center, #45B7AA, transparent);
  }

  body.orbs-complementary .cds-orb {
    background: radial-gradient(circle at center, #5AD3CC, transparent);
  }
}

/* Core Animations */
@layer base {
  @keyframes float {

    0%,
    100% {
      transform: translate(0, 0) scale(1);
    }

    25% {
      transform: translate(50px, -30px) scale(1.1);
    }

    50% {
      transform: translate(-30px, 50px) scale(0.95);
    }

    75% {
      transform: translate(30px, 30px) scale(1.05);
    }
  }

  @keyframes gradient-rotate {
    to {
      --gradient-angle: 360deg;
    }
  }

  @keyframes gradient-shift {
    0% {
      background-position: 0% 50%;
    }

    50% {
      background-position: 100% 50%;
    }

    100% {
      background-position: 0% 50%;
    }
  }

  @keyframes appear {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes ripple-animation {
    to {
      transform: scale(4);
      opacity: 0;
    }
  }
}

/* Glass Card Components */
@layer components {
  .cds-card-glass {
    /* Subtle glass effect like testimonial cards */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* Subtle border */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;

    /* Clean shadows without colored glows */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* Container queries */
    container-type: inline-size;

    /* Performance */
    will-change: transform, box-shadow;
    transform: translateZ(0);

    /* Transition setup */
    transition: all 0.3s ease;
    transform-style: preserve-3d;

    /* Positioning and layout */
    position: relative;
    overflow: hidden;
  }

  /* Static glass panel - no hover effects */
  .cds-card-glass.static {
    cursor: default;
  }

  /* Subtle overlay effect */
  .cds-card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1;
    border-radius: inherit;
  }

  /* Remove colored glow on hover */
  .cds-card-glass::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: none;
    transform: translate(-50%, -50%) scale(0);
    filter: blur(40px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    pointer-events: none;
    z-index: 0;
  }

  /* Subtle hover like testimonial cards - not applied to static cards */
  .cds-card-glass:not(.static):hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .cds-card-glass:not(.static):hover::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0.3;
  }

  /* Subtle focus state without colored glow */
  .cds-card-glass:focus-within {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
  }

  /* Content inside cards should be positioned above effects */
  .cds-card-glass>* {
    position: relative;
    z-index: 2;
  }
}

/* Unified CTA Button System with Vibrant Gradients */
@layer components {
  .cds-btn-cta {
    /* Base styling */
    position: relative;
    padding: 0.75rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    /* Vibrant multi-stop gradient */
    background: var(--gradient-cta);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: #FFFFFF;

    /* Enhanced glow with multiple colors */
    box-shadow:
      0 4px 20px rgba(255, 143, 163, 0.4),
      0 8px 30px rgba(199, 67, 117, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Animation setup */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;

    /* Prevent layout shift */
    will-change: transform, background-position;
    overflow: hidden;
  }

  /* Subtle shine effect */
  .cds-btn-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent);
    transition: left 0.6s ease;
  }

  /* Hover state with intensified gradient */
  .cds-btn-cta:hover {
    transform: translateY(-3px) scale(1.02);
    background: var(--gradient-cta-hover);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    box-shadow:
      0 6px 30px rgba(255, 143, 163, 0.5),
      0 12px 40px rgba(199, 67, 117, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  .cds-btn-cta:hover::before {
    left: 100%;
  }

  /* Active state */
  .cds-btn-cta:active {
    transform: translateY(-1px);
    box-shadow:
      0 2px 10px rgba(255, 143, 163, 0.4),
      0 4px 20px rgba(199, 67, 117, 0.3);
  }

  /* Size variants */
  .cds-btn-cta.small {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
  }

  .cds-btn-cta.large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
  }

  /* Secondary variant with glass effect */
  .cds-btn-cta.secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    box-shadow:
      0 2px 10px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .cds-btn-cta.secondary:hover {
    background: rgba(255, 183, 186, 0.15);
    border-color: var(--accent-peach);
    transform: translateY(-2px);
    box-shadow:
      0 4px 20px rgba(255, 143, 163, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

/* Spatial Button Components (Legacy) */
@layer components {
  .cds-btn-spatial {
    /* Base styling */
    position: relative;
    padding: 1rem 2.5rem;
    border-radius: 100px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;

    /* Glass background */
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);

    /* Depth layers */
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.1),
      0 4px 16px rgba(0, 0, 0, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Animation setup */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;

    /* Prevent layout shift */
    will-change: transform;
    overflow: hidden;
  }

  /* Ripple effect container */
  .cds-btn-spatial::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
  }

  /* Hover state with depth */
  .cds-btn-spatial:hover {
    transform: translateZ(5px) scale(1.05);
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.15),
      0 12px 48px rgba(0, 0, 0, 0.1),
      var(--shadow-glow);
  }

  /* Active state with ripple */
  .cds-btn-spatial:active::before {
    width: 300%;
    height: 300%;
  }

  /* Primary variant with peachy gradient */
  .cds-btn-spatial.primary {
    background: linear-gradient(135deg,
        var(--accent-peach),
        var(--accent-coral));
    color: var(--text-on-accent);
    border-color: rgba(255, 183, 186, 0.3);
    box-shadow: 0 4px 15px rgba(255, 143, 163, 0.3);
  }

  .cds-btn-spatial.primary:hover {
    background: linear-gradient(135deg,
        var(--accent-coral),
        var(--accent-sunset));
    box-shadow: 0 6px 25px rgba(255, 143, 163, 0.4);
  }

  /* Dark variant */
  .cds-btn-spatial.dark {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .cds-btn-spatial.dark:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateZ(5px) scale(1.05);
  }

  /* Button content should be above ripple effect */
  .cds-btn-spatial>* {
    position: relative;
    z-index: 1;
  }
}

/* Animated Gradient Text */
@layer components {
  .cds-text-gradient {
    background: var(--gradient-aurora);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
  }
}

/* Scroll Animations - CSS Only */
@layer components {

  /* Modern browser support with scroll-timeline */
  @supports (animation-timeline: view()) {
    .cds-reveal {
      opacity: 0;
      transform: translateY(30px);

      animation: appear linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }

    /* Staggered reveals */
    .cds-reveal:nth-child(1) {
      animation-range: entry 0% cover 25%;
    }

    .cds-reveal:nth-child(2) {
      animation-range: entry 5% cover 30%;
    }

    .cds-reveal:nth-child(3) {
      animation-range: entry 10% cover 35%;
    }

    .cds-reveal:nth-child(4) {
      animation-range: entry 15% cover 40%;
    }
  }

  /* Fallback for browsers without scroll-timeline support */
  @supports not (animation-timeline: view()) {
    .cds-reveal {
      opacity: 1;
      transform: none;
      transition: opacity 0.6s ease, transform 0.6s ease;
    }

    /* Simple intersection-based reveals using CSS animations */
    .cds-reveal.visible {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Container Query System */
@layer components {
  .cds-container-responsive {
    container-type: inline-size;
    container-name: main;
  }

  /* Container-based responsive cards */
  @container main (min-width: 400px) {
    .cds-card-glass {
      padding: 2rem;
    }
  }

  @container main (min-width: 700px) {
    .cds-card-glass {
      padding: 3rem;
    }
  }
}

/* Performance Optimization Layer */
@layer base {

  /* GPU acceleration for all animated elements */
  .cds-card-glass,
  .cds-btn-spatial,
  .cds-reveal {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
  }

  /* CSS Containment for performance */
  .cds-card-glass {
    contain: layout style paint;
  }

  /* Spring physics elements */
  .cds-spring-element {
    transform: translateY(var(--spring-translate)) rotate(var(--spring-rotate));
    transition: --spring-translate 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55),
      --spring-rotate 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }

  .cds-spring-element:hover {
    --spring-translate: -10px;
    --spring-rotate: 2deg;
  }
}

/* Accessibility Layer */
@layer base {

  /* Respect 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;
      scroll-behavior: auto !important;
    }

    /* Keep essential feedback */
    .cds-btn-spatial:hover,
    .cds-card-glass:hover {
      transform: none;
      opacity: 0.8;
    }

    /* Disable floating orbs */
    body::before,
    body::after,
    .cds-orb {
      display: none;
    }
  }

  /* Motion intensity levels */
  [data-motion="reduced"] * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
  }

  [data-motion="minimal"] * {
    animation-duration: 0.5s !important;
    transition-duration: 0.2s !important;
  }

  /* Modern focus styles */
  :focus-visible {
    outline: 2px solid var(--glow-accent);
    outline-offset: 4px;
    border-radius: 4px;
  }

  /* Glass-appropriate focus */
  .cds-card-glass:focus-visible,
  .cds-btn-spatial:focus-visible {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.2),
      0 0 0 4px var(--glow-accent),
      var(--shadow-glow);
    outline: none;
  }
}

/* Mobile optimizations */
@layer base {
  @media (max-width: 768px) {
    .cds-orb {
      display: none;
    }

    /* Mobile hero text alignment */
    .cds-hero-content {
      text-align: center !important;
      align-items: center;
      display: flex;
      flex-direction: column;
    }

    .cds-hero-content h1 {
      text-align: center;
    }

    .cds-hero-content p {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
    }

    .cds-hero-content a {
      margin-left: auto;
      margin-right: auto;
      justify-content: center;
    }

    .cds-card-glass {
      border-radius: 16px;
    }

    .cds-btn-spatial {
      padding: 0.875rem 2rem;
    }
  }
}



/* Input Field Enhancements */
@layer components {

  /* Glass input fields */
  .cds-input {
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .cds-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(155, 89, 182, 0.5);
    box-shadow:
      0 0 0 2px rgba(155, 89, 182, 0.2),
      var(--shadow-near);
    outline: none;
  }

  .cds-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
  }
}

/* Floating Widgets */
@layer components {
  .cds-floating-widget {
    position: fixed;
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    z-index: 100;
    transition: all 0.3s ease;
    cursor: move;
  }

  .cds-widget-1 {
    top: 150px;
    right: 50px;
    animation: float-widget 15s ease-in-out infinite;
  }

  .cds-widget-2 {
    top: 120px;
    right: 50px;
    animation: float-widget 20s ease-in-out infinite reverse;
  }

  /* Signup counter widget styling */
  .cds-signup-counter {
    background: linear-gradient(135deg, var(--glass-white), rgba(78, 205, 196, 0.05));
    border: 1px solid rgba(78, 205, 196, 0.2);
    transition: all 0.3s ease;
  }

  /* Urgency-based styling */
  .cds-urgency-icon {
    font-size: 1.2rem;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
  }

  .cds-urgency-title {
    color: var(--text-primary);
  }

  .cds-urgency-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 0.25rem;
  }

  /* Normal availability (100+ spots) */
  .cds-urgency-normal .cds-urgency-message {
    color: var(--accent-teal);
  }

  /* Low urgency (50-99 spots) */
  .cds-urgency-low {
    background: linear-gradient(135deg, var(--glass-white), rgba(255, 183, 186, 0.05));
    border-color: rgba(255, 183, 186, 0.2);
  }

  .cds-urgency-low .cds-urgency-message {
    color: var(--accent-peach);
  }

  /* Medium urgency (25-49 spots) */
  .cds-urgency-medium {
    background: linear-gradient(135deg, var(--glass-white), rgba(255, 143, 163, 0.08));
    border-color: rgba(255, 143, 163, 0.3);
  }

  .cds-urgency-medium .cds-urgency-message {
    color: var(--accent-coral);
    animation: subtle-pulse 3s ease-in-out infinite;
  }

  /* High urgency (12-24 spots) */
  .cds-urgency-high {
    background: linear-gradient(135deg, rgba(255, 143, 163, 0.1), rgba(255, 107, 157, 0.15));
    border-color: var(--accent-sunset);
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.2);
  }

  .cds-urgency-high .cds-urgency-message {
    color: var(--accent-sunset);
    font-weight: 700;
    animation: subtle-pulse 2s ease-in-out infinite;
  }

  /* Critical urgency (< 12 spots) */
  .cds-urgency-critical {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(199, 67, 117, 0.2));
    border: 2px solid var(--accent-sunset);
    box-shadow: 0 0 40px rgba(255, 107, 157, 0.3);
  }

  .cds-urgency-critical .cds-urgency-message {
    color: #FF4458;
    font-weight: 700;
    animation: urgent-pulse 1.5s ease-in-out infinite;
  }

  .cds-urgency-critical .cds-urgency-icon {
    animation: shake 0.5s ease-in-out infinite;
  }

  /* Extreme urgency (last spot) */
  .cds-urgency-extreme {
    background: linear-gradient(135deg, rgba(255, 68, 88, 0.2), rgba(199, 67, 117, 0.25));
    border: 2px solid #FF4458;
    box-shadow:
      0 0 50px rgba(255, 68, 88, 0.4),
      inset 0 0 20px rgba(255, 68, 88, 0.1);
  }

  .cds-urgency-extreme .cds-urgency-message {
    color: #FF4458;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1rem;
    animation: extreme-pulse 1s ease-in-out infinite;
  }

  .cds-urgency-extreme .cds-urgency-icon {
    animation: alarm 0.3s ease-in-out infinite;
  }

  /* Waitlist mode */
  .cds-urgency-waitlist {
    background: linear-gradient(135deg, var(--glass-white), rgba(155, 89, 182, 0.05));
    border-color: var(--accent-purple);
  }

  .cds-urgency-waitlist .cds-urgency-message {
    color: var(--accent-purple);
    font-style: italic;
  }

  /* Animations for urgency states */
  @keyframes subtle-pulse {

    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0.85;
    }
  }

  @keyframes urgent-pulse {

    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }

    50% {
      opacity: 0.9;
      transform: scale(1.02);
    }
  }

  @keyframes extreme-pulse {

    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }

    50% {
      opacity: 0.85;
      transform: scale(1.05);
    }
  }

  @keyframes shake {

    0%,
    100% {
      transform: translateX(0);
    }

    25% {
      transform: translateX(-2px) rotate(-5deg);
    }

    75% {
      transform: translateX(2px) rotate(5deg);
    }
  }

  @keyframes alarm {

    0%,
    100% {
      transform: rotate(-10deg) scale(1);
    }

    50% {
      transform: rotate(10deg) scale(1.1);
    }
  }

  @keyframes bounce {

    0%,
    100% {
      transform: translateY(0);
    }

    50% {
      transform: translateY(-3px);
    }
  }

  .cds-counter-number {
    font-weight: 700;
    color: var(--accent-teal);
    font-size: 1.1rem;
    animation: pulse-glow 2s ease-in-out infinite;
  }

  @keyframes pulse-glow {

    0%,
    100% {
      text-shadow: 0 0 5px rgba(78, 205, 196, 0.5);
    }

    50% {
      text-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
    }
  }

  @keyframes float-widget {

    0%,
    100% {
      transform: translateY(0) rotate(0deg);
    }

    25% {
      transform: translateY(-10px) rotate(1deg);
    }

    75% {
      transform: translateY(10px) rotate(-1deg);
    }
  }
}

/* 3D Card Effects */
@layer components {
  .cds-card-3d-container {
    perspective: 1000px;
    transform-style: preserve-3d;
  }

  .cds-card-3d {
    /* Match testimonial card styling */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: none;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }

  .cds-card-3d:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  .cds-card-3d h3,
  .cds-card-3d p,
  .cds-card-3d ul {
    position: relative;
    z-index: 2;
  }
}

/* Testimonial Cards with Avatars */
@layer components {
  .cds-testimonial-card {
    background: linear-gradient(135deg, var(--glass-white), rgba(255, 215, 0, 0.05));
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .cds-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
  }

  .cds-rating {
    color: #ffd700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
}

/* Animated Testimonial Carousel */
@layer components {
  .cds-carousel-row {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0.75rem 0;
    mask-image: linear-gradient(to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%);
    -webkit-mask-image: linear-gradient(to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%);
  }

  .cds-carousel-track {
    display: flex;
    gap: 1.5rem;
    width: fit-content;
    padding: 0.25rem 0;
  }

  /* Only animate if user hasn't requested reduced motion */
  @media (prefers-reduced-motion: no-preference) {
    .cds-carousel-left {
      animation: scrollLeft 40s linear infinite;
    }

    .cds-carousel-right {
      animation: scrollRight 40s linear infinite;
    }
  }

  /* Static layout for users who prefer reduced motion */
  @media (prefers-reduced-motion: reduce) {

    .cds-carousel-left,
    .cds-carousel-right {
      animation: none;
      transform: translateX(0);
    }
  }

  @keyframes scrollLeft {
    0% {
      transform: translateX(0);
    }

    100% {
      transform: translateX(-50%);
    }
  }

  @keyframes scrollRight {
    0% {
      transform: translateX(-50%);
    }

    100% {
      transform: translateX(0);
    }
  }

  .cds-testimonial-card-carousel {
    flex-shrink: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
  }

  .cds-testimonial-card-carousel:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10;
  }

  .cds-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
  }

  /* Pause on hover - only if animations are enabled */
  @media (prefers-reduced-motion: no-preference) {
    .cds-carousel-row:hover .cds-carousel-track {
      animation-play-state: paused;
    }
  }

  /* Mobile adjustments */
  @media (max-width: 768px) {
    .cds-testimonial-card-carousel {
      width: 280px;
    }

    .cds-carousel-left {
      animation-duration: 30s;
    }

    .cds-carousel-right {
      animation-duration: 30s;
    }
  }
}

/* Ripple Effect */
@layer components {
  .cds-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
  }
}

/* Enhanced Form Inputs */
@layer components {
  .cds-input-enhanced {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
  }

  .cds-input-enhanced:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
  }

  .cds-textarea-enhanced {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    resize: vertical;
    font-family: inherit;
  }

  .cds-textarea-enhanced:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
  }
}

/* Magnetic Hover Animation */
@layer components {
  @keyframes magnetic-pull {

    0%,
    100% {
      transform: translate(0, 0) rotate(0deg);
    }

    25% {
      transform: translate(2px, -2px) rotate(1deg);
    }

    75% {
      transform: translate(-2px, 2px) rotate(-1deg);
    }
  }

  .cds-magnetic:hover .cds-icon {
    animation: magnetic-pull 0.8s ease-in-out;
  }
}

/* Shimmer Text Effect */
@layer components {
  .cds-text-shimmer {
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
  }

  @keyframes shimmer {

    0%,
    100% {
      background-position: 0% 50%;
    }

    50% {
      background-position: 100% 50%;
    }
  }
}

/* Sticky Navigation Bar with Scroll Transformation */
@layer components {
  .cds-navbar {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 2rem);
    /* Same as hero's px-4 on each side */
    max-width: 1280px;
    /* Matches max-w-7xl exactly */
    padding: 1.25rem 0;
    /* Initial state: completely transparent */
    background: rgba(45, 27, 46, 0);
    backdrop-filter: blur(0px) saturate(100%);
    border: 1px solid rgba(255, 183, 186, 0);
    border-radius: 20px;
    box-shadow: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Mobile also starts completely transparent */
  @media (max-width: 768px) {
    .cds-navbar {
      width: calc(100% - 2rem);
      max-width: none;
      background: rgba(45, 27, 46, 0);
      backdrop-filter: blur(0px) saturate(100%);
      border: 1px solid rgba(255, 183, 186, 0);
      box-shadow: none;
    }
  }

  /* Scrolled state - dark glass with peachy tint */
  .cds-navbar-scrolled {
    width: calc(100% - 4rem);
    max-width: 896px;
    /* Matches max-w-4xl two-card layout width */
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg,
        rgba(45, 27, 46, 0.92),
        rgba(74, 37, 69, 0.88));
    backdrop-filter: blur(24px) saturate(200%);
    border-color: var(--glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 80px rgba(255, 183, 186, 0.1);
  }

  .cds-navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    /* Add padding here instead of on navbar */
  }

  .cds-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
  }

  .cds-navbar-brand:hover {
    opacity: 0.9;
  }

  .cds-navbar-fire {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
  }

  /* Navbar CTA uses the primary button style */
  .cds-navbar .cds-btn-spatial {
    /* Navbar-specific adjustments for smaller size */
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
  }

  /* Hide extended CTA text on mobile */
  .cds-navbar-cta-extended {
    display: inline;
  }

  /* Ensure proper spacing for the short text on desktop */
  .cds-navbar-cta-text {
    margin-right: 0.25rem;
  }

  /* Mobile Responsive */
  @media (max-width: 768px) {
    .cds-navbar {
      top: 1rem;
      width: calc(100% - 2rem);
      padding: 0.875rem 1.25rem;
      border-radius: 16px;
    }

    /* Adjusted scrolled state for mobile */
    .cds-navbar-scrolled {
      width: calc(100% - 3rem);
      max-width: none;
      padding: 0.75rem 1rem;
      background: linear-gradient(135deg,
          rgba(45, 27, 46, 0.9),
          rgba(74, 37, 69, 0.85));
      backdrop-filter: blur(20px) saturate(180%);
      border-color: var(--glass-border);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    .cds-navbar-brand {
      font-size: 1.1rem;
    }

    .cds-navbar-fire {
      font-size: 1.25rem;
    }

    .cds-navbar-cta {
      padding: 0.4rem 1rem;
      font-size: 0.9rem;
    }

    /* Hide the extended text on mobile */
    .cds-navbar-cta-extended {
      display: none;
    }

    /* Ensure proper spacing for the short text */
    .cds-navbar-cta-text {
      margin-right: 0;
    }
  }
}

/* Section Spacing System */
@layer utilities {

  /* Consistent section spacing for visual hierarchy */
  .cds-section-spacing-lg {
    padding-top: 7.5rem;
    padding-bottom: 7.5rem;
  }

  .cds-section-spacing {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  .cds-section-spacing-sm {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  /* Mobile responsive spacing */
  @media (max-width: 768px) {
    .cds-section-spacing-lg {
      padding-top: 5rem;
      padding-bottom: 5rem;
    }

    .cds-section-spacing {
      padding-top: 4rem;
      padding-bottom: 4rem;
    }

    .cds-section-spacing-sm {
      padding-top: 3rem;
      padding-bottom: 3rem;
    }
  }

}

/* Utility Classes */
@layer utilities {
  .cds-glass-panel {
    background: var(--glass-white);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
  }

  .cds-depth-near {
    box-shadow: var(--shadow-near);
  }

  .cds-depth-far {
    box-shadow: var(--shadow-far);
  }

  .cds-depth-glow {
    box-shadow: var(--shadow-glow);
  }

  .cds-gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
  }

  .cds-contained {
    contain: layout style paint;
  }

  .cds-text-primary {
    color: var(--text-primary);
  }

  .cds-text-secondary {
    color: var(--text-secondary);
  }
}

/* Selection Colors */
@layer components {

  /* Global selection colors */
  ::selection {
    background-color: rgba(155, 89, 182, 0.3);
    color: var(--text-primary);
  }

  ::-moz-selection {
    background-color: rgba(155, 89, 182, 0.3);
    color: var(--text-primary);
  }

  /* Success context selection colors (green tint) */
  .cds-success-highlight ::selection,
  .cds-success-highlight input::selection,
  .cds-success-highlight *::selection {
    background-color: rgba(34, 197, 94, 0.3);
    color: var(--text-primary);
  }

  .cds-success-highlight ::-moz-selection,
  .cds-success-highlight input::-moz-selection,
  .cds-success-highlight *::-moz-selection {
    background-color: rgba(34, 197, 94, 0.3);
    color: var(--text-primary);
  }
}

/* Success Animation Components */
@layer components {

  /* Success glow animation for form submissions */
  .cds-success-glow {
    position: relative;
    animation: success-glow 2.5s ease-out;
  }

  /* Permanent success highlight - no animation, just static glow */
  .cds-success-highlight {
    position: relative;
    box-shadow:
      0 0 30px 10px rgba(34, 197, 94, 0.4),
      0 0 60px 20px rgba(34, 197, 94, 0.2),
      inset 0 0 0 3px rgba(34, 197, 94, 0.8) !important;
    border: 2px solid rgba(34, 197, 94, 0.5) !important;
  }

  /* Ensure the green glow is visible even with other classes */
  .cds-card-glass.cds-success-highlight {
    box-shadow:
      0 0 30px 10px rgba(34, 197, 94, 0.4),
      0 0 60px 20px rgba(34, 197, 94, 0.2),
      inset 0 0 0 3px rgba(34, 197, 94, 0.8) !important;
    border: 2px solid rgba(34, 197, 94, 0.5) !important;
  }

  /* Disable focus glow on parent containers */
  .no-focus-glow:focus-within {
    box-shadow: none !important;
  }

  /* Override parent glass card focus styles when this class is present */
  .cds-card-glass.no-focus-glow:focus-within {
    box-shadow: var(--shadow-far) !important;
  }

  /* Prevent focus glow on waitlist container when success view is present */
  #waitlist-form-container:has(.no-focus-glow) {
    pointer-events: none;
  }

  #waitlist-form-container .no-focus-glow {
    pointer-events: auto;
  }

  /* Disable focus-within on the parent card when success is shown */
  .cds-card-glass:has(#success-container):focus-within {
    box-shadow: var(--shadow-far) !important;
  }

  /* Green success outline animation */
  @keyframes success-glow {
    0% {
      box-shadow:
        0 0 0 0 rgba(34, 197, 94, 0),
        0 0 0 0 rgba(34, 197, 94, 0),
        inset 0 0 0 2px rgba(34, 197, 94, 0);
    }

    10% {
      box-shadow:
        0 0 20px 5px rgba(34, 197, 94, 0.3),
        0 0 40px 10px rgba(34, 197, 94, 0.2),
        inset 0 0 0 2px rgba(34, 197, 94, 1);
    }

    40% {
      box-shadow:
        0 0 30px 10px rgba(34, 197, 94, 0.4),
        0 0 60px 20px rgba(34, 197, 94, 0.2),
        inset 0 0 0 3px rgba(34, 197, 94, 1);
    }

    70% {
      box-shadow:
        0 0 25px 8px rgba(34, 197, 94, 0.3),
        0 0 50px 15px rgba(34, 197, 94, 0.15),
        inset 0 0 0 2px rgba(34, 197, 94, 0.8);
    }

    100% {
      box-shadow:
        0 0 0 0 rgba(34, 197, 94, 0),
        0 0 0 0 rgba(34, 197, 94, 0),
        inset 0 0 0 2px rgba(34, 197, 94, 0);
    }
  }

  /* Alternative pulse animation for sustained success state */
  .cds-success-pulse {
    animation: success-pulse 2s ease-in-out infinite;
  }

  @keyframes success-pulse {

    0%,
    100% {
      box-shadow:
        0 0 0 0 rgba(34, 197, 94, 0.4),
        inset 0 0 0 2px rgba(34, 197, 94, 0.5);
    }

    50% {
      box-shadow:
        0 0 20px 10px rgba(34, 197, 94, 0.2),
        inset 0 0 0 2px rgba(34, 197, 94, 1);
    }
  }

  /* Success check animation for inline confirmations */
  .cds-success-check {
    color: #22c55e;
    animation: success-check 0.4s ease-out;
  }

  @keyframes success-check {
    0% {
      transform: scale(0) rotate(-45deg);
      opacity: 0;
    }

    50% {
      transform: scale(1.2) rotate(5deg);
    }

    100% {
      transform: scale(1) rotate(0);
      opacity: 1;
    }
  }
}

/* ===== INTERACTIVE MOCKUP ANIMATIONS ===== */
/* Animation styles for the interactive braindump-to-focus demonstration */

.mockup-task-item {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(5px);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, border-color 0.3s ease-in-out;
  opacity: 1;
  transform: translateY(0);
}

.mockup-task-item.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.mockup-task-item.is-completed {
  opacity: 0.4;
  border-left-color: rgba(74, 222, 128, 0.5);
}

.mockup-task-item.is-completed .task-text-line-1 {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.mockup-task-item .task-text-line-1 {
  height: 0.5rem;
  background-color: rgba(209, 213, 219, 0.2);
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  transition: all 0.5s ease-in-out;
}

.mockup-task-item .task-text-line-2 {
  height: 0.5rem;
  background-color: rgba(209, 213, 219, 0.1);
  border-radius: 0.25rem;
  transition: all 0.5s ease-in-out;
}

/* Processing indicator animation */
#mockup-processing {
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1), transparent);
}

#mockup-processing svg {
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
}

/* Header text transitions */
#mockup-header-text {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* Energy level animation */
.energy-bar {
  transition: background 0.5s ease-in-out, width 0.5s ease-in-out;
}

.energy-bar.active {
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.6), rgba(34, 197, 94, 0.8));
}