@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&family=Fredoka+One&display=swap');

:root {
    --bg-dark-navy: #0a192f;
    --bg-dark-teal: #00334e;
    --bg-light-accent: #0e2a47;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --text-headings: #ffffff;
    --accent-bright-teal: #64ffda;
    --accent-cyan: #00bcd4;
    --accent-fun-orange: #ffab73;
    --accent-pink: #f78fb3;
    --font-primary: 'Poppins', sans-serif;
    --font-display: 'Fredoka One', cursive;
    --navbar-height: 70px;
    --transition-speed: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark-navy);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- General Styles --- */
h1, h2, h3, h4 {
    color: var(--text-headings);
    margin-bottom: 1rem;
    line-height: 1.3;
}
h1 { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; }
h2.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}
h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-bright-teal), var(--accent-cyan));
    border-radius: 2px;
}
h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 600;}
p { margin-bottom: 1rem; color: var(--text-secondary); font-size: clamp(0.9rem, 1.8vw, 1.1rem); }

a {
    color: var(--accent-bright-teal);
    text-decoration: none;
    transition: var(--transition-speed);
}
a:hover {
    color: var(--accent-cyan);
    filter: brightness(1.2);
}

.highlight-fun { color: var(--accent-fun-orange); font-family: var(--font-display); }
.highlight-easy { color: var(--accent-pink); font-family: var(--font-display); }
.highlight-coding { color: var(--accent-bright-teal); font-family: var(--font-display); }
.highlight-interactive { color: var(--accent-cyan); font-weight: 600; }


/* --- Navbar --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: top 0.3s ease-in-out;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
}
nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-headings);
    font-family: var(--font-display);
}
.logo-rocket { display: inline-block; animation: rocketShake 2s ease-in-out infinite; }
@keyframes rocketShake {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(-5deg); }
    75% { transform: translateY(2px) rotate(5deg); }
}
nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}
nav ul li {
    margin-left: 30px;
}
nav ul li a {
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
}
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-bright-teal);
    transition: width var(--transition-speed);
}
nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}
nav ul li a.active {
    color: var(--accent-bright-teal);
}
.menu-toggle { display: none; /* For mobile */ }

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--navbar-height) + 40px) 2rem 40px;
    position: relative;
    overflow: hidden; /* Crucial for background elements */
    background: radial-gradient(ellipse at bottom, var(--bg-dark-teal) 0%, var(--bg-dark-navy) 70%);
}
.hero-background-emojis {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: -1;
}
.hero-background-emojis .emoji-particle {
    position: absolute;
    font-size: clamp(1rem, 3vw, 2.5rem);
    opacity: 0; /* Start hidden, JS will animate */
    animation: floatEmoji 15s linear infinite;
}
@keyframes floatEmoji {
    0% { transform: translateY(5vh) rotate(0deg); opacity: 0; }
    10%, 90% { opacity: 0.3; }
    100% { transform: translateY(-105vh) rotate(360deg); opacity: 0; }
}
.hero-content { z-index: 1; max-width: 900px; }
.hero-content h1 span {
    display: inline-block; /* For individual animation */
    opacity: 0;
    transform: translateY(30px);
    animation: revealText 0.5s forwards;
}
@keyframes revealText {
    to { opacity: 1; transform: translateY(0); }
}
/* Staggered animation for h1 spans */
.hero-content h1 span:nth-child(1) { animation-delay: 0.1s; }
.hero-content h1 span:nth-child(2) { animation-delay: 0.2s; }
.hero-content h1 span:nth-child(3) { animation-delay: 0.3s; }
/* ...and so on for all spans */
.hero-content h1 span:nth-child(4) { animation-delay: 0.4s; }
.hero-content h1 span:nth-child(5) { animation-delay: 0.5s; }
.hero-content h1 span:nth-child(6) { animation-delay: 0.6s; }
.hero-content h1 span:nth-child(7) { animation-delay: 0.7s; }
.hero-content h1 span:nth-child(8) { animation-delay: 0.8s; }
.hero-content h1 span:nth-child(9) { animation-delay: 0.9s; }
.hero-content h1 span:nth-child(10) { animation-delay: 1.0s; }
.hero-content h1 span:nth-child(11) { animation-delay: 1.1s; }


.subtitle { margin: 1.5rem 0 2.5rem; font-size: clamp(1rem, 2.5vw, 1.25rem); }
#typewriter-adjectives {
    border-right: 0.1em solid var(--accent-cyan);
    animation: blink-caret 0.75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    min-width: 5px; /* Ensures cursor shows even when empty */
}
@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-cyan); }
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px; /* Pill shape */
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.cta-button .button-emoji { margin-left: 0.5em; display: inline-block; }
.cta-button.primary {
    background: linear-gradient(45deg, var(--accent-bright-teal), var(--accent-cyan));
    color: var(--bg-dark-navy);
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}
.cta-button.primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.5);
}
.cta-button.secondary {
    background-color: transparent;
    color: var(--accent-bright-teal);
    border: 2px solid var(--accent-bright-teal);
}
.cta-button.secondary:hover {
    background-color: var(--accent-bright-teal);
    color: var(--bg-dark-navy);
    transform: translateY(-3px);
}
.cta-button.large { padding: 15px 35px; font-size: 1.1rem; }

.hero-visual-container { margin-top: 3rem; }
.mock-editor {
    background-color: #1e2a3a; /* Darker shade for editor */
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: left;
    border: 1px solid var(--bg-light-accent);
}
.mock-editor-header {
    display: flex;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--bg-light-accent);
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.mock-editor-header .dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot.red { background-color: #ff5f57; }
.dot.yellow { background-color: #febc2e; }
.dot.green { background-color: #28c840; }
.mock-editor-code { font-family: 'Courier New', Courier, monospace; font-size: 0.95rem; line-height: 1.8; }
.mock-editor-code .emoji-code { font-size: 1.2em; margin-right: 0.3em; }
.mock-editor-code .text-code { color: var(--text-primary); }

.scroll-down-link {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-bright-teal);
    font-size: 1.8rem;
    animation: bounce 2s infinite;
    padding: 10px;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* --- General Content Sections --- */
.content-section {
    padding: 80px 2rem;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}
.content-section.alternate-bg {
    background-color: var(--bg-dark-teal);
}
.section-intro {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 3rem auto;
    color: var(--text-secondary);
}

/* Features Grid (Why Emojilang) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}
.feature-card {
    background-color: var(--bg-light-accent);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-bottom: 4px solid transparent; /* For hover effect */
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    border-bottom-color: var(--accent-bright-teal);
}
.feature-icon-bg {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-bright-teal), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
}
.feature-icon { font-size: 2.2rem; color: var(--bg-dark-navy); }
.feature-card h3 { color: var(--text-headings); margin-bottom: 0.7rem; }
.feature-card p { font-size: 0.95rem; color: var(--text-secondary); }


/* How It Works Flow */
.how-it-works-flow {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start; /* Align items to top for different content heights */
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}
.flow-step {
    background-color: var(--bg-dark-navy);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    width: calc(33.333% - 2.7rem); /* Adjust for gap and arrows */
    min-width: 280px; /* Ensure readability on smaller flex views */
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: transform var(--transition-speed);
}
.flow-step:hover { transform: scale(1.03); }
.flow-icon .emoji-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.flow-step h4 { color: var(--accent-bright-teal); margin-bottom: 0.8rem; font-size: 1.3rem; }
.flow-step p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem;}
.flow-code-example {
    background-color: rgba(0,0,0,0.2);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 1rem;
    text-align: left;
}
.flow-code-example .code-block { font-weight: bold; }
.emoji-var { color: var(--accent-fun-orange); }
.emoji-val { color: var(--accent-pink); }
.output-val { color: var(--accent-bright-teal); }
.flow-arrow {
    font-size: 2.5rem;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center; /* Vertically center arrows */
    flex-grow: 0; /* Don't let arrows grow */
    padding: 0 1rem; /* Space around arrows */
}

.how-it-works-visual { /* Placeholder styling */
    margin-top: 3rem;
    padding: 2rem;
    border: 3px dashed var(--accent-cyan);
    border-radius: 10px;
    background-color: rgba(0,0,0,0.1);
    font-style: italic;
    color: var(--text-secondary);
}

/* Testimonials Section */
.testimonials-carousel {
    display: grid; /* Simple grid for now, can be JS carousel */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}
.testimonial-card {
    background-color: var(--bg-light-accent);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    text-align: left;
    position: relative;
    border-left: 5px solid var(--accent-fun-orange);
}
.testimonial-card::before { /* Quote icon */
    content: "\f10d"; /* FontAwesome quote-left */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 2.5rem;
    color: var(--accent-fun-orange);
    opacity: 0.2;
    position: absolute;
    top: 1rem;
    left: 1rem;
}
.testimonial-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
    border: 3px solid var(--accent-fun-orange);
}
.testimonial-card p {
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
    clear: right; /* Ensure text wraps after avatar */
}
.testimonial-author {
    text-align: right;
    font-weight: 600;
    color: var(--accent-fun-orange);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section h2 { margin-bottom: 1rem; }
.cta-section p { margin-bottom: 2.5rem; }
.cta-buttons .cta-button { margin: 0.5rem; }


/* --- Footer --- */
footer {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--bg-dark-teal);
    border-top: 2px solid var(--accent-cyan);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Animations on Scroll --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transition-delay: var(--animation-delay, 0s);
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Initial Fade-in Animations (for hero primarily) */
.animate-fade-in { opacity: 0; animation: fadeIn 1s forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.animate-delay-1s { animation-delay: 1s; }
.animate-delay-1-5s { animation-delay: 1.5s; }
.animate-delay-2s { animation-delay: 2s; }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .how-it-works-flow { flex-direction: column; align-items: center; }
    .flow-step { width: 80%; max-width: 450px; margin-bottom: 1.5rem; }
    .flow-arrow { transform: rotate(90deg); margin: 0.5rem 0; }
}

@media (max-width: 768px) {
    nav ul {
        display: none; /* Hide for mobile, handled by JS */
        flex-direction: column;
        position: absolute;
        top: var(--navbar-height);
        left: 0;
        width: 100%;
        background-color: var(--bg-dark-teal);
        padding: 1rem 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }
    nav ul.active { display: flex; }
    nav ul li { margin: 0.8rem 0; text-align: center; width: 100%; }
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--text-headings);
        font-size: 1.8rem;
        cursor: pointer;
    }
    .hero { padding-top: calc(var(--navbar-height) + 20px); }
    .hero-content h1 { font-size: 2.2rem; }
    .features-grid { grid-template-columns: 1fr; }
    .testimonial-card { text-align: center; }
    .testimonial-avatar { float: none; margin: 0 auto 1rem auto; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.8rem; }
    .subtitle { font-size: 0.9rem; }
    .cta-button { padding: 10px 20px; font-size: 0.9rem; }
    .cta-button.large { padding: 12px 25px; font-size: 1rem; }
    .cta-buttons { display: flex; flex-direction: column; align-items: center; }
    .cta-buttons .cta-button { width: 80%; margin-bottom: 1rem; }
    .mock-editor { padding: 1rem; }
    .mock-editor-code { font-size: 0.85rem; }
}

/* Hide navbar on scroll down, show on scroll up */
.nav-up { top: 0; }
.nav-down { top: calc(-1 * var(--navbar-height)); }