html {
    scroll-padding-top: 120px;
}

/* Custom Font Setup */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #09090b; /* zinc-950 */
    color: #f4f4f5; /* zinc-100 */
    overflow-x: hidden;
}

html {
    scroll-padding-top: 120px;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
:root {
    /* Inner shadow */
    --shadow-offset: 0;
    --shadow-blur: 20px;
    --shadow-spread: -5px;
    --shadow-color: rgba(52, 211, 153, 0.4); /* emerald-400 equivalent */

    /* Painted glass */
    --tint-color: 255, 255, 255;
    --tint-opacity: 0.4;

    /* Background frost */
    --frost-blur: 4px;

    /* SVG noise/distortion */
    --noise-frequency: 0.008;
    --distortion-strength: 77;

    /* Outer shadow blur */
    --outer-shadow-blur: 24px;
}

.glass-nav {
    position: relative;
    /* We don't need fixed width/height here as it's handled by Tailwind classes */
    isolation: isolate;
    box-shadow: 0px 6px var(--outer-shadow-blur) rgba(0, 0, 0, 0.2);
    /* Ensure it has a background for the tint to work */
    background: transparent; 
}

.glass-nav::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1; /* Behind the content */
    border-radius: 9999px; /* rounded-full equivalent */
    box-shadow:
        inset var(--shadow-offset) var(--shadow-offset) var(--shadow-blur) var(--shadow-spread) var(--shadow-color);
    background-color: rgba(var(--tint-color), 0.1); /* Reduced tint opacity for nav */
}

.glass-nav::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2; /* Behind the before element */
    border-radius: 9999px; /* rounded-full equivalent */
    backdrop-filter: blur(var(--frost-blur));
    filter: url(#glass-distortion);
    isolation: isolate;
    -webkit-backdrop-filter: blur(var(--frost-blur));
    -webkit-filter: url("#glass-distortion");
}

.glass-card {
    background: rgba(39, 39, 42, 0.4); /* zinc-800/40 */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

/* Reflective Card Effect */
.reflective-card {
    position: relative;
    overflow: hidden;
    background-color: rgba(24, 24, 27, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s;
}

.reflective-card::before {
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 2;
}

.reflective-card:hover::before {
    opacity: 1;
}

.reflective-card:hover {
    border-color: rgba(52, 211, 153, 0.3); /* emerald-400/30 */
}

/* Magic Bento Grid Layouts */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(180px, auto);
    }
    .bento-span-2 {
        grid-column: span 2;
    }
    .bento-row-span-2 {
        grid-row: span 2;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Mobile Menu */
.mobile-menu-overlay {
    visibility: hidden;
}

.mobile-menu-overlay.open {
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-overlay.open .mobile-menu-backdrop {
    opacity: 1;
}

.mobile-menu-overlay.open .mobile-menu-content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Staggered link animation */
.mobile-nav-item {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, color 0.2s ease;
}

.mobile-menu-overlay.open .mobile-nav-item {
    opacity: 1;
    transform: translateY(0);
    transition-delay: var(--delay, 0s);
}

/* Active state for touch feedback */
.mobile-nav-item:active {
    transform: scale(0.98);
}

/* Phone Mockup & Hero Animations */
.phone-mockup {
    box-shadow: 0 0 0 8px #18181b, 0 0 0 10px #27272a, 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Larger phone frame on tablet and up */
@media (min-width: 640px) {
    .phone-mockup {
        box-shadow: 0 0 0 12px #18181b, 0 0 0 14px #27272a, 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}

/* Hero phone mockup - optimized for mobile */
.phone-mockup-hero {
    /* Subtle inner glow for premium feel */
    position: relative;
}

.phone-mockup-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
    top: 0;
    left: 0;
    animation: scan 2s ease-in-out infinite;
    opacity: 0;
}

@keyframes scan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Hero glow - reduced intensity on mobile for performance and aesthetics */
.hero-glow {
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
}

@media (min-width: 640px) {
    .hero-glow {
        background: radial-gradient(circle at center, rgba(16, 185, 129, 0.12) 0%, transparent 65%);
    }
}

@media (min-width: 768px) {
    .hero-glow {
        background: radial-gradient(circle at center, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    }
}

/* Hero CTA button - enhanced mobile touch feedback */
.hero-cta {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.hero-cta:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Utility Helpers */
.text-gradient {
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-accent {
    background: linear-gradient(to right, #34d399, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hide/Show logic for SPA */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* Clerk Waitlist Styling */
#clerk-waitlist {
    width: 100%;
    max-width: 100%;
}

#clerk-waitlist > div,
#clerk-waitlist .cl-rootBox,
#clerk-waitlist .cl-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Match Pro Annual Card Styling */
#clerk-waitlist .cl-card {
    background-color: rgba(6, 78, 59, 0.2) !important; /* bg-emerald-900/10 equivalent mixed with glass */
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important; /* emerald-500/30 */
    border-radius: 1.5rem !important; /* rounded-3xl */
    box-shadow: none !important;
}

#clerk-waitlist .cl-headerTitle {
    font-family: 'Inter', sans-serif !important;
    color: #ffffff !important;
}

#clerk-waitlist .cl-headerSubtitle {
    font-family: 'Inter', sans-serif !important;
    color: #a1a1aa !important; /* zinc-400 */
}

#clerk-waitlist .cl-formFieldInput {
    background-color: rgba(9, 9, 11, 0.6) !important; /* zinc-950/60 */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 0.75rem !important; /* rounded-xl */
}

#clerk-waitlist .cl-formButtonPrimary {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-weight: 600 !important;
    border-radius: 0.75rem !important; /* rounded-xl */
    box-shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
}

#clerk-waitlist .cl-formButtonPrimary:hover {
    background-color: #e4e4e7 !important; /* zinc-200 */
    transform: translateY(-1px) !important;
}

#clerk-waitlist .cl-footer {
    background-color: rgba(6, 78, 59, 0.2) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    border-radius: 1.5rem !important;
    box-shadow: none !important;
    margin-top: 1rem !important;
    padding: 1rem !important;
}

#clerk-waitlist .cl-footerAction,
#clerk-waitlist .cl-internal-b3fm6y {
    background: transparent !important;
    box-shadow: none !important;
}

/* Remove any hard edges from Clerk's internal wrappers */
#clerk-waitlist [class*="cl-internal"] {
    box-shadow: none !important;
}

#clerk-waitlist .cl-footerActionLink {
    color: #34d399 !important; /* emerald-400 */
}

#clerk-waitlist .cl-footerActionText {
    color: #a1a1aa !important; /* zinc-400 */
}

/* 3D Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px) perspective(1000px) rotateX(10deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0) perspective(1000px) rotateX(0deg);
}

/* Reveal from left */
.reveal-left {
    opacity: 0;
    transform: translateX(-60px) perspective(1000px) rotateY(8deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0) perspective(1000px) rotateY(0deg);
}

/* Reveal from right */
.reveal-right {
    opacity: 0;
    transform: translateX(60px) perspective(1000px) rotateY(-8deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0) perspective(1000px) rotateY(0deg);
}

/* Scale up reveal */
.reveal-scale {
    opacity: 0;
    transform: scale(0.9) perspective(1000px) rotateX(5deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1) perspective(1000px) rotateX(0deg);
}

/* Staggered children animation */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-stagger > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
