body {
    /* darken the background image with a gradient layer for better contrast */
    background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)), url("images/background.png") no-repeat center center fixed;
    background-size: cover;
    color: #fffbe7;
    /* reduce glow to keep letters crisp */
    text-shadow: 0 1px 0 rgba(0,0,0,0.7);
    font-family: 'Comic Sans MS', 'Press Start 2P', cursive, sans-serif;
    letter-spacing: 0.2px;
    font-size: 1.05rem;
    margin: 0;
    padding: 2rem;
    line-height: 1.5;
}

header,
section {
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
    /* cartoon panels: warm paper color + thick dark outline */
    background: #fffef5;
    color: #222;
    padding: 1.4rem 1.6rem;
    border-radius: 20px;
    border: 8px solid #2e2e2e;
    box-shadow: 12px 12px 0 rgba(0,0,0,0.12), 0 10px 30px rgba(0,0,0,0.18);
    transform: perspective(600px) translateZ(0);
}

/* slight playfulness: every even section is slightly rotated like a hand-placed card */
section:nth-of-type(even) {
    transform: rotate(-1deg);
}
section:nth-of-type(odd) {
    transform: rotate(0.6deg);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: color 0.25s ease, text-shadow 0.25s, transform 0.2s;
    color: #ffd54a;
    /* thick 'stroke' effect for cartoon title */
    text-shadow: 6px 6px 0 #2e2e2e, -2px -2px 0 #2e2e2e, 0 0 18px rgba(255,181,71,0.6);
    font-family: 'Comic Sans MS', 'Press Start 2P', cursive, sans-serif;
    letter-spacing: 2px;
    border-radius: 20px 60px 20px 60px/60px 20px 60px 20px;
    background: rgba(255,255,255,0.08);
    padding: 1rem 0;
}

header h1:hover {
    color: #ffb347;
    text-shadow: 6px 6px 0 #2e2e2e, 0 0 30px #ffe066;
}

.intro p {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.language-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end;
    gap: 0.5rem;
    width: auto;
}

.language-switch button {
    background: #C7181A;
    color: #F4F1DE;
    border: none;
    padding: 0.5rem 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, transform 0.2s;
    margin: 0;
}

.language-switch button:hover {
    background: #A01518;
    transform: translateX(-8px) scale(1.05);
}

.language-switch button.active {
    background: #7A1012;
    color: #fff;
    cursor: default;
    pointer-events: none;
    transition: background 0.3s, color 0.3s;
}

.language-switch button.active:hover {
    background: #7A1012;
    color: #fff;
    transform: scale(1.08);
}

#badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: center;
}

.badge {
    background: linear-gradient(135deg, #ffe066 60%, #ffb347 100%);
    border-radius: 26px;
    box-shadow: 18px 18px 0 rgba(0,0,0,0.14), 0 0 0 8px #2e2e2e inset;
    padding: 1.2rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 220px;
    min-width: 180px;
    max-width: 220px;
    box-sizing: border-box;
    border: 6px solid #2e2e2e;
    margin-bottom: 1.5rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.badge:hover {
    transform: rotate(-2deg) scale(1.04);
    box-shadow: 0 12px 32px 0 #2e2e2ecc, 0 0 0 6px #ffe066 inset;
}

.badge img {
    max-width: 150px;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.badge:hover img,
.badge a:hover img {
    transform: scale(1.05);
}

.badge-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2e2e2e;
    text-shadow: 3px 3px 0 #ffe066;
    font-family: 'Comic Sans MS', 'Press Start 2P', cursive, sans-serif;
    letter-spacing: 1px;
}

.badge-desc {
    font-size: 0.9rem;
    color: #2e2e2e;
    text-align: center;
    text-shadow: 1px 1px 0 #ffe066;
    font-family: 'Comic Sans MS', 'Press Start 2P', cursive, sans-serif;
}

/* h2 ribbon style */
section h2 {
    display: inline-block;
    position: relative;
    background: #ffb347;
    color: #2e2e2e;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 1.25rem;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.12);
    margin: 0.4rem auto 1rem;
    border: 4px solid #2e2e2e;
}

section h2::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ffd54a;
    border: 4px solid #2e2e2e;
    border-radius: 2px;
}

section ul {
    list-style: none;
    padding: 0;
    background: rgba(255,255,255,0.07);
    border-radius: 20px;
    box-shadow: 0 2px 8px #2e2e2e33;
    border: 2px dashed #ffe066;
    margin-bottom: 2rem;
}

section li {
    margin: 0.5rem 0;
}

a {
    color: #2e2e2e;
    text-decoration: underline wavy #ffe066;
    position: relative;
    transition: color 0.2s, text-shadow 0.2s;
    font-weight: bold;
    text-shadow: 1px 1px 0 #ffe066;
}

a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: #C7181A;
    transform: scaleX(0);
    transition: transform 0.2s ease;
    transform-origin: left;
}

a:hover {
    color: #ffb347;
    text-shadow: 2px 2px 0 #2e2e2e, 0 0 10px #ffe066;
}

a:hover::after {
    transform: scaleX(1);
}

#events {
    text-align: left;
}
#future-projects {
    text-align: left;
}

#events h2 {
    text-align: center;
}

.section-separator {
    width: 60%;
    height: 8px;
    background: repeating-linear-gradient(90deg, #ffe066, #ffe066 20px, #ffb347 20px, #ffb347 40px);
    margin: 3rem auto;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px #2e2e2e55;
}

.section-separator::before {
    content: '🍍';
    display: block;
    text-align: center;
    color: #ffe066;
    font-size: 2rem;
    background: transparent;
    width: 40px;
    margin: -22px auto 0;
    padding: 0 5px;
}

/* Footer Styles */
footer {
    max-width: 800px;
    margin: 4rem auto 2rem;
    padding: 2rem 0;
    border-top: 6px dotted #ffe066;
    text-align: center;
    background: rgba(255,255,255,0.08);
    border-radius: 30px 60px 30px 60px/60px 30px 60px 30px;
    box-shadow: 0 2px 8px #2e2e2e33;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-links a {
    color: #F4F1DE;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(199, 24, 26, 0.1);
}

.social-links a::after {
    display: none;
}

.social-links a:hover {
    color: #C7181A;
    transform: translateY(-2px);
    background: rgba(199, 24, 26, 0.2);
}

.social-links svg {
    width: 24px;
    height: 24px;
}

.footer-info p {
    font-size: 0.8rem;
    margin: 0.5rem 0;
    color: #2e2e2e;
    opacity: 0.9;
    text-shadow: 1px 1px 0 #ffe066;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .footer-info {
        text-align: right;
    }
}

/* Mobile: ensure same fonts and readable, remove rotations and scale panels */
@media (max-width: 767px) {
    body {
        font-family: 'Comic Sans MS', 'Press Start 2P', cursive, sans-serif;
        font-size: 1rem;
        letter-spacing: 0.2px;
        padding: 1rem;
    }

    header, section, footer {
        margin: 1rem 0;
        padding: 0.9rem 1rem;
        border-width: 6px;
        border-radius: 12px;
        box-shadow: 8px 8px 0 rgba(0,0,0,0.12);
        transform: none !important; /* remove card rotations on mobile */
    }

    header h1 {
        font-size: 1.6rem;
        letter-spacing: 1px;
        padding: 0.6rem 0;
        text-shadow: 4px 4px 0 #2e2e2e, 0 0 12px rgba(255,181,71,0.5);
    }

    .language-switch {
        top: 12px;
        right: 12px;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.4rem;
    }

    .language-switch button {
        font-size: 0.65rem;
        padding: 0.4rem 0.6rem;
    }

    #badges {
        gap: 0.8rem;
        justify-content: center;
    }

    .badge {
        width: 160px;
        max-width: 160px;
        border-width: 4px;
        padding: 0.8rem;
    }

    .badge img {
        max-width: 120px;
    }

    section ul {
        border-width: 2px;
        padding: 0.6rem;
    }

    section h2 {
        font-size: 1.1rem;
        padding: 0.3rem 0.8rem;
    }

    .footer-info {
        font-size: 0.75rem;
        text-align: center;
    }

    /* make links slightly larger and touch-friendly */
    a {
        font-size: 1rem;
        padding: 4px 2px;
    }
}
