/* ================================
   CODESONA HERO - RESPONSIVE REFACTOR
   Spec-compliant hero section with proper responsive behavior
   ================================ */

/* ================================
   CONTAINER & GRID
   ================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
}

/* ================================
   HERO SECTION
   ================================ */
.hero {
    position: relative;
    padding: calc(var(--navbar-height) + 96px) 0 96px;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

@media (max-width: 1024px) {
    .hero {
        padding: calc(var(--navbar-height) + 80px) 0 80px;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: calc(var(--navbar-height) + 64px) 0 64px;
    }
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ================================
   TYPOGRAPHY - FLUID & BALANCED
   ================================ */

/* Badge */
.hero .badge {
    margin-bottom: 24px;
    font-size: 14px;
    padding: 8px 16px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: fadeInUp 0.8s ease-out;
}

/* Hero Title - Fluid clamp, balanced wrap */
.hero-title {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    max-width: 900px;
    text-wrap: balance;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Ensure "your rules" stays together - use non-breaking approach */
.hero-title br {
    display: none;
}

@media (min-width: 768px) {
    .hero-title br {
        display: block;
    }
}

.hero-title .gradient-text {
    white-space: nowrap;
}

/* Subhead - Fluid clamp */
.hero-subtitle {
    font-size: clamp(15px, 1.4vw, 18px);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 680px;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

@media (max-width: 640px) {
    .hero-subtitle br {
        display: none;
    }
}

/* ================================
   BUTTONS - NORMALIZED HEIGHTS
   ================================ */
.hero-ctas {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
    width: 100%;
    max-width: 600px;
    justify-content: center;
}

/* Primary CTA */
.btn-hero {
    min-height: 56px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-direction: column;
    gap: 4px;
    min-width: 240px;
    flex: 1;
    max-width: 320px;
    transition: all 0.25s ease-out;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-hero:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 2px;
}

.btn-hero:active {
    transform: scale(0.98) translateY(-2px);
}

/* Button subtext */
.btn-subtext {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.6;
    line-height: 1;
}

/* Secondary CTA (Watch Demo) */
.btn-ghost {
    min-height: 56px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
    flex: 0 1 auto;
    max-width: 200px;
    transition: all 0.25s ease-out;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-ghost:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 2px;
}

.btn-ghost:active {
    transform: scale(0.98) translateY(-2px);
}

/* Tablet - 48px buttons */
@media (max-width: 1024px) {
    .btn-hero,
    .btn-ghost {
        min-height: 48px;
        font-size: 15px;
        padding: 12px 20px;
    }
    
    .btn-subtext {
        font-size: 11px;
    }
}

/* Mobile - 48px buttons, row layout if space allows */
@media (max-width: 640px) {
    .hero-ctas {
        gap: 12px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .btn-hero {
        min-height: 48px;
        flex: 0 1 auto;
        font-size: 15px;
        padding: 12px 20px;
    }
    
    .btn-ghost {
        min-height: 48px;
        flex: 0 1 auto;
        padding: 12px 20px;
    }
    
    .hero-content {
        align-items: center;
        text-align: center;
        max-width: 100%;
    }
}

/* Extra small mobile - stack vertically, full width */
@media (max-width: 480px) {
    .hero-ctas {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-hero,
    .btn-ghost {
        width: 100%;
        max-width: 100%;
        flex: none;
        padding: 12px 16px;
    }
    
    .hero-title {
        font-size: 32px;
        text-align: center;
    }
    
    .hero-subtitle {
        font-size: 15px;
        text-align: center;
    }
    
    .hero-content {
        align-items: center;
        text-align: center;
    }
}

/* ================================
   IDE CHIPS - AUTO-WRAP
   ================================ */
.hero-trust {
    margin-bottom: 48px;
    animation: fadeInUp 0.8s ease-out 0.7s backwards;
    width: 100%;
}

.trust-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    text-align: center;
}

.hero-ide-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.ide-badge {
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease-out;
    white-space: nowrap;
}

.ide-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ide-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Mobile chips - 32px height */
@media (max-width: 640px) {
    .ide-badge {
        height: 32px;
        padding: 0 10px;
        font-size: 13px;
    }
    
    .ide-badge svg {
        width: 14px;
        height: 14px;
    }
}

/* ================================
   STATS BAND - CLEAN & MINIMAL (NO LINES, NO GLOWS)
   ================================ */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    max-width: 900px;
    margin: 40px auto 56px;
    padding: 0;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.8s backwards;
}

.stat-item {
    text-align: center;
    position: relative;
    padding: 0 24px;
}

/* Subtle vertical dividers between stats (desktop only) */
.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-size: clamp(22px, 2.5vw, 32px);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

/* Tablet stats - maintain horizontal layout */
@media (max-width: 1024px) {
    .hero-stats {
        margin-bottom: 48px;
    }
}

/* Mobile stats - stack vertically, remove dividers */
@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
        margin: 32px auto 24px;
    }
    
    .stat-item {
        padding: 16px 0;
    }
    
    /* Remove vertical dividers on mobile */
    .stat-item:not(:last-child)::after {
        display: none;
    }
    
    /* Add horizontal dividers between stacked items */
    .stat-item:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 16px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .stat-item,
    .hero-title,
    .hero-subtitle,
    .hero-ctas,
    .hero-trust,
    .hero .badge,
    .code-mockup {
        animation: none !important;
    }
}

/* ================================
   CODE MOCKUP - PROPER SIZING
   ================================ */
.code-mockup {
    width: 100%;
    max-width: 1280px;
    margin: 64px auto 0;
    background: rgba(15, 15, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 0 40px rgba(59, 130, 246, 0.05);
    animation: fadeInUp 0.8s ease-out 1s backwards;
}

@media (max-width: 1024px) {
    .code-mockup {
        max-width: 100%;
        margin-top: 56px;
    }
}

@media (max-width: 768px) {
    .code-mockup {
        max-width: 100%;
        margin: 32px auto 0;
    }
}

@media (max-width: 640px) {
    .code-mockup {
        border-radius: 8px;
        font-size: 13px;
        margin-top: 24px;
    }
}

.mockup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
    .mockup-header {
        padding: 12px;
    }
}

.mockup-content {
    padding: 24px;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Monaco', 'Menlo', monospace;
    background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
    .mockup-content {
        padding: 16px;
        font-size: 12px;
    }
}

/* AI Prompt Bubble */
.ai-suggestion {
    margin-top: 24px;
    padding: 24px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

@media (max-width: 1024px) {
    .ai-suggestion {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .ai-suggestion {
        padding: 16px;
        margin-top: 16px;
    }
}

/* ================================
   ANIMATIONS - FADE IN UP
   ================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */

/* Focus visible for keyboard navigation */
.btn-hero:focus-visible,
.btn-ghost:focus-visible,
.ide-badge:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.8);
    outline-offset: 2px;
}

/* Ensure minimum tap target 44x44px */
@media (max-width: 640px) {
    .btn-hero,
    .btn-ghost,
    .ide-badge {
        min-height: 44px;
    }
}

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

/* ================================
   PERFORMANCE OPTIMIZATIONS
   ================================ */

/* GPU acceleration for transforms */
.btn-hero,
.btn-ghost,
.ide-badge {
    will-change: transform;
}

/* Contain paint for mockup */
.code-mockup {
    contain: paint;
}

/* ================================
   BREAKPOINT SUMMARY
   - ≥1440px: Full desktop
   - 1280px: Standard desktop (container max)
   - 1024px: Tablet landscape (48px buttons)
   - 768px: Tablet portrait (stats stack)
   - 640px: Mobile (44px buttons, column layout)
   - 375px: Small mobile (80% primary width)
   ================================ */

