/* ===== CSS Variables ===== */
:root {
    --festival-primary: #27ae60;
    --festival-secondary: #1e8449;
    --festival-light: #e8f8f0;
    --festival-gradient: linear-gradient(135deg, #27ae60 0%, #1e8449 50%, #196f3d 100%);
    --festival-gradient-soft: linear-gradient(135deg, #e8f8f0 0%, #d5f5e3 100%);
    --text-dark: #1a1a2e;
    --text-body: #2d2d44;
    --text-muted: #6b6b80;
    --bg-page: #f5f3ef;
    --bg-card: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ===== Top Bar ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 48px;
    background: #1a1a2e;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar .brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color var(--transition);
}

.top-bar .brand:hover {
    color: var(--festival-primary);
}

.top-bar .course-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Lesson Hero ===== */
.lesson-hero {
    background: var(--festival-gradient);
    padding: 80px 24px 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lesson-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
    pointer-events: none;
}

.lesson-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.lesson-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 8px 24px;
    border-radius: 50px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

.lesson-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Lesson Nav Bar ===== */
.lesson-nav-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.nav-pill {
    display: inline-block;
    padding: 8px 20px;
    background: var(--bg-card);
    color: var(--text-body);
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-pill:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--festival-primary);
}

.nav-pill.next {
    background: var(--festival-primary);
    color: #fff;
    border-color: var(--festival-primary);
}

.nav-pill.next:hover {
    background: var(--festival-secondary);
    color: #fff;
}

/* ===== Content Wrapper ===== */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 24px 48px;
}

/* ===== Objectives Card ===== */
.objectives-card {
    background: linear-gradient(135deg, #eef4fb 0%, #e8f0fe 100%);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid rgba(66, 133, 244, 0.15);
    box-shadow: var(--shadow-sm);
}

.objectives-card .objectives-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a56db;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.objectives-card .objectives-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.objectives-card .objectives-list li {
    padding-left: 28px;
    position: relative;
    font-size: 0.95rem;
    color: #2d3748;
    line-height: 1.5;
}

.objectives-card .objectives-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #4285f4;
    background: rgba(66, 133, 244, 0.08);
}

/* ===== Content Section ===== */
.content-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 36px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow var(--transition);
    animation: fadeInUp 0.5s ease both;
}

.content-section:hover {
    box-shadow: var(--shadow-md);
}

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

.content-section:nth-child(2) { animation-delay: 0.05s; }
.content-section:nth-child(3) { animation-delay: 0.1s; }
.content-section:nth-child(4) { animation-delay: 0.15s; }
.content-section:nth-child(5) { animation-delay: 0.2s; }
.content-section:nth-child(6) { animation-delay: 0.25s; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--festival-light);
}

.section-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--festival-gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.section-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.content-section p {
    margin-bottom: 14px;
    font-size: 0.97rem;
    color: var(--text-body);
    line-height: 1.75;
}

.content-section ul {
    list-style: none;
    margin-bottom: 16px;
}

.content-section ul li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.7;
}

.content-section ul li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--festival-primary);
    opacity: 0.6;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding: 8px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--festival-primary), var(--festival-secondary));
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    padding-left: 52px;
    margin-bottom: 28px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 8px;
    top: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--festival-primary);
    z-index: 1;
    transition: all var(--transition);
}

.timeline-item:hover .timeline-marker {
    background: var(--festival-primary);
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.2);
}

.timeline-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--festival-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.timeline-content {
    background: var(--festival-light);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    border: 1px solid rgba(39, 174, 96, 0.12);
    transition: all var(--transition);
}

.timeline-item:hover .timeline-content {
    border-color: rgba(39, 174, 96, 0.3);
    box-shadow: var(--shadow-sm);
}

.timeline-content h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.timeline-content p {
    font-size: 0.92rem;
    margin-bottom: 0;
    color: var(--text-body);
}

/* ===== Info Callout ===== */
.info-callout {
    background: var(--festival-gradient-soft);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 20px 0;
    border-left: 4px solid var(--festival-primary);
    font-size: 0.95rem;
}

.info-callout strong {
    color: var(--festival-secondary);
}

/* ===== Source Quote ===== */
.source-quote {
    border-left: 4px solid var(--festival-primary);
    padding: 20px 24px;
    margin: 24px 0;
    background: linear-gradient(135deg, #f0faf4 0%, #e8f8f0 100%);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    position: relative;
}

.source-quote::before {
    content: '\201C';
    position: absolute;
    top: -4px;
    left: 16px;
    font-size: 3rem;
    color: var(--festival-primary);
    opacity: 0.3;
    font-style: normal;
    line-height: 1;
}

.source-quote p {
    font-size: 1rem;
    color: var(--text-body);
    margin-bottom: 8px;
    padding-left: 20px;
}

.source-quote .quote-attribution {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: normal;
    font-weight: 600;
    padding-left: 20px;
}

/* ===== Detail Grid ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0;
}

.detail-card {
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition);
}

.detail-card:hover {
    border-color: rgba(39, 174, 96, 0.25);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.detail-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--festival-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-body);
    line-height: 1.6;
}

/* ===== Terms Section ===== */
.terms-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 36px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.terms-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terms-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.term-chip {
    display: inline-block;
    padding: 8px 18px;
    background: var(--festival-light);
    color: var(--festival-secondary);
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid rgba(39, 174, 96, 0.2);
    cursor: default;
    transition: all var(--transition);
    user-select: none;
}

.term-chip:hover {
    background: var(--festival-primary);
    color: #fff;
    border-color: var(--festival-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* ===== Bottom Nav ===== */
.bottom-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 32px 24px 48px;
    max-width: 900px;
    margin: 0 auto;
}

.bottom-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.bottom-nav-btn.primary {
    background: var(--festival-gradient);
    color: #fff;
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
}

.bottom-nav-btn.primary:hover {
    box-shadow: 0 6px 24px rgba(39, 174, 96, 0.45);
    transform: translateY(-2px);
}

.bottom-nav-btn.secondary {
    background: var(--bg-card);
    color: var(--text-body);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-sm);
}

.bottom-nav-btn.secondary:hover {
    border-color: var(--festival-primary);
    color: var(--festival-primary);
    transform: translateY(-2px);
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #1a1a2e;
}

.site-footer p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .lesson-hero {
        padding: 56px 20px 48px;
    }

    .lesson-hero h1 {
        font-size: 2rem;
    }

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

    .content-wrapper {
        padding: 8px 16px 32px;
    }

    .content-section {
        padding: 24px 20px;
    }

    .objectives-card {
        padding: 24px 20px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .bottom-nav {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 16px 40px;
    }

    .bottom-nav-btn {
        justify-content: center;
    }

    .timeline::before {
        left: 14px;
    }

    .timeline-item {
        padding-left: 44px;
    }

    .timeline-marker {
        left: 5px;
        width: 20px;
        height: 20px;
    }

    .terms-section {
        padding: 24px 20px;
    }

    .section-header h2 {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 0 16px;
    }

    .top-bar .course-label {
        font-size: 0.7rem;
    }

    .lesson-hero h1 {
        font-size: 1.65rem;
    }

    .lesson-badge {
        font-size: 0.95rem;
        padding: 6px 18px;
    }

    .nav-pill {
        font-size: 0.82rem;
        padding: 6px 14px;
    }
}
