:root {
    --yellow-accent: #FFD93D;
    --background-light: #ffffff;
    --background-dark: #121212;
    --text-light: #000000;
    --text-dark: #f0f0f0;
}

html, body {
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Helvetica Neue", sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light Mode */
html:not(.dark-mode) body {
    background-color: var(--background-light);
    color: var(--text-light);
}

/* Dark Mode */
html.dark-mode body {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

html.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

html.dark-mode .navbar {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Navbar */
.navbar {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--yellow-accent);
}

/* Nav Links */
.nav-links {
    display: flex;
    background-color: rgba(255, 255, 255, 0.6); /* Desktop background */
    backdrop-filter: blur(10px);
    transition: background-color 0.4s ease, max-height 0.5s ease-in-out;
    position: static;
    top: 100%;
    left: 0;
    right: 0;
    overflow: hidden;
    max-height: none;
}

.nav-links.open {
    max-height: 500px;
}

.nav-links a {
    margin-left: 2rem;
    text-decoration: none;
    font-weight: 500;
    color: inherit;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    height: 2.5rem;
}

.nav-links a:hover {
    color: var(--yellow-accent);
}

/* Theme Toggle Button */
.theme-toggle-button {
    background: none;
    border: 2px solid var(--yellow-accent);
    color: var(--yellow-accent);
    font-size: 1.2rem;
    padding: 0.4rem 0.8rem;
    margin-left: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    vertical-align: middle;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
}

.theme-toggle-button:hover {
    background-color: var(--yellow-accent);
    color: #222;
}

/* Dark Mode Nav Links */
html.dark-mode .nav-links {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

/* Hamburger (hidden on desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    height: 3px;
    width: 100%;
    background-color: var(--text-light);
    border-radius: 4px;
    transition: all 0.3s ease;
}

html.dark-mode .bar {
    background-color: var(--text-dark);
}

/* Animation for open menu (bars turn into X) */
body.nav-open .bar.top {
    transform: translateY(9px) rotate(45deg);
}

body.nav-open .bar.middle {
    opacity: 0;
}

body.nav-open .bar.bottom {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile View */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: 0;
        overflow: hidden;
        transition: background-color 0.4s ease, max-height 0.5s ease-in-out;
    }

    .nav-links.open {
        max-height: 500px;
    }

    html.dark-mode .nav-links {
        background-color: rgba(0, 0, 0, 0.85);
    }

    .nav-links a, .nav-links button {
        margin: 1rem 0;
    }

    .theme-toggle-button {
        margin: 1rem 0 0 0;
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
    }
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30rem 4rem 9rem;
    min-height: auto; /* FIX: no 100vh */
    position: relative;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.hero-text h1 .highlight {
    color: var(--yellow-accent);
}

.hero-text p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.outline-button {
    display: inline-block;
    border: 2px solid var(--yellow-accent);
    padding: 0.75rem 1.5rem;
    margin-right: 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}

.outline-button:hover {
    background-color: var(--yellow-accent);
    color: #222;
}

/* Hero Background */
.hero-background {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-background {
        display: none;
    }
}

.hero-hand {
    font-size: 28rem;
    opacity: 0.07;
    position: absolute;
    right: 10%;
    top: 5%;
    pointer-events: none;
    animation: waveHand 3s infinite ease-in-out;
    transform-origin: bottom center;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 15rem 2rem 7rem;
        min-height: auto;
    }

    .hero-background {
        display: none;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero-hand {
        font-size: 10rem; /* even smaller */
        right: 0;
        left: 0;
        margin: auto;
        opacity: 0.05; /* fainter to look nicer */
        transform: none;
    }
}

/* Animations */
@keyframes waveHand {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(20deg); }
}

.fade-in {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInRise 1s forwards;
}

.fade-in-slow {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInRise 2s forwards;
}

@keyframes fadeInRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mission Section */
.mission-section, .timeline-section {
    padding: 6rem 2rem;
    text-align: center;
}

/* Timeline Section */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    background: var(--yellow-accent);
    color: #222;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Module Section */
.module-section {
    padding: 6rem 2rem;
    text-align: center;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 2rem;
}

.module-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 2px solid var(--yellow-accent);
    border-radius: 16px;
    padding: 2rem;
    height: 220px; /* ✨ Uniform height */
    max-width: 320px; /* ✨ Don't stretch too wide on mobile */
    margin: 0 auto; /* ✨ Center them properly */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition:
        background-color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.3s ease,
        transform 0.4s ease;
}
/* Reset all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .module-section {
        padding: 0 1rem;
        text-align: center;
    }

    .module-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0;
    }

    .module-card, .lesson-card {
        width: 100%; /* yes, 100% now */
        max-width: 400px; /* cap the max width */
        margin: 1rem auto;
    }
}

.module-card:hover {
    transform: translateY(-12px) scale(1.00);
    box-shadow: 0 12px 24px rgba(255, 217, 61, 0.3);
    border-color: var(--yellow-accent);
}

html.dark-mode .module-card {
    background: rgba(18, 18, 18, 0.9);
}

html.dark-mode .module-card:hover {
    background: rgba(30, 30, 30, 0.95);
}

.module-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.module-card p {
    font-size: 1rem;
    line-height: 1.4;
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--yellow-accent);
}

.module-lessons {
    padding: 6rem 2rem;
    text-align: center;
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 2rem auto 0;
}

.lesson-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 2px solid var(--yellow-accent);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: background-color 0.4s ease, transform 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(255, 217, 61, 0.3);
}

html.dark-mode .lesson-card {
    background: rgba(18, 18, 18, 0.9);
}

html.dark-mode .lesson-card:hover {
    background: rgba(30, 30, 30, 0.95);
}

.lesson-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.lesson-card p {
    font-size: 1rem;
}

.module-page {
    padding: 6rem 2rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.module-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.module-page p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.module-page .outline-button {
    margin-top: 1.5rem;
}

.progress-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 4rem auto 2rem;
    height: 8px;
    background-color: rgba(200, 200, 200, 0.4);
    border-radius: 10px;
    overflow: visible; /* Changed from hidden to visible */
}

html.dark-mode .progress-container {
    background-color: rgba(100, 100, 100, 0.5);
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%; /* Controlled by JavaScript */
    background-color: var(--yellow-accent);
    transition: width 0.6s ease;
}

.progress-dots {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0; /* REMOVE horizontal padding for exact alignment */
    align-items: center;
}

.dot {
    background-color: #bbb;
    border-radius: 50%;
    transition: background-color 0.4s ease, transform 0.4s ease;
}

.dot.small {
    width: 12px;
    height: 12px;
}

.dot.big {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 6px rgba(255, 217, 61, 0.6);
}

.dot.completed {
    background-color: var(--yellow-accent);
}

@media (max-width: 768px) {
    .module-card, .lesson-card {
        width: 90%;
        max-width: none;
        margin: 1rem auto;
    }
}

.lesson-card {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 2px solid var(--yellow-accent);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: background-color 0.4s ease, transform 0.3s ease;
    color: inherit; /* Prevent blue links */
    max-width: 320px;
    margin: 0 auto;
    height: 220px;
}

.lesson-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(255, 217, 61, 0.3);
}

html.dark-mode .lesson-card {
    background: rgba(18, 18, 18, 0.9);
}

html.dark-mode .lesson-card:hover {
    background: rgba(30, 30, 30, 0.95);
}

.lesson-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-card p {
    font-size: 1rem;
    line-height: 1.4;
}

.input_video {
    transform: scaleX(-1); /* Flip horizontally like a mirror */
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 4 / 3;
    margin: 1rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
.input_video,
.output_canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 12px;
    pointer-events: none; /* 🔥 This is the key line */
}      

/* Mobile-specific adjustment */
@media (max-width: 768px) {
    .camera-container {
        position: relative;
        width: 100%;
        max-width: 640px;
        aspect-ratio: 4 / 3;
        margin: 1rem auto;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      
      .input_video,
      .output_canvas {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        border-radius: 12px;
        pointer-events: none; /* 🔥 This is the key line */
      }      
}

/* Start Camera Button */
.start-btn {
    border: 2px solid var(--yellow-accent);
    background-color: transparent;
    color: var(--yellow-accent);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
  }
  
  .start-btn:hover {
    background-color: var(--yellow-accent);
    color: #222;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(255, 217, 61, 0.2);
  }
  
  html.dark-mode .start-btn {
    color: var(--yellow-accent);
    background-color: rgba(18, 18, 18, 0.4);
  }
  
  html.dark-mode .start-btn:hover {
    background-color: var(--yellow-accent);
    color: #121212;
  }  