/* MS2 Labs - DEPT-inspired Design System */

:root {
    /* Color Palette */
    --bg: #F6F8F9;
    --panel: #FFFFFF;
    --text: #0B0B0C;
    --dim: #5B636B;
    --brand: #5D97AA;
    --tan: #D8C7A3;
    --line: #E1E5E8;
    --tint: #E9F2F5;
    --mist: #F0F2F4;

    /* Typography */
    --font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;

    /* Spacing */
    --container-max: 1200px;
    --section-padding: 64px 20px;
    --card-radius: 16px;
    --btn-radius: 9999px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(6px);
    -webkit-backdrop-filter: saturate(180%) blur(6px);
    border-bottom: 1px solid var(--line);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Nav logo */
.logo {
    display: inline-flex;
    align-items: center;
}

.logo img {
    height: 64px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    font-size: 14px;
    color: var(--text);
    transition: color 0.2s ease;
}

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

.nav-contact {
    border: 1px solid rgba(11, 11, 12, 0.15);
    padding: 8px 16px;
    border-radius: var(--btn-radius);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu a {
    font-size: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.hidden {
    display: none !important;
}

/* Section Label */
.section-label {
    color: var(--dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Hero Section */
.hero {
    padding: 80px 20px 60px;
}

.hero .container {
    padding: 0;
}

.hero-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: center;
}

.hero-content {
    text-align: center;
    max-width: 900px;
}

.hero h1 {
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.04;
    letter-spacing: -2px;
    font-weight: 800;
    margin-bottom: 24px;
}

/* Word reveal animation for hero title */
.hero h1 .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero h1.revealed .word {
    opacity: 1;
    transform: translateY(0);
}

.hero-description {
    color: var(--dim);
    font-size: 20px;
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* CTAs */
.cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--btn-radius);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cta-solid {
    background: var(--brand);
    color: #FFFFFF;
}

.cta-solid:hover {
    background: #4d8799;
}

.cta-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--brand);
}

.cta-outline:hover {
    background: var(--tint);
}

/* Hero Carousel */
.hero-visuals {
    position: relative;
    width: 100%;
    max-width: 1000px;
}

.hero-carousel {
    width: 100%;
    height: 450px;
    border-radius: var(--card-radius);
    overflow: hidden;
    position: relative;
    background: var(--tint);
}

.hero-carousel .carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-carousel .carousel-item.active {
    opacity: 1;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stats Stripe */
.stats-stripe {
    background: var(--tint);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    text-align: center;
}

.stat-value {
    font-weight: 800;
    font-size: 18px;
    color: var(--text);
}

.stat-label {
    font-size: 14px;
    color: var(--dim);
    text-transform: lowercase;
}

/* About Section */
.about-section {
    padding: var(--section-padding);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.section-heading {
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.5px;
    font-weight: 800;
}

.section-description {
    color: var(--dim);
    font-size: 18px;
    line-height: 1.6;
}

/* Companies Section */
.companies-section {
    padding: var(--section-padding);
    background: var(--mist);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-header {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    margin-bottom: 32px;
    align-items: end;
}

.companies-carousel-wrapper {
    overflow: hidden;
    position: relative;
}

.companies-carousel {
    display: flex;
    gap: 20px;
    padding: 10px 0;
}

.company-card {
    flex-shrink: 0;
    width: 200px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.company-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.company-card img {
    height: 48px;
    width: auto;
    margin: 0 auto 12px;
    object-fit: contain;
}

.company-card .company-url {
    font-size: 12px;
    color: var(--dim);
}

/* Makerspace Section */
.makerspace-section {
    padding: var(--section-padding);
}

.makerspace-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: start;
}

.makerspace-content .section-heading {
    margin-bottom: 16px;
}

.makerspace-logo-link {
    display: inline-block;
    margin-bottom: 20px;
}

.makerspace-logo {
    height: 32px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.makerspace-logo-link:hover .makerspace-logo {
    opacity: 1;
}

.makerspace-content .section-description {
    margin-bottom: 20px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.tag {
    display: inline-block;
    padding: 8px 14px;
    background: var(--tan);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--btn-radius);
    border: 1px solid rgba(11, 11, 12, 0.05);
}

.big-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid rgba(11, 11, 12, 0.15);
    padding-bottom: 6px;
    transition: color 0.2s ease;
}

.big-link:hover {
    color: var(--brand);
}

.makerspace-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-card {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: var(--mist);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--brand);
}

.feature-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.feature-body {
    font-size: 14px;
    color: var(--dim);
}

/* Events Section */
.events-section {
    padding: var(--section-padding);
    background: var(--tint);
}

.section-header-center {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 40px;
}

.section-header-center .section-heading {
    margin-bottom: 12px;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.event-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.event-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--brand);
    margin-bottom: 10px;
}

.event-title {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 8px;
}

.event-description {
    font-size: 14px;
    color: var(--dim);
    margin-bottom: 16px;
    line-height: 1.5;
}

.event-card .big-link {
    font-size: 14px;
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--dim);
}

/* Contact Section */
.contact-section {
    padding: var(--section-padding);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--brand);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--text);
    color: #FFFFFF;
    border: none;
    border-radius: var(--btn-radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    width: fit-content;
}

.submit-btn:hover {
    background: #333;
}

.form-message {
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-top: 16px;
}

.form-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.form-error {
    background: #FFEBEE;
    color: #C62828;
}

/* Footer */
.footer {
    background: var(--mist);
    border-top: 1px solid var(--line);
    padding: 28px 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copyright {
    font-size: 14px;
    color: var(--dim);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--brand);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-content {
    background: var(--panel);
    border-radius: var(--card-radius);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 800;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--dim);
    line-height: 1;
}

.close-btn:hover {
    color: var(--text);
}

#rsvpForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#rsvpForm input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
}

#rsvpForm input:focus {
    border-color: var(--brand);
}

#rsvpForm .submit-btn {
    width: 100%;
    margin-top: 8px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-carousel {
        height: 300px;
    }

    .about-grid,
    .section-header,
    .makerspace-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

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

    .mobile-menu-btn {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .hero h1 {
        font-size: 32px;
    }

    .section-heading {
        font-size: 24px;
    }
}

/* DEPT-style Scroll Animations */

/* Base state for animated elements */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for child elements */
.scroll-reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.scroll-reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.scroll-reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }

.scroll-reveal-stagger.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in only */
.scroll-fade {
    opacity: 0;
    transition: opacity 1s ease;
}

.scroll-fade.revealed {
    opacity: 1;
}

/* Scale up effect */
.scroll-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Section label slide in */
.section-label {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-label.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Stats counter animation */
.stat {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stats-stripe.revealed .stat:nth-child(1) { transition-delay: 0s; }
.stats-stripe.revealed .stat:nth-child(2) { transition-delay: 0.15s; }
.stats-stripe.revealed .stat:nth-child(3) { transition-delay: 0.3s; }

.stats-stripe.revealed .stat {
    opacity: 1;
    transform: translateY(0);
}

/* Event cards stagger */
.events-grid .event-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.events-grid.revealed .event-card:nth-child(1) { transition-delay: 0s; }
.events-grid.revealed .event-card:nth-child(2) { transition-delay: 0.1s; }
.events-grid.revealed .event-card:nth-child(3) { transition-delay: 0.2s; }
.events-grid.revealed .event-card:nth-child(4) { transition-delay: 0.3s; }
.events-grid.revealed .event-card:nth-child(5) { transition-delay: 0.4s; }
.events-grid.revealed .event-card:nth-child(6) { transition-delay: 0.5s; }

.events-grid.revealed .event-card {
    opacity: 1;
    transform: translateY(0);
}

/* Feature cards */
.feature-card {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.makerspace-features.revealed .feature-card:nth-child(1) { transition-delay: 0.1s; }
.makerspace-features.revealed .feature-card:nth-child(2) { transition-delay: 0.25s; }

.makerspace-features.revealed .feature-card {
    opacity: 1;
    transform: translateX(0);
}

/* Legacy animation for backwards compatibility */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Logo Carousel Animation */
@keyframes scrollLogos {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.companies-carousel.animate {
    animation: scrollLogos 30s linear infinite;
}

.companies-carousel:hover {
    animation-play-state: paused;
}
