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

:root {
    /* Colors - Blending timeline and bento palettes */
    --primary: #4f46e5;
    --secondary: #14b8a6;
    --accent: #f43f5e;
    --timeline: #06b6d4;
    --text-primary: #18181b;
    --text-secondary: #71717a;
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --border: #e4e4e7;

    /* Typography */
    --font-heading: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-ui: 'Inter', system-ui, sans-serif;

    /* Spacing */
    --gap: 1.5rem;
}

[data-theme="dark"] {
    --primary: #6366f1;
    --secondary: #2dd4bf;
    --accent: #fb7185;
    --timeline: #22d3ee;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --border: #27272a;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.header-left h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--timeline) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 500;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 12px 8px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

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

/* Theme Toggle */
.theme-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
}

.theme-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: var(--font-ui);
}

.theme-btn.active {
    background: var(--primary);
    color: white;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Showreel Hero Card */
.showreel-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--timeline) 100%);
    color: white;
    padding: 3rem;
    border-radius: 16px;
    margin-bottom: 4rem;
    text-align: center;
}

.showreel-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.showreel-card p {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.video-embed {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.video-facade {
    position: relative;
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
    display: block;
}

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

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s, opacity 0.2s;
    pointer-events: none;
}

.video-facade:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-facade:focus {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Timeline Container */
.timeline-container {
    position: relative;
    padding-left: 120px;
}

/* Timeline Line */
.timeline-line {
    position: absolute;
    left: 60px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--timeline) 0%, var(--primary) 100%);
    opacity: 0.4;
    border-radius: 2px;
}

/* Year Section */
.year-section {
    margin-bottom: 6rem;
    position: relative;
}

/* Year Marker */
.year-marker {
    position: absolute;
    left: -120px;
    top: 20px;
    width: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.year-marker-node {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--timeline) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.4);
    position: relative;
    z-index: 10;
    border: 4px solid var(--bg-primary);
}

.year-marker-node.award {
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    box-shadow: 0 0 40px rgba(244, 63, 94, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(244, 63, 94, 0.5);
    }
    50% {
        box-shadow: 0 0 60px rgba(244, 63, 94, 0.7);
    }
}

/* Year Title */
.year-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--timeline) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--gap);
    position: relative;
}

/* Connector Lines from Timeline to Cards */
.year-section::before {
    content: '';
    position: absolute;
    left: -58px;
    top: 60px;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--timeline) 0%, transparent 100%);
    opacity: 0.3;
}

/* Bento Card */
.bento-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.bento-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Card Sizes */
.bento-card.hero {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-card.wide {
    grid-column: span 2;
}

/* Card Image */
.card-image {
    width: 100%;
    min-height: 250px;
    max-height: 400px;
    overflow: hidden;
    position: relative;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-card.hero .card-image {
    min-height: 300px;
    max-height: 500px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.bento-card:hover .card-image img {
    transform: scale(1.05);
}

/* Carousel */
.carousel {
    width: 100%;
    min-height: 250px;
    max-height: 400px;
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    height: 100%;
    width: 100%;
}

.carousel-image {
    min-width: 100%;
    height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 16px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    font-size: 1.5rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-arrow-prev { left: 8px; }
.carousel-arrow-next { right: 8px; }

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 32px;
    height: 32px;
    border: none;
    cursor: pointer;
    padding: 0;
    background: transparent;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.carousel-dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.carousel-dot.active::before {
    background: white;
    transform: scale(1.3);
}

/* Card Content */
.card-content {
    padding: 1.5rem;
}

.card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-category.game {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.card-category.research {
    background: rgba(20, 184, 166, 0.1);
    color: var(--secondary);
    border-color: var(--secondary);
}

.card-category.award {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.bento-card.hero .card-title {
    font-size: 1.75rem;
}

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

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.625rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-ui);
}

.card-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.card-link {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: var(--font-ui);
    display: inline-block;
}

.card-link:hover {
    background: var(--timeline);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.card-link.secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.card-link.secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

/* Award Badge */
.award-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* Responsive */
@media (max-width: 968px) {
    .timeline-container {
        padding-left: 0;
    }

    .timeline-line {
        left: 20px;
        width: 3px;
    }

    .year-marker {
        left: 0;
        width: 40px;
        top: 0;
    }

    .year-marker-node {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
        border-width: 2px;
    }

    .year-section::before {
        display: none;
    }

    .year-section {
        margin-left: 50px;
    }

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

    .bento-card.hero,
    .bento-card.wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .bento-card.hero .card-image {
        min-height: 200px;
        max-height: 300px;
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .header {
        padding: 0.5rem 1rem;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .theme-btn {
        padding: 12px 16px;
        font-size: 0.875rem;
        min-height: 44px;
    }

    .year-title {
        font-size: 1.75rem;
    }

    .showreel-card {
        padding: 2rem 1.5rem;
    }

    .card-content {
        padding: 1.25rem;
    }
}

@media (min-width: 969px) and (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small screens (phones in portrait) */
@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0.75rem;
    }

    .header-left {
        gap: 0.5rem;
    }

    .header-left h1 {
        font-size: 1.25rem;
    }

    .header-subtitle {
        font-size: 0.8125rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .showreel-card {
        padding: 1.5rem 1rem;
    }

    .showreel-card h2 {
        font-size: 1.5rem;
    }

    .showreel-card p {
        font-size: 1rem;
    }

    .year-section {
        margin-left: 45px;
    }

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

    .card-content {
        padding: 1rem;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-description {
        font-size: 0.875rem;
    }

    .tag {
        font-size: 0.6875rem;
        padding: 0.2rem 0.5rem;
    }

    .card-category {
        font-size: 0.6875rem;
    }

    .card-link {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .header-nav {
        gap: 1rem;
    }

    .theme-toggle {
        padding: 3px;
    }

    .theme-btn {
        padding: 10px 14px;
        font-size: 0.8125rem;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep essential transitions for usability */
    .theme-btn,
    .header-nav a,
    .card-link {
        transition-duration: 0.01ms !important;
    }

    /* Disable pulse animation */
    .year-marker-node.award {
        animation: none !important;
    }

    /* Disable carousel transitions */
    .carousel-track {
        transition: none !important;
    }

    /* Disable image zoom on hover */
    .bento-card:hover .card-image img {
        transform: none !important;
    }

    /* Disable play button scale */
    .video-facade:hover .play-button {
        transform: translate(-50%, -50%) !important;
    }
}
