/* Hero Section Styles */
#hero {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-hero);
    /* Use stable viewport height to avoid reflow when mobile UI shows/hides */
    min-height: 100vh;
    /* fallback for older browsers */
    height: 100svh;
    /* stable viewport height (small viewport) */
    height: 100dvh;
    /* prefer dynamic viewport to follow address bar show/hide */
    display: flex;
    align-items: center;
    padding: 4rem 0 4rem;
    /* small top gap under fixed nav, centered to full viewport */
}

.hero-content {
    opacity: 0;
    position: relative;
    z-index: 10;
    padding: 4rem 3rem;
    /* generous internal spacing */
    width: 54%;
    max-width: 800px;
    margin-left: 10%;
    border-radius: 1.375rem;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Class to trigger fade-in animation */
.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.background-shapes {
    opacity: 0;
    transition: opacity 0.05s linear;
    contain: layout paint;
    /* other props inherited from core/components.css */
}

/* Softening overlay above shapes (keeps shapes visible, reduces visual noise) */
.hero-soften {
    position: absolute;
    inset: 0;
    z-index: 2;
    /* above shapes (z:1), below hero content (z:10) */
    pointer-events: none;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.00) 40%,
            rgba(255, 255, 255, 0.08) 100%);
}

[data-theme="dark"] .hero-soften {
    background: linear-gradient(180deg,
            rgba(15, 23, 42, 0.2) 0%,
            rgba(15, 23, 42, 0.00) 40%,
            rgba(15, 23, 42, 0.3) 100%);
}

/* For non-mobile devices, show shapes immediately when .shapes-loaded is present */
@media (min-width: 769px) {
    .shapes-loaded .background-shapes {
        transition: none;
    }
}

/* .shape is in core/components.css */


.shape-1 {
    top: 30%;
    right: 15%;
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #6b46c1, #00c6ff);
    border-radius: 50%;
}

.shape-2 {
    top: 57%;
    right: 25%;
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #00c6ff, #6b46c1);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.shape-3 {
    bottom: 7%;
    right: 35%;
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, #6b46c1, #00c6ff);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

/* Refined glass only for the hero card to avoid impacting nav/cards */
.hero-content.glass-effect {
    background: rgba(255, 255, 255, 0.58);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 24px rgba(17, 24, 39, 0.08),
        0 2px 8px rgba(17, 24, 39, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .hero-content.glass-effect {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 24px var(--glass-shadow),
        0 2px 8px rgba(17, 24, 39, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-content.glass-effect::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Hero typography and spacing (keep font sizes the same) */
.hero-content h1 {
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    /* tighten slightly for hierarchy */
}

/* Subtle hero kicker style (uppercase, thin, tracked) */
.hero-kicker {
    font-size: 0.8125rem;
    /* 13px */
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    /* slate-500 */
    font-weight: 400;
    /* thinner tone with Poppins */
    margin-bottom: 0.375rem;
    /* ~6px */
}

.hero-content .hero-lead {
    color: var(--text-secondary);
    /* gray-600: refined, less heavy */
    line-height: 1.6;
    /* slightly tighter for density */
    letter-spacing: -0.005em;
    /* subtle tightening */
    margin-bottom: 2.25rem;
    /* 36px loose gap before form */
}

/* When the form is hidden, tighten lead→CTA spacing for better grouping */
.hero-content.form-hidden .hero-lead {
    margin-bottom: 0.875rem;
    /* ~14px on mobile */
}

@media (min-width: 768px) {
    .hero-content.form-hidden .hero-lead {
        margin-bottom: 1rem;
        /* 16px on md+ */
    }
}

.hero-content .hero-form {
    margin-top: 0;
    /* spacing controlled by .hero-lead margin-bottom */
}

.hero-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 1rem;
    row-gap: 0.85rem;
    margin-top: 0;
}

.hero-secondary-link {
    white-space: nowrap;
}

@media (min-width: 768px) {
    .hero-cta-row {
        align-items: baseline;
        justify-content: flex-start;
        column-gap: 1.25rem;
        margin-top: 0;
    }
}

/* Hero form grid layout */
#hero-form {
    display: grid;
    /* reinforce Tailwind grid in case classes change */
    grid-template-columns: 1fr;
    /* stack on mobile */
}

/* Allow inputs to shrink within grid columns without forcing overflow */
#hero-form input[type="url"],
#hero-form input[type="email"],
#hero-form input[type="text"] {
    min-width: 0;
}

/* Prevent CTA text wrapping and align items on wider viewports */
#hero-form button {
    white-space: nowrap;
}

@media (min-width: 768px) {
    #hero-form {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
        /* URL wider, then email, then auto-sized CTA */
        align-items: center;
    }
}

/* Center disclaimer under the form */
.hero-content .hero-disclaimer {
    text-align: center;
    margin-top: 0.75rem;
    /* ~12px tight gap after form */
}

/* Three.js and Particle Canvas Styles */
#three-container,
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#three-container {
    z-index: 1;
    /* Above background, below content */
    pointer-events: auto;
    /* Enable interaction */
}

#particle-canvas {
    z-index: 0;
    pointer-events: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    :root {
        --nav-h: 56px;
    }

    /* approximate mobile nav height */
    .hero-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 2.5rem 1.5rem;
        /* slight bump on mobile too */
        border-radius: 1.5rem;
        box-shadow: 0 8px 22px rgba(17, 24, 39, 0.08);
        transform: translateY(10px);
        /* gentle downward nudge for optical centering */
    }

    /* Preserve the offset after fade-in specifically for the hero card */
    .hero-content.fade-in {
        transform: translateY(10px);
    }

    #hero {
        /* Full visible viewport height on mobile for true full-screen hero */
        height: 100svh;
        min-height: 0;
        /* prevent base min-height from forcing extra space */
        padding-top: 2rem;
        padding-bottom: 2rem;
        /* symmetrical padding to keep hero centered */
    }

    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .gradient-text {
        font-size: 2rem;
    }

    p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .shape {
        transform: scale(0.7);
    }

    #pricing {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .pricing-card {
        margin-bottom: 2rem;
    }
}

/* Desktop-only negative margin */
@media (min-width: 769px) {
    .hero-content {
        margin-top: 0;
    }
}

/* md+ spacing: unified py-28 across all sections */
@media (min-width: 768px) {
    #product {
        padding: 7rem 0;
    }
}