/* ==========================================
   EDUCA - Children's Educational Platform
   Modern, Interactive, Fun Design System
   ========================================== */

/* --- CSS Custom Properties --- */
:root {
    /* Primary palette - vibrant and kid-friendly */
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #4834D4;
    
    /* Accent colors */
    --accent-pink: #FD79A8;
    --accent-orange: #FDCB6E;
    --accent-green: #00B894;
    --accent-blue: #0984E3;
    --accent-red: #E17055;
    --accent-cyan: #00CEC9;
    
    /* Theme-specific colors */
    --solar-primary: #2D1B69;
    --solar-accent: #FDCB6E;
    --solar-glow: #F9CA24;
    
    --agua-primary: #0C2461;
    --agua-accent: #54A0FF;
    --agua-glow: #48DBFB;
    
    --plantas-primary: #0A3D19;
    --plantas-accent: #00B894;
    --plantas-glow: #55EFC4;
    
    --volcan-primary: #4A1A0A;
    --volcan-accent: #E17055;
    --volcan-glow: #FF6348;
    
    --dino-glow: #FF9F43;
    --animal-glow: #1DD1A1;
    --colores-glow: #F368E0;
    --numeros-glow: #0ABDE3;
    --letras-glow: #EE5253;
    --mares-glow: #48DBFB;
    
    /* Neutrals */
    --bg-main: #0F0A1E;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Typography */
    --font-display: 'Baloo 2', cursive;
    --font-body: 'Fredoka', sans-serif;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Background Particles --- */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) scale(1);
        opacity: 0;
    }
}

/* --- Background Shapes --- */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
    animation: shapeFloat 20s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-pink);
    bottom: -100px;
    left: -100px;
    animation: shapeFloat 25s ease-in-out infinite reverse;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-cyan);
    top: 50%;
    left: 50%;
    animation: shapeFloat 18s ease-in-out infinite;
}

.shape-4 {
    width: 500px;
    height: 500px;
    background: var(--accent-orange);
    top: 30%;
    right: -150px;
    animation: shapeFloat 22s ease-in-out infinite reverse;
}

.shape-5 {
    width: 300px;
    height: 300px;
    background: var(--accent-green);
    bottom: 20%;
    left: 30%;
    animation: shapeFloat 16s ease-in-out infinite;
}

.shape-6 {
    width: 250px;
    height: 250px;
    background: var(--accent-blue);
    top: 10%;
    left: 20%;
    animation: shapeFloat 19s ease-in-out infinite reverse;
}

@keyframes shapeFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -40px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(15px, 35px) scale(1.05);
    }
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) var(--space-xl);
    transition: var(--transition-normal);
    background: transparent;
}

.header.scrolled {
    background: rgba(15, 10, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-sm) var(--space-xl);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    text-decoration: none;
}

.logo-icon {
    position: relative;
    font-size: 1.8rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
    transition: var(--transition-bounce);
}

.logo-icon:hover {
    transform: rotate(-5deg) scale(1.1);
}

.logo-star {
    position: absolute;
    font-size: 1rem;
    top: -4px;
    right: -4px;
    animation: sparkle 2s ease-in-out infinite;
}

.logo-book {
    font-size: 1.5rem;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(15deg); opacity: 0.7; }
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF, var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Navigation */
.nav {
    display: flex;
    gap: var(--space-sm);
    background: var(--bg-glass);
    padding: 6px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.nav-icon {
    font-size: 1.1rem;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px var(--space-xl) var(--space-3xl);
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--accent-orange);
    font-weight: 600;
    margin-bottom: var(--space-xl);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease backwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: var(--space-lg);
}

.word-animate {
    display: inline-block;
    animation: wordBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) backwards;
    animation-delay: calc(var(--delay) * 0.12s + 0.3s);
}

.highlight-word {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes wordBounceIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-2xl);
    animation: fadeInUp 0.8s ease 0.8s backwards;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    animation: fadeInUp 0.8s ease 1s backwards;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-2xl);
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
    position: relative;
    overflow: hidden;
    width: fit-content;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.6);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-1px) scale(1);
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Hero Illustration */
.hero-illustration {
    flex: 1;
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-elements {
    position: relative;
    width: 100%;
    height: 100%;
}

.float-item {
    position: absolute;
    left: var(--x);
    top: var(--y);
    font-size: 3rem;
    animation: floatBounce var(--duration) ease-in-out var(--delay) infinite;
    cursor: pointer;
    transition: var(--transition-bounce);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.float-item:hover {
    transform: scale(1.5) rotate(15deg);
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.5));
}

.float-item.planet { font-size: 4rem; }
.float-item.rocket { font-size: 3.5rem; }
.float-item.earth { font-size: 4.5rem; }

@keyframes floatBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-25px) rotate(5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(-5deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Section Styles --- */
.section-header {
    text-align: center;
    margin-bottom: var(--space-4xl);
}

.section-badge {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: var(--space-md);
    backdrop-filter: blur(10px);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, #FFFFFF, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Topics Grid --- */
.topics-section {
    padding: var(--space-4xl) var(--space-xl);
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-xl);
}

/* --- Topic Card --- */
.topic-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-slow);
    border: 1px solid rgba(255, 255, 255, 0.08);
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
}

.topic-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
}

.topic-card:active {
    transform: translateY(-4px) scale(0.99);
}

/* Card Glow Effect */
.card-glow {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-xl);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: -1;
}

.topic-card:hover .card-glow {
    opacity: 1;
}

[data-theme="solar"] .card-glow {
    background: linear-gradient(135deg, var(--solar-glow), var(--accent-orange));
    filter: blur(15px);
}

[data-theme="agua"] .card-glow {
    background: linear-gradient(135deg, var(--agua-glow), var(--accent-blue));
    filter: blur(15px);
}

[data-theme="plantas"] .card-glow {
    background: linear-gradient(135deg, var(--plantas-glow), var(--accent-green));
    filter: blur(15px);
}

[data-theme="volcan"] .card-glow {
    background: linear-gradient(135deg, var(--volcan-glow), var(--accent-red));
    filter: blur(15px);
}

[data-theme="dino"] .card-glow {
    background: linear-gradient(135deg, var(--dino-glow), #E67E22);
    filter: blur(15px);
}

[data-theme="animales"] .card-glow {
    background: linear-gradient(135deg, var(--animal-glow), #10AC84);
    filter: blur(15px);
}

[data-theme="colores"] .card-glow {
    background: linear-gradient(135deg, var(--colores-glow), #FF9FF3);
    filter: blur(15px);
}

[data-theme="numeros"] .card-glow {
    background: linear-gradient(135deg, var(--numeros-glow), #48DBFB);
    filter: blur(15px);
}

[data-theme="letras"] .card-glow {
    background: linear-gradient(135deg, var(--letras-glow), #FF6B6B);
    filter: blur(15px);
}

[data-theme="mares"] .card-glow {
    background: linear-gradient(135deg, var(--mares-glow), #0ABDE3);
    filter: blur(15px);
}

/* Card Background */
.card-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.solar-bg {
    background: linear-gradient(160deg, #0F0528 0%, #1A0A3E 40%, #2D1B69 100%);
}

.agua-bg {
    background: linear-gradient(160deg, #041430 0%, #0C2461 40%, #1B4F72 100%);
}

.plantas-bg {
    background: linear-gradient(160deg, #021006 0%, #0A3D19 40%, #196F3D 100%);
}

.volcan-bg {
    background: linear-gradient(160deg, #1A0A00 0%, #4A1A0A 40%, #6B2D10 100%);
}

.dino-bg {
    background: linear-gradient(160deg, #2C3E50 0%, #7F8C8D 70%, #95A5A6 100%);
}

.animal-bg {
    background: linear-gradient(160deg, #0B4524 0%, #227093 50%, #FFB142 100%);
}

.colores-bg {
    background: linear-gradient(160deg, #FFEAA7 0%, #FAB1A0 50%, #FD79A8 100%);
}

.numeros-bg {
    background: linear-gradient(160deg, #22A6B3 0%, #54A0FF 50%, #5F27CD 100%);
}

.letras-bg {
    background: linear-gradient(160deg, #FF9F43 0%, #EE5253 50%, #C8D6E5 100%);
}

.mares-bg {
    background: linear-gradient(160deg, #1034A6 0%, #008080 50%, #7FFFD4 100%);
}

/* Solar card - Stars & Orbits */
.card-stars span {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
    animation-delay: calc(var(--x, 0) * 0.03s);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

.orbit-ring {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.ring-1 {
    width: 120px;
    height: 120px;
    animation: orbitPulse 4s ease-in-out infinite;
}

.ring-2 {
    width: 200px;
    height: 200px;
    animation: orbitPulse 5s ease-in-out infinite 0.5s;
}

.ring-3 {
    width: 300px;
    height: 300px;
    animation: orbitPulse 6s ease-in-out infinite 1s;
}

@keyframes orbitPulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.05); }
}

/* Water card - Rain */
.rain-drops span {
    position: absolute;
    left: var(--x);
    top: -10%;
    width: 3px;
    height: 15px;
    background: linear-gradient(to bottom, transparent, rgba(84, 160, 255, 0.6));
    border-radius: 0 0 3px 3px;
    animation: rainFall 1.5s linear infinite;
    animation-delay: var(--delay);
}

@keyframes rainFall {
    0% { top: -10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}

.cloud {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.5;
    animation: cloudFloat 8s ease-in-out infinite;
}

.cloud-1 { top: 10%; left: 10%; animation-delay: 0s; }
.cloud-2 { top: 20%; right: 10%; animation-delay: 2s; font-size: 2rem; }

@keyframes cloudFloat {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(15px); }
}

/* Plants card - Grass */
.grass span {
    position: absolute;
    bottom: 0;
    left: var(--x);
    width: 4px;
    height: var(--h);
    background: linear-gradient(to top, #196F3D, #55EFC4);
    border-radius: 2px 2px 0 0;
    transform-origin: bottom;
    animation: grassSway 3s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes grassSway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* Volcano card - Lava particles */
.lava-particles span {
    position: absolute;
    left: var(--x);
    bottom: 20%;
    width: 6px;
    height: 6px;
    background: var(--volcan-glow);
    border-radius: 50%;
    animation: lavaRise 2.5s ease-out infinite;
    animation-delay: var(--delay);
    box-shadow: 0 0 10px var(--volcan-glow), 0 0 20px rgba(255, 99, 72, 0.5);
}

@keyframes lavaRise {
    0% { bottom: 20%; opacity: 1; transform: scale(1); }
    100% { bottom: 90%; opacity: 0; transform: scale(0.3); }
}

/* Card Content */
.card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-2xl);
    flex: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}

.card-icon-wrapper {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.card-icon {
    font-size: 2.8rem;
    position: relative;
    z-index: 2;
    animation: iconBounce 3s ease-in-out infinite;
}

.topic-card:hover .card-icon {
    animation: iconExcited 0.5s ease-in-out;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes iconExcited {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.3) rotate(-10deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.card-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0; }
}

.card-badge {
    display: inline-block;
    width: fit-content;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
    backdrop-filter: blur(5px);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    transition: var(--transition-normal);
}

.topic-card:hover .card-title {
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.card-tags {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.card-action {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-normal);
    opacity: 0.7;
}

.topic-card:hover .card-action {
    opacity: 1;
    gap: var(--space-md);
}

[data-theme="solar"] .card-action { color: var(--solar-glow); }
[data-theme="agua"] .card-action { color: var(--agua-glow); }
[data-theme="plantas"] .card-action { color: var(--plantas-glow); }
[data-theme="volcan"] .card-action { color: var(--volcan-glow); }

/* Card Shine Effect */
.card-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
    z-index: 3;
    pointer-events: none;
    transition: none;
}

.topic-card:hover .card-shine {
    left: 150%;
    transition: left 0.8s ease;
}

/* --- Fun Facts Marquee --- */
.fun-facts {
    position: relative;
    z-index: 1;
    padding: var(--space-xl) 0;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-flex;
    animation: marqueeScroll 40s linear infinite;
}

.fact {
    padding: 0 var(--space-xl);
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.fact-divider {
    color: var(--accent-orange);
    padding: 0 var(--space-md);
    font-size: 0.7rem;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- About Section --- */
.about-section {
    padding: var(--space-4xl) var(--space-xl);
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.about-container {
    display: flex;
    align-items: center;
    gap: var(--space-4xl);
}

.about-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-circle {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-emoji-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: emojiSpin 20s linear infinite;
}

.about-emoji-ring span {
    position: absolute;
    font-size: 2rem;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    --angle: calc(var(--i) * 60deg);
    transform: rotate(var(--angle)) translate(140px) rotate(calc(-1 * var(--angle)));
    animation: emojiCounterSpin 20s linear infinite;
    animation-delay: calc(var(--i) * -3.33s);
}

@keyframes emojiSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes emojiCounterSpin {
    from { transform: rotate(var(--angle)) translate(140px) rotate(calc(-1 * var(--angle))) rotate(0deg); }
}

.about-center-icon {
    font-size: 4rem;
    animation: centerPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(108, 92, 231, 0.5));
}

@keyframes centerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.about-text {
    flex: 1;
}

.about-text > p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-2xl);
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
}

.feature:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(8px);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.feature p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    margin-top: var(--space-4xl);
}

.footer-wave {
    color: rgba(108, 92, 231, 0.15);
    margin-bottom: -4px;
}

.footer-wave svg {
    display: block;
    width: 100%;
    height: 80px;
}

.footer-body {
    background: rgba(108, 92, 231, 0.15);
    padding: var(--space-3xl) var(--space-xl) var(--space-xl);
    text-align: center;
    border-top: 1px solid rgba(108, 92, 231, 0.2);
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
}

.footer-emojis {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    font-size: 1.5rem;
    margin-bottom: var(--space-2xl);
}

.footer-emojis span {
    transition: var(--transition-bounce);
    cursor: pointer;
}

.footer-emojis span:hover {
    transform: scale(1.5) rotate(15deg);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* --- Scroll to Top --- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-normal);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(108, 92, 231, 0.6);
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Card Entry Animation on Scroll --- */
.topic-card {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.topic-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.topic-card:nth-child(1) { transition-delay: 0.1s; }
.topic-card:nth-child(2) { transition-delay: 0.2s; }
.topic-card:nth-child(3) { transition-delay: 0.3s; }
.topic-card:nth-child(4) { transition-delay: 0.4s; }

/* --- Cursor trail --- */
.cursor-dot {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-light);
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
    mix-blend-mode: screen;
    transition: transform 0.15s ease;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 140px;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-cta {
        align-items: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-illustration {
        height: 300px;
    }
    
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    
    .about-features {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .nav-label {
        display: none;
    }
    
    .nav-btn {
        padding: var(--space-sm) var(--space-md);
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .float-item {
        font-size: 2rem !important;
    }
    
    .about-circle {
        width: 220px;
        height: 220px;
    }
    
    .about-emoji-ring span {
        font-size: 1.5rem;
        transform: rotate(var(--angle)) translate(100px) rotate(calc(-1 * var(--angle)));
    }
}

@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
    
    .hero {
        padding-top: 160px;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }
    
    .hero-illustration {
        height: 200px;
    }
    
    .topics-section {
        padding: var(--space-2xl) var(--space-md);
    }
}

/* --- Light/Fun Animations --- */
@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

/* Selection styling */
::selection {
    background: var(--primary);
    color: white;
/* =========================================================================
   ASISTENTE IA WIDGET (Profe RAMVELCOY)
   ========================================================================= */
#ai-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#ai-chat {
    width: 320px;
    max-height: 450px;
    background: rgba(15, 23, 42, 0.85); /* Tema oscuro sci-fi */
    backdrop-filter: blur(20px);
    border: 2px solid #5C7CFF;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(92, 124, 255, 0.4);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    transform-origin: bottom right;
}

#ai-chat.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

#ai-header {
    background: #5C7CFF;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

#ai-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    gap: 10px;
}

#ai-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}
#ai-close:hover { transform: scale(1.2); }

#ai-messages {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 250px;
}

#ai-messages p {
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeInMsg 0.4s ease-out forwards;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg {
    align-self: flex-start;
    background: rgba(92, 124, 255, 0.2);
    color: #E2E8F0;
    border-top-left-radius: 0 !important;
}

.user-msg {
    align-self: flex-end;
    background: #3B82F6;
    color: white;
    border-bottom-right-radius: 0 !important;
}

#ai-controls {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
}

.mic-btn {
    background: #E11D48;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.5);
    transition: all 0.3s;
}

.mic-btn:hover { background: #BE123C; }

.mic-btn.pulse {
    animation: micPulse 1s infinite alternate;
}

@keyframes micPulse {
    from { transform: scale(1); box-shadow: 0 0 10px #E11D48; }
    to { transform: scale(1.1); box-shadow: 0 0 25px #E11D48; }
}

#ai-status {
    font-size: 0.8rem;
    color: #94A3B8;
}

.ai-orb {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #5C7CFF, #1E1B4B);
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 30px rgba(92, 124, 255, 0.6), inset 0 0 20px rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    animation: floatOrb 4s infinite ease-in-out;
}

.ai-orb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(92, 124, 255, 0.9);
}

@keyframes floatOrb {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* --- Responsive Mobile Optimization --- */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 140px;
        gap: var(--space-2xl);
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-cta {
        align-items: center;
    }
    .hero-stats {
        justify-content: center;
    }
    .hero-illustration {
        width: 100%;
        height: 350px;
    }
    .about-container {
        flex-direction: column;
        gap: var(--space-3xl);
    }
}

@media (max-width: 768px) {
    :root {
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
        --space-3xl: 2.5rem;
        --space-4xl: 3.5rem;
    }

    .header {
        padding: var(--space-sm) var(--space-md);
    }

    .header.scrolled {
        padding: var(--space-xs) var(--space-md);
    }
    
    .logo-text h1 {
        font-size: 1.4rem;
    }

    .nav {
        gap: 2px;
        padding: 4px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .nav-label {
        display: none; /* Icon-only nav on small screens */
    }

    .nav-icon {
        font-size: 1.2rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .topics-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: var(--space-md);
    }

    .topic-card {
        aspect-ratio: 4/5;
    }

    .section-title {
        font-size: 1.8rem;
    }

    #ai-widget { bottom: 15px; right: 15px; }
    #ai-chat { width: 90vw; max-width: 350px; }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .logo-icon {
        width: 48px;
        height: 48px;
    }
    
    .logo-text {
        display: none; /* Hide logo text on very small devices to save space */
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-lg);
    }
}

