@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Permanent+Marker&family=Cabin+Sketch:wght@700&display=swap');

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

html {
    font-size: 75%;
    /* Global zoom out */
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: #F8F8F8;
    color: #2C3E50;
    overflow-x: hidden;
    position: relative;
}

/* Random Background Sketches Container - stays behind everything */
.sketch-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Spot It Doodles Container - visible above section bg but below content */
.spot-it-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Robot Drawing Trails Container - visible on top */
.robot-trail-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.sketch-line {
    fill: none;
    stroke: #ffadad;
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0.3;
}

/* Robot drawing trail */
.robot-trail {
    stroke: #2C3E50;
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

/* Robot Element */
.robot-element {
    position: absolute;
    width: clamp(60px, 10vw, 120px);
    height: clamp(60px, 10vw, 120px);
    pointer-events: none;
    z-index: 50;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: robotFloat 3s ease-in-out infinite;
    object-fit: contain;
    display: none;
}

@keyframes robotFloat {

    0%,
    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(-50%, -50%) rotate(5deg);
    }
}

/* Navigation - Modern Floating Pill Style with Cartoony Border */
#nav {
    position: sticky;
    top: 1rem;
    /* Float above page */
    background: white;
    padding: clamp(0.5rem, 1vw, 0.8rem) clamp(1rem, 3vw, 2rem);
    /* Reduced padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-radius: 50px;
    /* Pill shape */
    max-width: 1700px;
    /* Increased from 1000px */
    margin: 0 auto;
    width: calc(100% - 4rem);
    /* Breathing room on sides */
    box-shadow: 4px 4px 0px #2C3E50;
    /* Cartoony offset shadow - reduced */
    border: 4px solid #2C3E50;
    /* Thick cartoony border */
    transition: all 0.3s ease;
    transform: rotate(0deg);
}


.logo {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: #2C3E50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: rotate(-1deg);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.main-title {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(4rem, 15vw, 8rem);
    color: #2C3E50;
    margin-bottom: 2rem;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.15);
    animation: titleBounce 1.2s ease-out;
    letter-spacing: 0.05em;
}

@keyframes titleBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-5deg);
    }

    50% {
        transform: scale(1.05) rotate(2deg);
    }

    70% {
        transform: scale(0.95) rotate(-1deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.logo-img {
    height: 50px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    mix-blend-mode: multiply;
    /* Makes white background transparent */
}

.logo-img:hover {
    transform: scale(1.05) rotate(2deg);
}

.main-logo {
    width: clamp(300px, 60vw, 600px);
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(4px 6px 8px rgba(0, 0, 0, 0.15));
    animation: logoBounce 1.2s ease-out;
    mix-blend-mode: multiply;
    /* Makes white background transparent */
}

@keyframes logoBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-5deg);
    }

    50% {
        transform: scale(1.05) rotate(2deg);
    }

    70% {
        transform: scale(0.9) rotate(-1deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}


.nav-links {
    display: flex;
    gap: clamp(0.8rem, 2vw, 1.5rem);
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    font-family: 'Cabin Sketch', cursive;
    color: #2C3E50;
    text-decoration: none;
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    font-weight: bold;
    transition: all 0.3s;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 8" preserveAspectRatio="none"><path d="M0,4 Q5,1 10,4 T20,4 T30,4 T40,4 T50,4 T60,4 T70,4 T80,4 T90,4 T100,4" stroke="%23ffadad" stroke-width="2.5" fill="none" stroke-linecap="round"/></svg>');
    background-repeat: repeat-x;
    background-size: 100% 100%;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.nav-links a:hover {
    color: #ffadad;
    transform: rotate(2deg) scale(1.1);
}

.nav-links li.active a {
    color: #ffadad;
}

.nav-links a.active {
    color: #ffadad;
}

.nav-links li.active a::after,
.nav-links a.active::after {
    transform: translateX(-50%) scaleX(1);
    animation: cuteWiggle 0.6s ease-in-out;
}

@keyframes cuteWiggle {

    0%,
    100% {
        transform: translateX(-50%) scaleX(1) rotate(0deg);
    }

    25% {
        transform: translateX(-50%) scaleX(1) rotate(-2deg);
    }

    75% {
        transform: translateX(-50%) scaleX(1) rotate(2deg);
    }
}

/* Hamburger Menu Styles */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
    transition: transform 0.3s ease;
}

.hamburger span {
    width: 30px;
    height: 4px;
    background: #2C3E50;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger:hover {
    transform: scale(1.1);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Intro Section */
#intro {
    position: relative;
    min-height: 105vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 5% 15rem;
    z-index: 5;
    background: transparent;
    width: 100%;
    margin: 0;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }

    50% {
        transform: scale(1.05) rotate(2deg);
    }

    70% {
        transform: scale(0.9) rotate(-1deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(1.5rem, 3.5vw, 1.8rem);
    margin-bottom: 2rem;
    color: #2C3E50;
    max-width: 700px;
    line-height: 1.8;
    animation: fadeSlideUp 1s ease-out 0.3s both;
}

.subtitle strong {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2em;
    color: #000000;
    display: block;
    margin-bottom: 0.5rem;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.cta-button {
    font-family: 'Cabin Sketch', cursive;
    background: #ffadad;
    color: #FFF;
    padding: clamp(1rem, 2vw, 1.2rem) clamp(2rem, 4vw, 3rem);
    border: 4px solid #2C3E50;
    border-radius: 0;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    box-shadow: 6px 6px 0px #2C3E50;
    transform: rotate(-1deg);
}

.cta-button:hover {
    transform: rotate(1deg) translateY(-4px);
    box-shadow: 8px 8px 0px #2C3E50;
    background: #ffd6a5;
}

/* Main Content Wrapper - keeping content centered inside full-width sections */
.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 5%;
    position: relative;
    z-index: 5;
}

/* Updated Full Width Sections */
#design,
#features,
#system,
#gallery,
#final-system-section {
    width: 100%;
    margin: 0;
    padding: 4rem 0 5rem;
    position: relative;
}

/* Wave Divider Styling */
.wave-divider {
    display: block;
    width: 100%;
    height: 120px;
    line-height: 0;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 10;
    overflow: hidden;
    pointer-events: none;
}

/* Position dividers at top of sections */
.wave-divider.top {
    top: -1px;
    /* Slight overlap */
    transform: translateY(-99%);
    /* Move it up to sit on top */
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Wave Colors (Fill matches the section ABOVE it) */
.fill-intro {
    fill: #caffbf;
}

.fill-light-blue {
    fill: #E8F4F8;
}

.fill-pink {
    fill: #F0E6F6;
}

.fill-blue {
    fill: #E3F2E1;
}

.fill-lavender {
    fill: #FFF4E6;
}

.fill-orange {
    fill: #FFE8E8;
}

.fill-yellow {
    fill: #FFF9C4;
}

/* The black stroke for the wave */
.wave-line {
    fill: none;
    stroke: #2C3E50;
    stroke-width: 4;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

/* About Project Section */
#about-project {
    background: #FFF9C4;
    /* Light Yellow */
    padding-top: 2rem;
    padding-bottom: 8rem;
    position: relative;
    z-index: 1;
    overflow: visible;
    scroll-margin-top: 130px;
}

.drawing-clipper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}

.section-doodles-container {
    width: 100%;
    height: 100%;
    display: block;
}

.side-drawing {
    position: absolute;
    width: 350px;
    /* Slightly larger */
    opacity: 0.1;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.side-drawing.left {
    left: -40px;
    /* Came in from -80px */
    top: 50%;
    transform: translateY(-50%) rotate(-15deg);
}

.side-drawing.right {
    right: -40px;
    /* Came in from -80px */
    top: 50%;
    transform: translateY(-50%) rotate(15deg);
}

#about-project .content-wrapper,
#system .content-wrapper,
#bom .content-wrapper,
#more-info .content-wrapper {
    max-width: 1400px;
    position: relative;
    z-index: 20;
}

#final-system-section .content-wrapper,
#design .content-wrapper {
    max-width: 1000px;
    position: relative;
    z-index: 20;
}

/* Project Overview Grid Layout */
.project-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
    align-items: start;
}

/* Mobile responsive for grid */
@media (max-width: 768px) {
    .project-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* Left Column Styles */
.project-left-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-goal-card {
    background: #fff;
    padding: 1.5rem;
    border: 3px solid #FBC02D;
    /* Darker yellow */
    border-radius: 12px;
    box-shadow: 4px 4px 0 rgba(251, 192, 45, 0.4);
    transform: rotate(-1deg);
}

.project-goal-card h3 {
    font-family: 'Permanent Marker', cursive;
    color: #FBC02D;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.project-goal-card p {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.5rem;
    color: #2C3E50;
    line-height: 1.5;
}

.project-robot-image-container {
    background: #fff;
    padding: 1rem;
    border: 3px solid #2C3E50;
    border-radius: 12px;
    transform: rotate(1deg);
    text-align: center;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.project-robot-img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
}

.img-caption {
    font-family: 'Cabin Sketch', cursive;
    color: #888;
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Right Column Styles (Steps) */
.project-steps-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    border: 3px solid #2C3E50;
    box-shadow: 4px 4px 0 rgba(44, 62, 80, 0.2);
    transition: transform 0.2s;
}

.step-card:hover {
    transform: translateX(5px);
}

.step-number {
    background: #FFADAD;
    color: white;
    font-family: 'Permanent Marker', cursive;
    font-size: 1.8rem;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid #2C3E50;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Specific colors for steps */
.step-card:nth-child(2) .step-number {
    background: #FFD6A5;
}

.step-card:nth-child(3) .step-number {
    background: #FDFFB6;
    color: #555;
}

.step-card:nth-child(4) .step-number {
    background: #CAFFBF;
    color: #555;
}

.step-content h4 {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.4rem;
    color: #2C3E50;
    margin-bottom: 0.3rem;
}

.step-content p {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.4rem;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

#final-system-section {
    background: #E8F4F8;
    padding-top: 3rem;
    padding-bottom: 6rem;
    position: relative;
    z-index: 2;
}

/* Design Section */
#design {
    background: #F0E6F6;
    padding: 1rem 0 6rem 0;
    position: relative;
    z-index: 4;
}

/* Features Section */
#features {
    background: #E3F2E1;
    padding: 3rem 0 6rem 0;
    position: relative;
    z-index: 3;
}

/* Features content wrapper should be full width for stats marquee */
#features .content-wrapper {
    max-width: 100%;
    padding: 0;
}

/* But keep title centered with padding */
#features .section-title {
    padding: 0 5%;
}

/* System Section */
#system {
    background: #FFF4E6;
    padding: 3rem 0 6rem 0;
    position: relative;
    z-index: 5;
}

/* Gallery Section */
#gallery {
    background: #FFE8E8;
    padding: 3rem 0 3rem 0;
    position: relative;
    z-index: 6;
}

/* Gallery content wrapper should be full width */
#gallery .content-wrapper {
    max-width: 100%;
    padding: 0;
}

/* Bill of Materials Section */
#bom {
    background: #E8F4F8;
    padding: 3rem 0 6rem 0;
    position: relative;
    z-index: 7;
}

.bom-intro {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.6rem;
    color: #555;
    text-align: center;
    margin-bottom: 3rem;
}

.bom-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.bom-category {
    background: white;
    border: 3px solid #2C3E50;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 4px 4px 0 rgba(44, 62, 80, 0.2);
}

.bom-category h3 {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.8rem;
    color: #2C3E50;
    margin-bottom: 1rem;
    text-align: center;
}

.bom-table {
    width: 100%;
    border-collapse: collapse;
}

.bom-table thead {
    background: #f8f9fa;
}

.bom-table th {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.2rem;
    color: #2C3E50;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #2C3E50;
}

.bom-table td {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.3rem;
    color: #555;
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.bom-table tbody tr:hover {
    background: #f8f9fa;
}

/* Featured Post */
.featured-post {
    background: #FFF;
    padding: clamp(1rem, 4vw, 2rem);
    border: 3px solid #5A7C9E;
    box-shadow: 0 4px 12px rgba(90, 124, 158, 0.15);
    margin-bottom: 3rem;
    transform: rotate(0deg);
    border-radius: 12px;
}

.featured-post header {
    margin-bottom: 2rem;
}

.video-container {
    max-width: 80%;
    margin: 0 auto 2rem auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #000;
}

.featured-post h2 {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: #5A7C9E;
    margin-bottom: 0.8rem;
}

.featured-post p {
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    line-height: 1.7;
    color: #2C3E50;
}

.image-container {
    margin: 2rem 0;
}

.placeholder-image {
    background: #D4E4F7;
    border: 2px solid #5A7C9E;
    padding: clamp(2rem, 8vw, 4rem);
    text-align: center;
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 1rem;
    border-radius: 12px;
}

.caption {
    font-size: 1.1rem;
    font-style: italic;
    color: #666;
}

/* Section Styling */
.section-content {
    position: relative;
    padding: 3rem 0;
    z-index: 5;
}

.section-title {
    font-family: 'Permanent Marker', cursive;
    text-align: center;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    margin-bottom: 3rem;
    color: #2C3E50;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 5px;
    background: linear-gradient(90deg, #7B68EE, #9B7EDE);
    border-radius: 3px;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.post-card {
    background: #FFF;
    padding: clamp(1.5rem, 4vw, 2rem);
    border: 3px solid #9B7EDE;
    box-shadow: 0 4px 12px rgba(155, 126, 222, 0.2);
    transition: all 0.3s;
    cursor: pointer;
    transform: rotate(-1deg);
    border-radius: 12px;
}

.post-card:nth-child(even) {
    transform: rotate(1deg);
    box-shadow: 0 4px 12px rgba(155, 126, 222, 0.2);
}

.post-card:hover {
    transform: translateY(-8px) rotate(0deg);
    box-shadow: 0 8px 24px rgba(155, 126, 222, 0.3);
}

.post-card h3 {
    font-family: 'Cabin Sketch', cursive;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
    color: #7B68EE;
}

.card-image {
    background: #E8DFF5;
    border: 2px solid #9B7EDE;
    padding: clamp(2rem, 6vw, 3rem);
    text-align: center;
    margin: 1.5rem 0;
    border-radius: 10px;
}

.emoji-placeholder {
    font-size: clamp(3rem, 8vw, 4rem);
    animation: wiggle 2s infinite;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

.post-card p {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #2C3E50;
}

.card-button {
    font-family: 'Cabin Sketch', cursive;
    background: #7B68EE;
    color: #FFFFFF;
    padding: 0.8rem 2rem;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 3px 8px rgba(123, 104, 238, 0.3);
    border-radius: 8px;
    text-decoration: none;
}

.card-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(123, 104, 238, 0.4);
    background: #6A5ACD;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: #FFF;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 3px solid #66BB6A;
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.2);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    transform: rotate(-1deg);
    border-radius: 12px;
}

.feature-card:nth-child(even) {
    transform: rotate(1deg);
    box-shadow: 0 4px 12px rgba(102, 187, 106, 0.2);
}

.feature-card:hover {
    transform: translateY(-8px) rotate(0deg);
    box-shadow: 0 8px 24px rgba(102, 187, 106, 0.3);
}

.feature-icon {
    font-size: clamp(3rem, 8vw, 4rem);
    margin-bottom: 1rem;
    display: block;
    animation: wiggle 2s infinite;
}

.feature-card h3 {
    font-family: 'Cabin Sketch', cursive;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
    color: #4CAF50;
}

.feature-card p {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    line-height: 1.8;
    color: #2C3E50;
}

/* System Diagram */
.system-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
}

.system-box {
    background: #FFF;
    border: 3px solid #FF9F66;
    padding: 2rem;
    text-align: center;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(255, 159, 102, 0.2);
    border-radius: 12px;
}

.system-box h4 {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #FF8C42;
}

.system-box p {
    font-size: 1.4rem;
    color: #2C3E50;
}

.arrow {
    font-size: 2rem;
    color: #FF9F66;
    font-weight: bold;
}

/* Wavy Section Break */
.wavy-section-break {
    width: 100vw;
    height: 150px;
    /* Thicker wave as requested */
    background: url('data:image/svg+xml;utf8,<svg preserveAspectRatio="none" viewBox="0 0 100 30" xmlns="http://www.w3.org/2000/svg"><path d="M0 15 Q 25 0, 50 15 T 100 15 V 30 H 0 Z" fill="black"/><path d="M0 15 Q 25 30, 50 15 T 100 15 V 0 H 0 Z" fill="black"/></svg>') repeat-x center;
    background-size: 100px 150px;
    /* Make wave repeat and fit height */
    position: relative;
    overflow: hidden;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* CSS Clip-Path Wave Section Break */
.wave-section-break {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Top wave - clips the bottom edge */
.wave-section-break.wave-top {
    clip-path: polygon(0% 0%, 0% 65%,
            1.69492% 66.8293%, 3.38983% 68.6385%, 5.08475% 70.4078%, 6.77966% 72.1179%,
            8.47458% 73.75%, 10.1695% 75.2862%, 11.8644% 76.7098%, 13.5593% 78.005%,
            15.2542% 79.1578%, 16.9492% 80.1555%, 18.6441% 80.987%, 20.339% 81.6435%,
            22.0339% 82.1176%, 23.7288% 82.4041%, 25.4237% 82.5%, 27.1186% 82.4041%,
            28.8136% 82.1176%, 30.5085% 81.6435%, 32.2034% 80.987%, 33.8983% 80.1555%,
            35.5932% 79.1578%, 37.2881% 78.005%, 38.9831% 76.7098%, 40.678% 75.2862%,
            42.3729% 73.75%, 44.0678% 72.1179%, 45.7627% 70.4078%, 47.4576% 68.6385%,
            49.1525% 66.8293%, 50.8475% 65%, 52.5424% 63.1708%, 54.2373% 61.3616%,
            55.9322% 59.5922%, 57.6271% 57.8821%, 59.322% 56.25%, 61.017% 54.7138%,
            62.7119% 53.2902%, 64.4068% 51.995%, 66.1017% 50.8422%, 67.7966% 49.8446%,
            69.4915% 49.013%, 71.1864% 48.3565%, 72.8814% 47.8824%, 74.5763% 47.5959%,
            76.2712% 47.5%, 77.9661% 47.5959%, 79.661% 47.8824%, 81.3559% 48.3565%,
            83.0509% 49.013%, 84.7458% 49.8446%, 86.4407% 50.8422%, 88.1356% 51.995%,
            89.8305% 53.2902%, 91.5254% 54.7138%, 93.2203% 56.25%, 94.9153% 57.8821%,
            96.6102% 59.5922%, 98.3051% 61.3616%, 100% 63.1708%,
            100% 0%);
}

/* Bottom wave - clips the top edge */
.wave-section-break.wave-bottom {
    clip-path: polygon(0% 100%, 0% 35%,
            1.69492% 33.1708%, 3.38983% 31.3616%, 5.08475% 29.5922%, 6.77966% 27.8821%,
            8.47458% 26.25%, 10.1695% 24.7138%, 11.8644% 23.2902%, 13.5593% 21.995%,
            15.2542% 20.8422%, 16.9492% 19.8446%, 18.6441% 19.013%, 20.339% 18.3565%,
            22.0339% 17.8824%, 23.7288% 17.5959%, 25.4237% 17.5%, 27.1186% 17.5959%,
            28.8136% 17.8824%, 30.5085% 18.3565%, 32.2034% 19.013%, 33.8983% 19.8446%,
            35.5932% 20.8422%, 37.2881% 21.995%, 38.9831% 23.2902%, 40.678% 24.7138%,
            42.3729% 26.25%, 44.0678% 27.8821%, 45.7627% 29.5922%, 47.4576% 31.3616%,
            49.1525% 33.1708%, 50.8475% 35%, 52.5424% 36.8293%, 54.2373% 38.6385%,
            55.9322% 40.4078%, 57.6271% 42.1179%, 59.322% 43.75%, 61.017% 45.2862%,
            62.7119% 46.7098%, 64.4068% 48.005%, 66.1017% 49.1578%, 67.7966% 50.1555%,
            69.4915% 50.987%, 71.1864% 51.6435%, 72.8814% 52.1176%, 74.5763% 52.4041%,
            76.2712% 52.5%, 77.9661% 52.4041%, 79.661% 52.1176%, 81.3559% 51.6435%,
            83.0509% 50.987%, 84.7458% 50.1555%, 86.4407% 49.1578%, 88.1356% 48.005%,
            89.8305% 46.7098%, 91.5254% 45.2862%, 93.2203% 43.75%, 94.9153% 42.1179%,
            96.6102% 40.4078%, 98.3051% 38.6385%, 100% 36.8293%,
            100% 100%);
}

/* IMPROVED: Layered Stacking Wave Approach */
/* Each section with .wave-section class gets a wave attached to its TOP */
/* The wave extends UPWARD into the section above */
.wave-section {
    position: relative;
    width: 100%;
    overflow: visible;
    z-index: auto;
    isolation: isolate;
}

/* Base wave - smaller height */
.wave-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    /* Reduced from 120px */
    background: inherit;
    z-index: 1;
    transform: translateY(-100%);
}

/* Intro should never have a wave (it's the first section) */
#intro::before {
    display: none !important;
}

/* About Project wave - smooth gentle waves for yellow section */
#about-project.wave-section::before {
    clip-path: polygon(0% 100%, 0% 40%,
            5% 37%, 10% 35%, 15% 34%, 20% 34%, 25% 35%,
            30% 37%, 35% 40%, 40% 43%, 45% 45%, 50% 46%,
            55% 45%, 60% 43%, 65% 40%, 70% 37%, 75% 35%,
            80% 34%, 85% 34%, 90% 35%, 95% 37%, 100% 40%,
            100% 100%);
}

/* Wave Variation 1 - Gentle waves */
#final-system-section.wave-section::before {
    clip-path: polygon(0% 100%, 0% 45%,
            2% 43%, 4% 41%, 6% 39.5%, 8% 38.5%, 10% 38%,
            12% 38%, 14% 38.5%, 16% 39.5%, 18% 41%, 20% 43%,
            22% 45%, 24% 47%, 26% 49%, 28% 50.5%, 30% 51.5%,
            32% 52%, 34% 52%, 36% 51.5%, 38% 50.5%, 40% 49%,
            42% 47%, 44% 45%, 46% 43%, 48% 41%, 50% 39.5%,
            52% 38.5%, 54% 38%, 56% 38%, 58% 38.5%, 60% 39.5%,
            62% 41%, 64% 43%, 66% 45%, 68% 47%, 70% 49%,
            72% 50.5%, 74% 51.5%, 76% 52%, 78% 52%, 80% 51.5%,
            82% 50.5%, 84% 49%, 86% 47%, 88% 45%, 90% 43%,
            92% 41%, 94% 39.5%, 96% 38.5%, 98% 38%, 100% 38%,
            100% 100%);
}

/* Wave Variation 2 - Medium waves */
#design.wave-section::before {
    clip-path: polygon(0% 100%, 0% 40%,
            3% 37%, 6% 35%, 9% 34%, 12% 33.5%, 15% 34%,
            18% 35%, 21% 37%, 24% 40%, 27% 43%, 30% 46%,
            33% 48%, 36% 49%, 39% 49%, 42% 48%, 45% 46%,
            48% 43%, 51% 40%, 54% 37%, 57% 35%, 60% 34%,
            63% 33.5%, 66% 34%, 69% 35%, 72% 37%, 75% 40%,
            78% 43%, 81% 46%, 84% 48%, 87% 49%, 90% 49%,
            93% 48%, 96% 46%, 99% 43%, 100% 40%,
            100% 100%);
}

/* Wave Variation 3 - Sharper waves */
#features.wave-section::before {
    clip-path: polygon(0% 100%, 0% 42%,
            4% 38%, 8% 35%, 12% 33%, 16% 32%, 20% 33%,
            24% 35%, 28% 38%, 32% 42%, 36% 46%, 40% 49%,
            44% 51%, 48% 51%, 52% 49%, 56% 46%, 60% 42%,
            64% 38%, 68% 35%, 72% 33%, 76% 32%, 80% 33%,
            84% 35%, 88% 38%, 92% 42%, 96% 46%, 100% 49%,
            100% 100%);
}

/* Wave Variation 4 - Smooth rolling waves */
#system.wave-section::before,
#gallery.wave-section::before,
#bom.wave-section::before,
#more-info.wave-section::before {
    clip-path: polygon(0% 100%, 0% 43%,
            5% 40%, 10% 38%, 15% 37%, 20% 37%, 25% 38%,
            30% 40%, 35% 43%, 40% 46%, 45% 48%, 50% 49%,
            55% 48%, 60% 46%, 65% 43%, 70% 40%, 75% 38%,
            80% 37%, 85% 37%, 90% 38%, 95% 40%, 100% 43%,
            100% 100%);
}

/* Wave border strokes - follows the wave path exactly */
.wave-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 2;
    transform: translateY(-100%);
    pointer-events: none;
}

/* Border for About Project wave */
#about-project.wave-section::after {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 80" preserveAspectRatio="none"><path d="M 0,32 C 5,29.6 10,28 15,27.2 C 20,27.2 25,28 30,29.6 C 35,32 40,34.4 45,36 C 50,36.8 55,36 60,34.4 C 65,32 70,29.6 75,28 C 80,27.2 85,27.2 90,28 C 95,29.6 100,32 100,32" stroke="%23333" stroke-width="2" fill="none" vector-effect="non-scaling-stroke"/></svg>') no-repeat;
    background-size: 100% 100%;
}

/* Border for Wave Variation 1 - Gentle waves */
#final-system-section.wave-section::after {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 80" preserveAspectRatio="none"><path d="M 0,36 C 2,34.4 4,32.8 6,31.6 C 8,30.8 10,30.4 12,30.4 C 14,30.8 16,31.6 18,32.8 C 20,34.4 22,36 24,37.6 C 26,39.2 28,40.4 30,41.2 C 32,41.6 34,41.6 36,41.2 C 38,40.4 40,39.2 42,37.6 C 44,36 46,34.4 48,32.8 C 50,31.6 52,30.8 54,30.4 C 56,30.4 58,30.8 60,31.6 C 62,32.8 64,34.4 66,36 C 68,37.6 70,39.2 72,40.4 C 74,41.2 76,41.6 78,41.6 C 80,41.2 82,40.4 84,39.2 C 86,37.6 88,36 90,34.4 C 92,32.8 94,31.6 96,30.8 C 98,30.4 100,30.4 100,30.4" stroke="%23333" stroke-width="2" fill="none" vector-effect="non-scaling-stroke"/></svg>') no-repeat;
    background-size: 100% 100%;
}

/* Border for Wave Variation 2 - Medium waves */
#design.wave-section::after {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 80" preserveAspectRatio="none"><path d="M 0,32 C 3,29.6 6,28 9,27.2 C 12,26.8 15,27.2 18,28 C 21,29.6 24,32 27,34.4 C 30,36.8 33,38.4 36,39.2 C 39,39.2 42,38.4 45,36.8 C 48,34.4 51,32 54,29.6 C 57,28 60,27.2 63,26.8 C 66,27.2 69,28 72,29.6 C 75,32 78,34.4 81,36.8 C 84,38.4 87,39.2 90,39.2 C 93,38.4 96,36.8 99,34.4 C 100,32 100,32 100,32" stroke="%23333" stroke-width="2" fill="none" vector-effect="non-scaling-stroke"/></svg>') no-repeat;
    background-size: 100% 100%;
}

/* Border for Wave Variation 3 - Sharper waves */
#features.wave-section::after {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 80" preserveAspectRatio="none"><path d="M 0,33.6 C 4,30.4 8,28 12,26.4 C 16,25.6 20,26.4 24,28 C 28,30.4 32,33.6 36,36.8 C 40,39.2 44,40.8 48,40.8 C 52,39.2 56,36.8 60,33.6 C 64,30.4 68,28 72,26.4 C 76,25.6 80,26.4 84,28 C 88,30.4 92,33.6 96,36.8 C 100,39.2 100,39.2 100,39.2" stroke="%23333" stroke-width="2" fill="none" vector-effect="non-scaling-stroke"/></svg>') no-repeat;
    background-size: 100% 100%;
}

/* Border for Wave Variation 4 - Smooth rolling waves */
#system.wave-section::after,
#gallery.wave-section::after,
#bom.wave-section::after,
#more-info.wave-section::after {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 80" preserveAspectRatio="none"><path d="M 0,34.4 C 5,32 10,30.4 15,29.6 C 20,29.6 25,30.4 30,32 C 35,34.4 40,36.8 45,38.4 C 50,39.2 55,38.4 60,36.8 C 65,34.4 70,32 75,30.4 C 80,29.6 85,29.6 90,30.4 C 95,32 100,34.4 100,34.4" stroke="%23333" stroke-width="2" fill="none" vector-effect="non-scaling-stroke"/></svg>') no-repeat;
    background-size: 100% 100%;
}


/* Squiggly Border - Smooth sine wave style */
.squiggly-border {
    width: 100vw;
    height: 40px;
    background: url('data:image/svg+xml;utf8,<svg preserveAspectRatio="none" viewBox="0 0 300 40" xmlns="http://www.w3.org/2000/svg"><path d="M0,20 Q75,5 150,20 T300,20" stroke="%232C3E50" stroke-width="4" fill="none" stroke-linecap="round"/></svg>') repeat-x center;
    background-size: 300px 40px;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

#final-system {
    background: #e8f5ff;
    /* A different background for this specific section */
    margin-top: 3rem;
    /* Add margin to this section instead of the wavy break */
}

/* Gallery */
.gallery-intro {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    text-align: center;
    margin-bottom: 2rem;
    color: #2C3E50;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    aspect-ratio: 1;
    background: #FFE0E0;
    border: 3px solid #FF8A8A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(3rem, 10vw, 5rem);
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 138, 138, 0.2);
    animation: popIn 0.5s ease-out forwards;
    opacity: 0;
    transform: scale(0) rotate(-10deg);
    border-radius: 12px;
}

.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-item:nth-child(2) {
    animation-delay: 0.2s;
}

.gallery-item:nth-child(3) {
    animation-delay: 0.3s;
}

.gallery-item:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-item:nth-child(5) {
    animation-delay: 0.5s;
}

.gallery-item:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.gallery-item:hover {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 8px 24px rgba(255, 138, 138, 0.3);
}

/* Footer */
#copyright {
    background: #2C3E50;
    padding: 3rem 5%;
    text-align: center;
    position: relative;
    z-index: 1;
}

#copyright p {
    font-family: 'Cabin Sketch', cursive;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin: 0.5rem 0;
    color: #FFFFFF;
}

/* Responsive Design */
@media (max-width: 768px) {
    #nav {
        overflow: visible;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
    }

    .logo {
        flex: 1;
        text-align: left;
        display: flex;
        align-items: center;
        transform: rotate(0deg);
        margin: 0;
        line-height: 1;
    }

    .hamburger {
        display: flex;
        flex: 0 0 auto;
        align-self: center;
        margin: 0;
    }

    .nav-links {
        order: 3;
        width: 100%;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin-top: 1rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
        background: transparent;
    }

    .nav-links.active {
        max-height: 400px;
        opacity: 1;
        padding: 1.5rem 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        font-size: 1.4rem;
        display: block;
        padding: 0.5rem;
    }

    .system-diagram {
        flex-direction: column;
    }

    .arrow {
        transform: rotate(90deg);
    }
}

/* Preload state */
body.is-preload #intro {
    opacity: 0;
}

/* Video Container - Responsive YouTube Embed */
.video-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 2rem auto;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: #000;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-description {
    font-size: clamp(1.4rem, 3vw, 1.7rem);
    line-height: 1.8;
    color: #2C3E50;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Gallery Grid */
.gallery-intro {
    font-size: clamp(1.4rem, 3vw, 1.7rem);
    line-height: 1.8;
    color: #2C3E50;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    padding: 0 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.gallery-item {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Specific sizing for Features Robot as requested */
#robot-features {
    width: clamp(40px, 7vw, 90px);
    height: clamp(40px, 7vw, 90px);
}

/* Stats Marquee Styles */
.stats-marquee-container {
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.stats-track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: scrollStats 40s linear infinite;
    padding-left: 3rem;
}

.stats-track:hover {
    animation-play-state: paused;
}

@keyframes scrollStats {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-20% - 1rem));
    }
}

.stat-card {
    background: white;
    border: 3px solid #7B68EE;
    border-radius: 16px;
    padding: 2rem 3rem;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0 rgba(123, 104, 238, 0.2);
    transform: rotate(-1deg);
    transition: transform 0.3s ease;
}

.stat-card:nth-child(even) {
    transform: rotate(1deg);
    border-color: #FFADAD;
    box-shadow: 4px 4px 0 rgba(255, 173, 173, 0.2);
}

.stat-card:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 10;
}

.stat-number {
    font-family: 'Permanent Marker', cursive;
    font-size: 3rem;
    color: #2C3E50;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.stat-label {
    font-family: 'Cabin Sketch', cursive;
    font-size: 1.5rem;
    color: #555;
    text-align: center;
    white-space: nowrap;
}

/* More Info Section */
#more-info {
    background: #F0F4C3;
    padding-top: 2rem;
    padding-bottom: 5rem;
    position: relative;
    z-index: 8;
}

#more-info .section-title {
    margin-bottom: 2rem;
}

.info-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: #2C3E50;
    border: 3px solid #2C3E50;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-card:hover {
    transform: translateY(-5px) rotate(-1deg);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.8rem;
    margin: 1rem 0 0.5rem 0;
    color: #2C3E50;
}

.info-card p {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.5rem;
    color: #666;
    margin: 0;
}

.info-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.1));
}

.info-icon-img {
    height: 80px;
    width: auto;
    max-width: 120px;
    display: block;
    margin-bottom: 1rem;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}