/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:wght@400;700&display=swap');

/* CSS Variables for Theme Colors */
:root {
    /* Design Tokens - Light Mode */
    /* Base Colors */
    --bg: #F7EFE7;           /* Beige-Paper: warm background */
    --ink: #1F2224;          /* Charcoal: primary text */
    --brand: #BA0C2F;        /* Rail Rose: primary brand color */
    --accent: #D1A65A;       /* Brass: highlights and accents */
    --muted: #75797D;        /* Rail Steel: secondary text */
    --panel: #FFF9F3;        /* Porcelain: cards and panels */
    --success: #2FA36B;      /* Leaf: success states */
    --warning: #E9A23B;      /* Amber: warning states */

    /* Applied Colors */
    --bg-primary: var(--bg);
    --bg-secondary: var(--panel);
    --bg-hero: linear-gradient(135deg, var(--brand) 0%, #8B0A24 100%);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --text-light: var(--muted);
    --border-color: rgba(117, 121, 125, 0.2);
    --accent-primary: var(--brand);
    --accent-secondary: var(--accent);
    --card-bg: var(--panel);
    --card-shadow: 0 4px 6px rgba(31, 34, 36, 0.08);
    --nav-bg: rgba(255, 249, 243, 0.95);
    --btn-primary-bg: var(--brand);
    --btn-primary-text: var(--panel);
    --btn-secondary-bg: transparent;
    --btn-secondary-border: var(--brand);
    --btn-secondary-text: var(--brand);
}

/* Dark Mode Colors */
.dark-mode {
    /* Design Tokens - Dark Mode */
    --bg: #0F1113;           /* Iron: dark background */
    --ink: #EAECEE;          /* Mist: light text */
    --panel: #1A1D1F;        /* Darker panel for cards */

    /* Applied Colors */
    --bg-primary: var(--bg);
    --bg-secondary: var(--panel);
    --bg-hero: linear-gradient(135deg, #8B0A24 0%, #6B0818 100%);
    --text-primary: var(--ink);
    --text-secondary: #B8BABC;
    --text-light: #9A9C9E;
    --border-color: rgba(234, 236, 238, 0.1);
    --accent-primary: #E01E3E;      /* Lighter version for dark mode */
    --accent-secondary: #D1A65A;    /* Brass stays same */
    --card-bg: var(--panel);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    --nav-bg: rgba(26, 29, 31, 0.95);
    --btn-primary-bg: #E01E3E;
    --btn-primary-text: var(--ink);
    --btn-secondary-bg: transparent;
    --btn-secondary-border: #E01E3E;
    --btn-secondary-text: #E01E3E;
}

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

html {
    scroll-behavior: smooth;
}

/* Scroll Animation Styles */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger delays for cards */
.fade-in:nth-child(1) { transition-delay: 0s; }
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }
.fade-in:nth-child(5) { transition-delay: 0.4s; }
.fade-in:nth-child(6) { transition-delay: 0.5s; }

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 9999;
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(186, 12, 47, 0.3);
}

/* Animated Background Gradients */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(2deg);
    }
    50% {
        transform: translateY(0px) rotate(0deg);
    }
    75% {
        transform: translateY(20px) rotate(-2deg);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background: linear-gradient(-45deg, var(--bg-primary), var(--bg-secondary), var(--bg-primary), var(--panel));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.navbar {
    padding: 1rem 0;
}

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

.nav-brand {
    flex: 1 1 0;
    min-width: 200px;
    text-align: left;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: #753bbd;
    margin: 0;
}

.nav-brand .logo {
    height: 70px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    flex: 1 1 0;
    justify-content: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--accent-primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex: 1 1 0;
    min-width: 200px;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    border-radius: 50%;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
}

.sun-icon {
    display: none;
}

.dark-mode .sun-icon {
    display: block;
}

.dark-mode .moon-icon {
    display: none;
}

.btn-join {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(186, 12, 47, 0.3);
}

.btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(186, 12, 47, 0.4);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

/* Hero Section */
.hero {
    margin-top: 80px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Decorative background gradient behind hero */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(186, 12, 47, 0.1), transparent 50%),
                radial-gradient(circle at bottom left, rgba(209, 166, 90, 0.1), transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.hero-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-primary);
    position: relative;
    z-index: 2;
    min-height: 220px;
}

.hero-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: 65% center;
}

.hero-video-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-primary);
    position: relative;
    z-index: 2;
}

.hero-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    pointer-events: none;
    z-index: 3;
}

.hero-content {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    color: #ffffff;
    pointer-events: auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    color: var(--accent-gold);
}

/* Large screens - scale up hero text */
@media (min-width: 1200px) {
    .hero-content {
        bottom: 3rem;
        left: 3rem;
    }

    .hero-title {
        font-size: 4rem;
    }

    .hero-tagline {
        font-size: 1.8rem;
    }
}

@media (min-width: 1600px) {
    .hero-video {
        max-height: 700px;
    }

    .hero-content {
        bottom: 4rem;
        left: 4rem;
    }

    .hero-title {
        font-size: 5rem;
    }

    .hero-tagline {
        font-size: 2.2rem;
    }
}

/* Sections */
.section {
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

/* Decorative background shapes */
.section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    opacity: 0.03;
    border-radius: 50%;
    pointer-events: none;
    animation: floatAnimation 8s ease-in-out infinite;
}

/* Wave divider at top of section */
.section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--bg-primary);
    clip-path: polygon(
        0 0,
        100% 0,
        100% 40%,
        95% 50%,
        90% 45%,
        85% 50%,
        80% 55%,
        75% 50%,
        70% 45%,
        65% 50%,
        60% 55%,
        55% 50%,
        50% 45%,
        45% 50%,
        40% 55%,
        35% 50%,
        30% 45%,
        25% 50%,
        20% 55%,
        15% 50%,
        10% 45%,
        5% 50%,
        0 55%
    );
    pointer-events: none;
}

.section-alt {
    background-color: var(--bg-secondary);
}

.section-alt::before {
    top: auto;
    bottom: -150px;
    left: -150px;
    right: auto;
    width: 400px;
    height: 400px;
    animation: floatAnimation 10s ease-in-out infinite;
    animation-delay: 2s;
}

.section-alt::after {
    background: var(--bg-secondary);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
    position: relative;
    display: block;
    width: 100%;
}

/* Decorative underline accent */
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-secondary), transparent);
    border-radius: 2px;
}

.section-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Mission Section */

.mission-content {
    max-width: 900px;
    margin: 0 auto;
}

.mission-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.mission-values {
    margin-top: 3rem;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transform: rotate(-0.3deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mission-values:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.12),
        0 6px 12px rgba(0, 0, 0, 0.08);
}

/* Decorative corner brackets */
.mission-values::before,
.mission-values::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--accent-primary);
    opacity: 0.3;
}

.mission-values::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.mission-values::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.mission-values h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.mission-values ul {
    list-style: none;
    padding: 0;
}

.mission-values li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.mission-values li:last-child {
    border-bottom: none;
}

.mission-values strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Events Section */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.event-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--text-primary);
    position: relative;
    margin-bottom: 2rem;
}

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

.event-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-family: 'Ubuntu Mono', monospace;
}

.event-date {
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.event-location {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.event-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.event-link {
    display: inline-block;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    border: 2px solid var(--text-primary);
    transition: all 0.3s ease;
}

.event-link:hover {
    background-color: #ffa657;
    border-color: #4a90e2;
    color: var(--text-primary);
}

.events-cta {
    text-align: center;
    position: relative;
}

/* Sponsors Section */
.sponsorship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.sponsorship-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Decorative corner accent */
.sponsorship-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-primary), transparent);
    opacity: 0.1;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
    transition: all 0.4s ease;
}

/* Alternate card rotation */
.sponsorship-card:nth-child(3n+1) {
    transform: rotate(-0.5deg);
}

.sponsorship-card:nth-child(3n+2) {
    transform: rotate(0.5deg);
}

.sponsorship-card:nth-child(3n) {
    transform: rotate(-0.3deg);
}

.sponsorship-card:hover {
    transform: translateY(-8px) rotate(0deg);
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-primary);
}

.sponsorship-card:hover::after {
    width: 120px;
    height: 120px;
    opacity: 0.15;
}

.sponsorship-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.sponsorship-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

.sponsors-cta {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Decorative diagonal accent */
.sponsors-cta::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.08;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.sponsors-cta p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 2px solid var(--btn-secondary-border);
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Button gradient overlay on hover */
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 6px 20px rgba(186, 12, 47, 0.4),
        0 3px 10px rgba(186, 12, 47, 0.2),
        0 1px 4px rgba(186, 12, 47, 0.1);
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
}

.footer p {
    margin: 0.5rem 0;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        justify-content: space-between;
    }

    .nav-brand {
        min-width: auto;
        flex: 0 0 auto;
    }

    .nav-brand .logo {
        height: 50px;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--nav-bg);
        padding: 1rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .hamburger {
        display: flex;
        order: 3;
    }

    .nav-actions {
        gap: 0.5rem;
        min-width: auto;
        flex: 0 0 auto;
        order: 2;
    }

    .hero-image {
        max-height: 350px;
    }

    .hero-video {
        max-height: 450px;
    }

    .hero-content {
        bottom: 1.5rem;
        left: 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    .section-title {
        font-size: 2rem;
    }

    .event-card {
        padding: 1.5rem;
    }

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

@media (max-width: 480px) {
    .hero-image {
        max-height: 280px;
    }

    .hero-video {
        max-height: 350px;
    }

    .hero-content {
        bottom: 1rem;
        left: 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-tagline {
        font-size: 0.9rem;
    }

    .btn-join {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .section {
        padding: 3rem 0;
    }
}
