/* ============================================================================
   EXAM PREP PORTAL - V3 (TECH STARTUP THEME)
   Aesthetic: Clean, High-Performance, Deep Gradients, Bento Grids
   ============================================================================ */

/* 1. Design Tokens */
:root {
    /* Colors - Brand */
    --brand-primary: #0052FF;
    --brand-secondary: #7C3AED;
    --brand-accent: #38bdf8;

    /* Colors - Neutral (Dark Mode Base) */
    --bg-page: #030712;
    /* Very dark blue/slate */
    --bg-surface: #111827;
    /* Slightly lighter surface */
    --bg-surface-hover: #1f2937;
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --text-dark: #cbd5e1;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #0052FF 0%, #7C3AED 100%);
    --gradient-text: linear-gradient(to right, #60a5fa, #a78bfa, #f472b6);
    --gradient-surface: linear-gradient(180deg, rgba(17, 24, 39, 0.4) 0%, rgba(17, 24, 39, 1) 100%);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 64px;
    --space-3xl: 96px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Shadows & Glows */
    --shadow-glow: 0 0 40px -10px rgba(124, 58, 237, 0.3);
    --shadow-card: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 2. Global Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s ease;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* 3. Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 4. Navigation */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: var(--space-md) 0;
    transition: 0.3s ease;
    border-bottom: 1px solid transparent;
}

.nav-header.scrolled {
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.125rem;
    z-index: 102;
    /* Ensure logo stays above mobile menu */
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-main);
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-page);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 102;
    padding: 8px;
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: 0.3s ease;
}

/* Mobile Menu Active State */
.nav-header.active .mobile-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 5px);
}

.nav-header.active .mobile-toggle span:nth-child(2) {
    opacity: 0;
}

.nav-header.active .mobile-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -5px);
}

/* 5. Hero Section */
.hero {
    position: relative;
    padding-top: 140px;
    /* More predictable spacing */
    padding-bottom: var(--space-2xl);
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-bg-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(3, 7, 18, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-2xl);
}

.hero-content {
    max-width: 600px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: #a78bfa;
    margin-bottom: var(--space-lg);
}

h1 {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.app-btns {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.app-btn-svg {
    height: 48px;
    width: auto;
    transition: 0.2s ease;
}

.app-btn-svg:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.mockup-container {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 40px rgba(0, 82, 255, 0.2));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* 6. Amplify Section (Problem) */
.amplify-section {
    padding: var(--space-3xl) 0;
    background: rgba(255, 255, 255, 0.02);
}

.text-danger {
    color: #ef4444;
}

.pain-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.pain-card {
    background: var(--bg-surface);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: 0.3s ease;
}

.pain-card:hover {
    transform: translateY(-4px);
    border-color: #ef4444;
}

.pain-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.pain-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-main);
}

.pain-card p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Story Section */
.story-section {
    padding: var(--space-3xl) 0;
}

.story-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.story-card-visual {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    position: relative;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.score-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: var(--space-xl);
}

.old-score {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.5;
    font-size: 2rem;
}

.arrow {
    color: var(--brand-accent);
}

.new-score {
    color: #22c55e;
}

.score-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

.student-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-lg);
}

.student-avatar {
    width: 48px;
    height: 48px;
    background: var(--brand-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.student-name {
    font-weight: 600;
}

.student-school {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.story-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-muted);
    font-style: italic;
    border-left: 4px solid var(--brand-primary);
    padding-left: var(--space-lg);
}

/* 7. Features Grid (Bento) */
.features {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-3xl);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 300px);
    gap: var(--space-lg);
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: 0.3s ease;
}

.bento-card:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.bento-card.span-2 {
    grid-column: span 2;
}

.bento-card.span-row-2 {
    grid-row: span 2;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    color: var(--brand-accent);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.card-visual {
    margin-top: auto;
    height: 120px;
    background: radial-gradient(circle at bottom center, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
    position: relative;
}

/* 8. Community Section */
.community-section {
    padding: var(--space-3xl) 0;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0) 0%, rgba(124, 58, 237, 0.05) 50%, rgba(3, 7, 18, 0) 100%);
}

.community-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.community-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.community-content p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: var(--space-lg);
}

.community-features {
    display: grid;
    gap: var(--space-md);
}

.community-feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.community-visual {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 400px;
    position: relative;
    overflow: hidden;
    background-image: radial-gradient(circle at 70% 30%, rgba(124, 58, 237, 0.2) 0%, transparent 50%);
}

/* 9. Stats / Social Proof */
.stats-strip {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-2xl) 0;
    background: rgba(255, 255, 255, 0.01);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: var(--space-xs);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 10. Showcases */
.showcase {
    padding: var(--space-3xl) 0;
}

.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.cta-section {
    padding: var(--space-3xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card {
    background: linear-gradient(180deg, #111827 0%, #030712 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-lg);
    position: relative;
    overflow: hidden;
}

.cta-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top, rgba(0, 82, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.cta-title {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
}

/* 11. Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-2xl) 0;
    color: var(--text-muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-brand p {
    margin-top: var(--space-md);
    max-width: 300px;
    font-size: 0.9375rem;
}

.footer-col h4 {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.footer-col a:hover {
    color: var(--brand-accent);
}

.footer-bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}


/* ============================================================================
   12. MOBILE RESPONSIVE QUERIES
   ============================================================================ */

@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-md);
    }

    h1 {
        font-size: 3rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-bg-glow {
        width: 100%;
        top: -10%;
    }

    .hero-content {
        margin: 0 auto;
    }

    .app-btns {
        justify-content: center;
    }

    .hero-visual {
        margin-top: var(--space-xl);
        transform: scale(0.9);
    }

    .section-title {
        font-size: 2rem;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }
}

@media (max-width: 768px) {

    /* Navigation */
    .mobile-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-page);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-xl);
        padding: var(--space-2xl);
        transform: translateY(-100%);
        transition: 0.3s ease-in-out;
        z-index: 100;
    }

    .nav-header.active .nav-links {
        transform: translateY(0);
    }

    .nav-links a {
        font-size: 1.5rem;
        color: var(--text-main);
    }

    .nav-links .btn-primary {
        width: 100%;
        text-align: center;
        font-size: 1.125rem;
        padding: var(--space-md);
    }

    /* Layout Stacking */
    h1 {
        font-size: 2.5rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bento-card.span-2,
    .bento-card.span-row-2 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .bento-card {
        min-height: 200px;
    }

    .pain-grid {
        grid-template-columns: 1fr;
    }

    .story-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .community-grid {
        grid-template-columns: 1fr;
    }

    .community-visual {
        order: -1;
        height: 300px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .cta-title {
        font-size: 2rem;
    }
}