:root {
    /* Color Palette */
    --primary: #0EA5E9;
    --primary-light: #E0F2FE;
    --secondary: #10B981;
    --accent: #F43F5E;
    --accent-light: #FFE4E6;
    --bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    
    /* Gradients */
    --grad-primary: linear-gradient(135deg, #0EA5E9 0%, #2563EB 100%);
    --grad-vibrant: linear-gradient(135deg, #0EA5E9 0%, #10B981 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-soft: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    
    /* Spacing */
    --container-max: 1200px;
    --section-pad: 80px 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; }
h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; font-weight: 600; }
p { font-size: 1.125rem; color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

.btn-outline {
    background: white;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Fixed Header */
header {
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px; /* Force min-gap */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

.logo span { color: var(--text-main); }

.nav-links {
    display: flex;
    gap: 1rem; /* Reduced to avoid overlapping Academy */
    align-items: center;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 100px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero p {
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: auto;
    gap: 20px;
    margin-top: 50px;
}

.bento-item {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	
}

.bento-item h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.bento-item p {
    margin-top: 0;
}

.bento-item:hover {
    transform: translateY(-5px);
}

.bento-1 { grid-column: span 8; background: var(--grad-primary); color: white; padding: 40px 32px; }
.bento-1 p { color: rgba(255, 255, 255, 0.8); }
.bento-4 { grid-column: span 8; min-height: 280px; }
.bento-item:not(.bento-1):not(.bento-4) {
    grid-column: span 4;
	min-height: 280px;
}

.bento-icon {
    width: 70px;
    height: 50px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 20px;
	flex-shrink: 0;
}

.bento-1 .bento-icon { background: rgba(255, 255, 255, 0.2); color: white; }

/* Test Categories Hub */
.test-hub {
    padding: var(--section-pad);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 30px rgba(14, 165, 233, 0.08);
}

.cat-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* Leaderboard Mockup */
.leaderboard-section {
    padding: var(--section-pad);
    background: white;
}

.leaderboard-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 16px;
    margin-bottom: 12px;
    transition: transform 0.2s ease;
}

.lb-row:hover {
    transform: scale(1.02);
}

.lb-rank { width: 40px; font-weight: 800; color: var(--primary); }
.lb-name { flex: 1; font-weight: 600; }
.lb-score { font-weight: 700; color: var(--secondary); }

/* Courses */
.courses-section {
    padding: var(--section-pad);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.course-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.course-img {
    height: 200px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-info {
    padding: 25px;
}

.course-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

/* Academy Section Fixed */
.academy-section {
    padding: 60px 40px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 40px;
    margin: 60px auto;
    width: calc(100% - 40px);
    max-width: var(--container-max);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.academy-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.academy-text { flex: 1.2; text-align: left; }
.academy-visual { flex: 0.8; text-align: right; }

/* 7 Tiers & Ranks */
.tier-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.t-starter { background: #f1f5f9; color: #64748b; }
.t-player { background: #dcfce7; color: #166534; }
.t-pro { background: #dbeafe; color: #1e40af; }
.t-expert { background: #fef9c3; color: #854d0e; }
.t-master { background: #ffedd5; color: #9a3412; }
.t-elite { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
.t-imba { background: #1e293b; color: #f8fafc; box-shadow: 0 0 12px rgba(30, 41, 59, 0.4); border: 1px solid #475569; }

.test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.test-item:last-child { border-bottom: none; }

.test-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.test-btn {
    padding: 6px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.test-btn:hover {
    background: var(--primary);
    color: white;
}

/* Leaderboard Tabs */
.lb-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.lb-tab {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

/* Pyramid Stack UI */
.progression-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Tight stack */
    padding-left: 0;
}

.progression-container::before { display: none; } /* Remove path line */

.prog-row {
    margin-bottom: 0;
    width: 100%;
    border-radius: 12px;
    border: none;
    padding: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
}

.prog-inner {
    width: 480px; /* Fixed width for perfect column alignment */
    display: grid;
    grid-template-columns: 70px 1fr 140px;
    align-items: center;
    gap: 15px;
}

.prog-info { text-align: left; }
.p-stats-box { text-align: right; }

.prog-row::before { display: none; } /* Remove dots */

.prog-row:hover {
    transform: scale(1.03);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Pyramid Width Tapering */
.tier-imba-row { width: 45%; background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%); animation: glow-blue 3s infinite; border: 2px solid #6366f1; }
.tier-elite-row { width: 55%; background: linear-gradient(135deg, #581c87 0%, #7e22ce 100%); border: 1px solid rgba(255,255,255,0.2); }
.tier-master-row { width: 65%; background: linear-gradient(135deg, #9a3412 0%, #c2410c 100%); }
.tier-expert-row { width: 75%; background: linear-gradient(135deg, #854d0e 0%, #a16207 100%); }
.tier-pro-row { width: 85%; background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%); }
.tier-player-row { width: 93%; background: linear-gradient(135deg, #166534 0%, #15803d 100%); }
.tier-starter-row { width: 100%; background: linear-gradient(135deg, #334155 0%, #475569 100%); }

.prog-icon-box {
    background: rgba(255,255,255,0.15);
    color: white !important;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prog-info h3 { color: white; margin-top: 0 !important; }
.prog-desc { color: rgba(255,255,255,0.8); }
.p-xp-pill { background: rgba(255,255,255,0.2); color: white; }

.p-stats-box { background: rgba(0,0,0,0.1) !important; color: white; }
.prog-label { color: rgba(255,255,255,0.6); }
.prog-count { color: white; }

@media (max-width: 992px) {
    .tier-imba-row, .tier-elite-row, .tier-master-row, .tier-expert-row, .tier-pro-row, .tier-player-row {
        width: 100%;
    }
    .prog-row { 
        padding: 25px;
    }
    .prog-inner {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    .prog-info, .p-stats-box {
        text-align: center;
    }
    .prog-icon-box {
        margin: 0 auto;
    }
}

.lb-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Language Switcher Styles */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.lang-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

/* Responsive fixes for language switcher */
@media (max-width: 768px) {
    .nav-actions {
        gap: 8px;
    }
    
    .lang-switcher {
        padding: 2px;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}