:root {
    --bg-color: black;
    --text-color: white;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-light: rgba(255, 255, 255, 0.75);
    --border-color: #333;
    --header-bg: rgba(0, 0, 0, 0.95);
}

[data-theme="light"] {
    --bg-color: white;
    --text-color: black;
    --text-muted: rgba(0, 0, 0, 0.6);
    --text-light: rgba(0, 0, 0, 0.75);
    --border-color: #ddd;
    --header-bg: rgba(255, 255, 255, 0.95);
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Progress indicator */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--text-color);
    z-index: 2001;
    transition: width 0.1s ease;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    text-transform: lowercase;
}

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

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 2000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* Enhanced focus indicators */
.keyboard-navigation *:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.keyboard-navigation button:focus,
.keyboard-navigation a:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Fade-in animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy loading images */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(90deg, #111 25%, #222 50%, #111 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.lazy-image.loaded {
    opacity: 1;
    background: none;
    animation: none;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
* {
    text-transform: lowercase;
}

/* Smooth scrolling for supported browsers */
html {
    scroll-behavior: smooth;
}
.container, .apply {
    max-width: 1440px;
    margin: 0 auto;
    overflow: hidden;
    padding-top: 80px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px;
    background-color: var(--header-bg);
    transition: background-color 0.3s ease, padding 0.3s ease;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header.sticky {
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    font-size: 24px;
}

.logo-text {
    margin-right: 10px;
}

.beta-tag {
    font-size: 14px;
    color: gray;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 20px;
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 20px;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-video.loaded {
    opacity: 1;
}

/* Video controls */
.video-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    z-index: 100;
    transition: all 0.2s ease;
}

.video-controls:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

.video-controls.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.captions-text {
    font-family: monospace;
    font-weight: bold;
}

.hero h1 {
    font-size: 80px;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
}

.hero h1.hero-title {
    text-transform: none;
}

/* Typing animation */
.typing-text {
    border-right: 2px solid var(--text-color);
    animation: blink 1s infinite;
}

.typing-text.finished {
    border-right: none;
    animation: none;
}

@keyframes blink {
    0%, 50% { border-color: var(--text-color); }
    51%, 100% { border-color: transparent; }
}

.buttons {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}

.button {
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
}

.button.primary {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.button.secondary {
    border: 1px dashed var(--text-color);
    color: var(--text-color);
}

.about,
.time,
.what,
.irl,
.after {
    padding: 60px 20px;
    text-align: center;
}

.about h2 {
    font-size: 60px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.about p {
    margin-bottom: 30px;
    color: var(--text-muted);
    margin: 0 20px 30px;
}

.tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tag {
    border: 1px dashed;
    padding: 10px 15px;
    text-transform: lowercase;
}

.tag.red {
    border-color: red;
    color: red;
}

.tag.blue {
    border-color: blue;
    color: blue;
}

.tag.green {
    border-color: green;
    color: green;
}

.projects {
    padding: 20px;
}

.ticker-container {
    display: flex;
    width: 100%;
}

.ticker-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 20px;
    overflow: hidden;
}

.project {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project img {
    width: 20%;
    height: 100%;
    max-width: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.project .text {
    color: var(--text-light);
}

.time h2 {
    font-size: 40px;
}

.time p {
    color: var(--text-light);
    margin: 0 20px;
}

.what h2,
.how h2,
.irl h2,
.after h2 {
    font-size: 40px;
}

.what p {
    color: var(--text-color);
    margin: 0 20px;
}

.how p {
    color: var(--text-muted);
    margin-bottom: 50px;
    margin: 0 20px 50px;
}

.timeline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

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

.timeline-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.timeline-item .week {
    font-weight: bold;
    font-size: 22px;
}

.irl p {
    color: var(--text-muted);
    margin-bottom: 30px;
    margin: 0 20px 30px;
}

.media-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.media-container .video {
    width: 100%;
    max-width: 600px;
}

.media-container .video video {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.after h2 {
    margin-bottom: 30px;
}

.after p {
    color: var(--text-muted);
    margin-bottom: 30px;
    margin: 0 20px 30px;
}

section .apply {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    background-color: black;
}

.apply-text {
    margin-bottom: 30px;
    margin: 0 20px;
}

.apply h2 {
    font-size: 50px;
    text-align: center;
}

.apply form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    gap: 10px;
}

.apply form input {
    padding: 10px;
    border: 1px solid #333;
    border-radius: 5px;
    background-color: #111;
    color: white;
}

.apply form button {
    margin-top: 10px;
}

.form-wrapper {
    background-color: black;
    padding: 20px;
}

iframe {
    background-color: black !important;
    color: black !important;
    filter: invert(1) hue-rotate(180deg);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 15px;
    font-size: 14px;
}

.footer-socials {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-socials img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

/* Loading states */
.form-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-loading p {
    margin: 0;
    font-size: 16px;
}

.form-loading a {
    color: white;
    text-decoration: underline;
}

/* Apply page specific enhancements */
.apply iframe {
    transition: opacity 0.3s ease;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .video-controls {
        bottom: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .skip-link {
        left: 4px;
        padding: 6px;
        font-size: 14px;
    }
    
    .timeline {
        gap: 5px;
    }
    
    .timeline-item img {
        height: 80px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .theme-toggle {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .hero h1 {
        font-size: 50px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .video-controls {
        background: black;
        border: 2px solid white;
    }
    
    .skip-link {
        background: white;
        color: black;
        border: 2px solid black;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .lazy-image,
    .hero-video,
    .video-controls {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
        border: 3px solid white;
        border-radius: 50%;
    }
    
    @keyframes shimmer {
        0%, 100% { background-position: 0 0; }
    }
}

/* Print styles */
@media print {
    .skip-link,
    .video-controls,
    .hero-video {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .header {
        position: static;
        background: white;
        border-bottom: 1px solid black;
    }
}