/* Load custom Chalky font from local file */
@font-face {
    font-family: 'Chalky';
    src: url('./font/Chalky-1jDeZ.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Main color and size variables */
:root {
    --primary-color: #BC5135;
    --secondary-color: #84BCB6;
    --neutral-color: #D6D6D6;
    --white: #FFFFFF;
    --black: #000000;
    --dark-grey: #333333;
    
    --font-heading: 'Chalky', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --section-padding: 80px 0;
    --container-max-width: 1400px;
    --container-padding: 0 60px;
}

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

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--dark-grey);
    overflow-x: hidden;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

/* Section titles */
.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    margin-bottom: 32px;
    color: var(--dark-grey);
}

.section-description {
    font-size: 1.25rem;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto 50px;
    color: var(--dark-grey);
    text-align: center;
}

/* Prevent line breaks */
.no-break {
    white-space: nowrap;
}

/* Button styles */
.cta-button {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.25rem;
    padding: 20px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    background-color: var(--secondary-color);
    color: var(--white);
}

.cta-button:hover {
    background-color: #6fa89e;
    transform: translateY(-2px);
}

.cta-button:focus {
    outline: 3px solid var(--white);
    outline-offset: 2px;
}

/* Top hero section with gradient background */
.hero-section {
    min-height: auto;
    padding: 100px 0 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--neutral-color) 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Animated grid background */
.hero-background-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-image: 
        linear-gradient(90deg, var(--white) 1px, transparent 1px),
        linear-gradient(0deg, var(--white) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-family: 'Chalky', sans-serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 8px;
}

.hero-subtitle {
    font-family: 'Chalky', sans-serif;
    font-weight: 400;
    font-size: clamp(2.3rem, 4.8vw, 3.8rem);
    color: var(--white);
    margin-bottom: 32px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.1;
    letter-spacing: 8px;
}

/* SDG 9 badge */
.sdg-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 48px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.sdg-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    flex-shrink: 0;
}

.sdg-text {
    font-family: 'Chalky', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--white);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.3;
}

/* Video container - prevent darkening on hover */
.video-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 60px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
    background-color: #000;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    opacity: 1 !important;
    filter: none !important;
}

.video-container:hover,
.video-container video:hover {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
}

/* Commute time comparison section */
.problem-section {
    padding: var(--section-padding);
    background-color: #f8f9fa;
    text-align: center;
}

.chart-container {
    max-width: 800px;
    margin: 0 auto;
}

.chart-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 32px;
    color: var(--dark-grey);
}

/* Bar chart styling */
.bar-chart {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 24px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar {
    width: 80px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 16px;
    transition: height 1s ease-out;
    height: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Different colors for each bar */
.transit-bar {
    background: linear-gradient(180deg, #BC5135 0%, #A0351F 100%);
}

.car-bar {
    background: linear-gradient(180deg, #84BCB6 0%, #6fa89e 100%);
}

.active-bar {
    background: linear-gradient(180deg, #D6D6D6 0%, #B8B8B8 100%);
}

.bar-label {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark-grey);
}

.bar-value {
    font-size: 0.875rem;
    color: var(--dark-grey);
    opacity: 0.8;
}

/* Transit problems section */
.innovation-section {
    padding: var(--section-padding);
    background-color: var(--white);
    text-align: center;
}

/* Grid for stat cards - 3 in first row, 2 centered in second row */
.innovation-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 32px;
    margin: 48px 0;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.innovation-item {
    padding: 36px 28px;
    border-radius: 12px;
    background-color: #e8ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    grid-column: span 2;
}

/* Center the last two cards */
.innovation-item:nth-child(4) {
    grid-column: 2 / span 2;
}

.innovation-item:nth-child(5) {
    grid-column: 4 / span 2;
}

.innovation-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.innovation-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.innovation-item h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 16px;
    line-height: 1.2;
    white-space: nowrap;
}

.innovation-item p {
    color: var(--dark-grey);
    line-height: 1.5;
    font-size: 1rem;
}

/* Call to action section */
.cta-section {
    padding: var(--section-padding);
    background-color: var(--primary-color);
    text-align: center;
}

.cta-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--white);
    margin-bottom: 24px;
    line-height: 1.3;
}

.cta-description {
    font-size: 1.2rem;
    color: var(--white);
    opacity: 0.95;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer with credits */
.about-section {
    padding: 64px 0;
    background-color: var(--neutral-color);
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    font-size: 1rem;
    color: var(--dark-grey);
    margin-bottom: 16px;
}

.about-credits {
    font-size: 1rem;
    color: var(--dark-grey);
    margin-bottom: 12px;
}

.font-license {
    font-size: 0.875rem;
    color: var(--dark-grey);
    opacity: 0.8;
}

.font-license a {
    color: var(--dark-grey);
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.font-license a:hover {
    opacity: 0.7;
}

/* Tablet screens */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
        --container-padding: 0 24px;
    }
    
    .hero-section {
        padding: 60px 0 50px;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
        letter-spacing: 4px;
    }
    
    .hero-subtitle {
        font-size: clamp(2.3rem, 7.5vw, 3.8rem);
        letter-spacing: 4px;
        margin-bottom: 40px;
    }
    
    .sdg-badge {
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .sdg-icon {
        width: 100px;
        height: 100px;
    }
    
    .sdg-text {
        font-size: 1.5rem;
    }
    
    .video-container {
        max-width: 100%;
        margin-bottom: 40px;
        border-radius: 12px;
    }
    
    .hero-content {
        padding: 0 24px;
    }
    
    /* 2-2-1 layout for cards */
    .innovation-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    
    .innovation-item {
        grid-column: span 2 !important;
    }
    
    .innovation-item:nth-child(5) {
        grid-column: 2 / span 2 !important;
    }
    
    .bar-chart {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* Mobile screens */
@media (max-width: 480px) {
    .hero-section {
        padding: 40px 0 40px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
        letter-spacing: 2px;
        margin-bottom: 12px;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: clamp(1.8rem, 9vw, 2.8rem);
        letter-spacing: 2px;
        margin-bottom: 24px;
        line-height: 1.2;
    }
    
    .sdg-badge {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .sdg-icon {
        width: 80px;
        height: 80px;
    }
    
    .sdg-text {
        font-size: 1.2rem;
        text-align: center;
        line-height: 1.4;
    }
    
    /* Single column for cards */
    .innovation-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .innovation-item {
        grid-column: span 1 !important;
    }
    
    .innovation-item:nth-child(4),
    .innovation-item:nth-child(5) {
        grid-column: 1 / span 1 !important;
    }
    
    /* Stack bars vertically */
    .bar-chart {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .bar {
        width: 100px;
    }
    
    .hero-content {
        padding: 0 20px;
    }
    
    .video-container {
        margin-bottom: 20px;
        border-radius: 8px;
    }
    
    .cta-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        white-space: normal;
        line-height: 1.3;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #A0351F;
        --secondary-color: #5A9B8E;
    }
}
