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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #17351f;
    background: linear-gradient(180deg, #bfffc8, #e9fff0 40%, #ffffff);
    overflow-x: hidden;
}

.forest-bg {
    position: fixed;
    inset: 0;
    z-index: -4;
    background:
        radial-gradient(circle at 12% 15%, rgba(255,255,255,.95), transparent 8%),
        radial-gradient(circle at 86% 12%, rgba(255,242,145,.75), transparent 10%),
        linear-gradient(135deg, #8ee99e, #d9ffe3, #ffffff);
}

.leaf {
    position: fixed;
    z-index: -1;
    font-size: clamp(2rem, 5vw, 4.5rem);
    animation: leafFloat 6s infinite ease-in-out;
    opacity: .75;
}

.leaf1 { top: 18%; left: 4%; }
.leaf2 { top: 28%; right: 5%; animation-delay: 1s; }
.leaf3 { bottom: 18%; left: 6%; animation-delay: 2s; }
.leaf4 { bottom: 15%; right: 6%; animation-delay: 3s; }

@keyframes leafFloat {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-25px) rotate(10deg); }
}

.navbar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: min(1160px, calc(100% - 30px));
    padding: 14px 20px;
    border-radius: 999px;
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 38px rgba(20,90,40,.18);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.logo {
    font-weight: 900;
    color: #166534;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: #166534;
    font-weight: 900;
    padding: 8px 12px;
    border-radius: 999px;
}

.nav-links a:hover {
    background: #166534;
    color: white;
}

.hero {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 120px 20px 70px;
    text-align: center;
}

.hero-card {
    width: min(1050px, 100%);
    padding: clamp(32px, 6vw, 70px);
    border-radius: 42px;
    background: rgba(255,255,255,.68);
    border: 3px solid rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 70px rgba(20,90,40,.22);
}

.badge {
    display: inline-block;
    margin-bottom: 20px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #e5ffdc;
    color: #166534;
    font-weight: 900;
    border: 2px dashed #22c55e;
}

.hero h1 {
    font-size: clamp(3rem, 9vw, 7.6rem);
    line-height: .95;
    color: #166534;
    text-shadow: 4px 4px 0 #ffffff;
    margin-bottom: 22px;
}

.subtitle {
    max-width: 860px;
    margin: 0 auto 30px;
    font-size: clamp(1.15rem, 2.6vw, 1.55rem);
    line-height: 1.6;
    font-weight: 800;
    color: #31543b;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 15px 24px;
    border-radius: 999px;
    font-weight: 900;
    transition: .25s;
    box-shadow: 0 12px 25px rgba(20,90,40,.18);
}

.btn:hover {
    transform: translateY(-5px) scale(1.03);
}

.primary {
    background: linear-gradient(135deg, #15803d, #22c55e);
    color: white;
}

.secondary {
    background: white;
    color: #166534;
}

main {
    width: min(1200px, calc(100% - 32px));
    margin: auto;
}

.author-card,
.overview,
.lesson,
.final-quiz,
.signature {
    margin: 38px auto;
    padding: clamp(26px, 4vw, 46px);
    border-radius: 36px;
    background: rgba(255,255,255,.8);
    border: 3px solid rgba(255,255,255,.94);
    box-shadow: 0 22px 50px rgba(20,90,40,.15);
    backdrop-filter: blur(12px);
}

.author-card {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 22px;
    align-items: center;
}

.earth {
    width: 90px;
    height: 90px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #84cc16);
    font-size: 3rem;
    box-shadow: 0 12px 25px rgba(20,90,40,.22);
}

.author-card h2,
.overview h2,
.final-quiz h2,
.signature h2 {
    color: #166534;
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.overview-grid,
.ecosystem-split,
.roles-grid,
.animals-grid {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.overview-grid {
    grid-template-columns: repeat(3, 1fr);
}

.ecosystem-split {
    grid-template-columns: repeat(2, 1fr);
}

.roles-grid,
.animals-grid {
    grid-template-columns: repeat(3, 1fr);
}

.overview-grid div,
.ecosystem-split article,
.roles-grid article,
.animals-grid article {
    padding: 24px;
    border-radius: 26px;
    background: linear-gradient(135deg, #ffffff, #ecffe8);
    border: 2px solid #cbf7cc;
    text-align: center;
    transition: .25s;
}

.overview-grid div:hover,
.ecosystem-split article:hover,
.roles-grid article:hover,
.animals-grid article:hover {
    transform: translateY(-7px);
    box-shadow: 0 18px 32px rgba(20,90,40,.14);
}

.overview-grid span,
.ecosystem-split span,
.roles-grid span,
.animals-grid span {
    display: block;
    font-size: 3rem;
    margin-bottom: 10px;
}

.overview-grid h3,
.ecosystem-split h3,
.roles-grid h3,
.animals-grid h4 {
    color: #166534;
    margin-bottom: 8px;
}

.lesson-title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 25px;
}

.lesson-title span {
    min-width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(135deg, #15803d, #22c55e);
    color: white;
    font-size: 2.2rem;
    font-weight: 900;
}

.lesson-title p {
    color: #15803d;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.lesson-title h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    color: #166534;
}

.info-box,
.example-card,
.cycle-card,
.oak-card {
    padding: 24px;
    border-radius: 26px;
    background: #ffffff;
    border-left: 8px solid #22c55e;
    margin-bottom: 24px;
}

.info-box h3,
.example-card h3,
.cycle-card h3,
.oak-card h3,
.forest-layers h3,
.animals-section h3,
.remember h3,
.quiz-card h3 {
    color: #166534;
    margin-bottom: 12px;
}

.info-box p,
.example-card p,
.ecosystem-split p,
.roles-grid p,
.cycle-card p,
.forest-layer p,
.animals-grid p,
.oak-card p,
.remember li {
    line-height: 1.72;
    font-weight: 700;
    color: #31543b;
}

.diagram,
.food-chain,
.forest-layers,
.animals-section,
.remember,
.quiz-card {
    margin-top: 24px;
    padding: 26px;
    border-radius: 30px;
    background: rgba(255,255,255,.84);
    border: 2px solid rgba(34,197,94,.16);
}

.two-parts {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 14px;
    text-align: center;
}

.two-parts div {
    width: 240px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, #15803d, #22c55e);
    color: white;
}

.two-parts span {
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 900;
}

.food-chain {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 14px;
    flex-wrap: wrap;
}

.food-chain div {
    width: 170px;
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff, #ecffe8);
    text-align: center;
    border: 2px solid #cbf7cc;
}

.food-chain div span {
    display: block;
    font-size: 3rem;
    margin-bottom: 10px;
}

.food-chain h3 {
    color: #166534;
}

.food-chain p {
    color: #31543b;
    font-weight: 800;
}

.arrow {
    display: grid;
    place-items: center;
    font-size: 2rem;
}

.forest-layer {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 18px;
    margin: 16px 0;
    padding: 22px;
    border-radius: 26px;
    color: white;
}

.forest-layer span {
    font-size: 3.5rem;
    display: grid;
    place-items: center;
}

.forest-layer h4 {
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.forest-layer p {
    color: white;
}

.canopy { background: linear-gradient(135deg, #14532d, #16a34a); }
.shrubs { background: linear-gradient(135deg, #166534, #22c55e); }
.herbs { background: linear-gradient(135deg, #65a30d, #bef264); color: #17351f; }
.herbs p { color: #17351f; }
.soil { background: linear-gradient(135deg, #713f12, #a16207); }

.remember ul {
    padding-left: 20px;
}

.remember li {
    margin: 8px 0;
}

.quiz-card {
    background: #fbfffa;
}

.question {
    margin: 20px 0;
    padding: 20px;
    border-radius: 22px;
    background: white;
    border: 2px solid #cbf7cc;
}

.question p {
    font-weight: 900;
    color: #31543b;
    margin-bottom: 12px;
}

.question button {
    margin: 6px;
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
    cursor: pointer;
    transition: .2s;
}

.question button:hover {
    transform: translateY(-3px);
    background: #bbf7d0;
}

.question button.correct {
    background: #22c55e;
    color: white;
}

.question button.wrong {
    background: #ef4444;
    color: white;
}

.quiz-result,
#totalScore {
    margin-top: 14px;
    font-size: 1.25rem;
    font-weight: 900;
    color: #166534;
}

#totalScoreBtn {
    margin-top: 16px;
    padding: 15px 24px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #15803d, #22c55e);
    color: white;
    font-weight: 900;
    cursor: pointer;
    font-size: 1rem;
}

.signature {
    text-align: center;
}

.signature p {
    font-size: 1.2rem;
    margin: 8px 0;
    color: #31543b;
}

footer {
    text-align: center;
    padding: 35px 20px 50px;
    color: #166534;
    font-weight: 900;
}

@media (max-width: 980px) {
    .overview-grid,
    .ecosystem-split,
    .roles-grid,
    .animals-grid {
        grid-template-columns: 1fr;
    }

    .author-card,
    .forest-layer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .earth {
        margin: auto;
    }

    .navbar {
        border-radius: 26px;
        flex-direction: column;
    }
}
