:root {
    --bg-primary: #0a0a0a;
    --bg-card: #1a1a1a;
    --text-primary: #fff;
    --text-muted: rgba(255, 255, 255, 0.8);
    --accent: #00d4ff;
    --accent-hover: #33dfff;
    --accent-glow: rgba(0, 212, 255, 0.4);
    --accent-subtle: rgba(0, 212, 255, 0.85);
    --accent-faint: rgba(0, 212, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* ---- Skip Link ---- */

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #000;
    font-weight: 500;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    text-decoration: none;
    transition: top 0.2s;
}

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

/* ---- Navigation ---- */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    opacity: 1;
    color: var(--accent);
}

/* Hamburger */

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    min-width: 44px;
    min-height: 44px;
    z-index: 910;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---- Hero ---- */

header {
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    z-index: 2;
    max-width: 600px;
    background: linear-gradient(
        135deg,
        rgba(10, 10, 10, 0.9) 0%,
        rgba(10, 10, 10, 0.4) 100%
    );
    padding: 2rem;
    border-radius: 8px;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    color: var(--accent);
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.hero-actions .cta {
    margin: 0;
}

.cta {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent);
    color: #000;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.cta:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--accent-glow);
    background-color: var(--accent-hover);
}

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

/* ---- Sections ---- */

section {
    padding: 5rem 0;
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--accent);
}

/* ---- Selected Work ---- */

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s;
    will-change: transform;
}

.project:hover {
    transform: translateY(-10px);
}

.project h3 {
    padding: 1rem 1.5rem 0.5rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--accent);
}

.project p {
    padding: 0 1.5rem 1.5rem;
    opacity: 0.8;
}

.project a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.project a:hover {
    opacity: 0.7;
}

.project a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---- Video player overlay ---- */

.video-wrap {
    position: relative;
    cursor: pointer;
}

.video-wrap:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.video-wrap video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: #000;
    font-size: 1.4rem;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}

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

.video-wrap.playing .play-btn {
    opacity: 0;
}

/* ---- Skills ---- */

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    text-align: left;
}

.skill {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
}

.skill h3 {
    color: var(--accent);
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 0.5rem;
}

/* ---- Experience ---- */

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

.job {
    margin-bottom: 2rem;
}

.job h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* ---- Contact ---- */

.contact {
    text-align: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 3rem;
}

.contact .cta {
    margin-top: 1.5rem;
}

/* ---- Contact Form ---- */

.contact-form {
    max-width: 500px;
    margin: 1.5rem auto 0;
    text-align: left;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form .cta {
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

/* ---- Thanks Page ---- */

.thanks-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 60px);
    padding: 3rem 1.5rem;
}

.thanks-section h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--accent);
    margin-bottom: 1rem;
}

.thanks-section p {
    font-size: 1.15rem;
    opacity: 0.85;
    max-width: 500px;
    margin-bottom: 2rem;
}

.thanks-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.cta.secondary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.cta.secondary:hover {
    background: var(--accent-faint);
}

.resume-link {
    margin-top: 1rem;
    opacity: 0.8;
}

.resume-download {
    color: var(--accent);
    transition: opacity 0.2s;
}

.resume-download:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---- Footer ---- */

.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.6;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.7;
}

.footer-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---- Case Study Link ---- */

.case-study-link {
    font-weight: 500;
}

/* ---- Case Study Pages ---- */

.case-study-hero {
    padding-top: 80px;
    background: #000;
}

.case-study-hero video {
    width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    background: #000;
}

.case-study-content {
    padding: 3rem 0;
}

.case-study-content h1 {
    margin-bottom: 0.5rem;
}

.case-study-content h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
}

.case-study-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.case-study-body p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    opacity: 0.9;
    max-width: 720px;
}

.case-study-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.case-study-links a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: border-color 0.2s, color 0.2s;
}

.case-study-links a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.case-study-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.back-link {
    display: inline-block;
    margin-top: 3rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.7;
}

.back-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---- Archive Gallery ---- */

.archive-section {
    padding-top: 100px;
}

.archive-section h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--accent);
    text-align: left;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.archive-subhead {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    text-align: left;
    max-width: 600px;
    margin: 0 auto 1.25rem;
    line-height: 1.3;
}

.archive-intro {
    text-align: left;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    opacity: 0.8;
    font-size: 1.05rem;
}

.archive-lead-cta {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}

.archive-lead-cta p {
    margin-bottom: 1rem;
    opacity: 0.9;
    font-size: 1rem;
    line-height: 1.55;
}

.archive-lead-cta .cta {
    margin: 0;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.archive-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    border: none;
    padding: 0;
    cursor: pointer;
    background: var(--bg-card);
    transition: transform 0.3s, box-shadow 0.3s;
}

.archive-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.archive-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.archive-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s;
}

.archive-item:hover img {
    filter: brightness(1.1);
}

.archive-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.archive-item:hover .archive-item-overlay,
.archive-item:focus-visible .archive-item-overlay {
    opacity: 1;
}

.archive-item-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.archive-item-year {
    font-size: 0.8rem;
    color: var(--accent);
    white-space: nowrap;
}

/* ---- Lightbox ---- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.lightbox-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 85vh;
}

.lightbox-img {
    max-width: 85vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.lightbox-caption {
    text-align: center;
    padding: 1rem 0 0;
    max-width: 500px;
}

.lightbox-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-align: inherit;
}

.lightbox-year {
    font-size: 0.85rem;
    color: var(--accent);
}

.lightbox-year:empty {
    display: none;
}

.lightbox-desc {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    opacity: 1;
}

.lightbox-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 1rem 1.25rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.lightbox-prev {
    left: clamp(-2rem, 5vw, -1rem);
}

.lightbox-next {
    right: clamp(-2rem, 5vw, -1rem);
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    opacity: 1;
    background: rgba(255, 255, 255, 0.18);
}

.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Archive lightbox: image left, scrollable caption right (desktop) */
@media (min-width: 769px) {
    .lightbox-content {
        max-width: min(1200px, 94vw);
    }

    .lightbox-body {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.25rem;
        min-height: 0;
    }

    .lightbox-img {
        flex: 0 1 auto;
        max-width: min(58vw, 720px);
        max-height: 85vh;
    }

    .lightbox-caption {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        text-align: left;
        padding: 0.25rem 0 0;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.nav-active {
    color: var(--accent) !important;
    opacity: 1 !important;
}

/* ---- Responsive ---- */

/* Intermediate breakpoint */
@media (max-width: 1024px) {
    .projects {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
}

@media (max-width: 768px) {
    .hero-content {
        padding: 1.5rem;
        margin: 0 20px;
    }

    section {
        padding: 3rem 0;
    }

    /* Mobile nav */
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 240px;
        height: 100vh;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav-links.open {
        transform: translateX(0);
    }

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

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

    .archive-item-overlay {
        opacity: 1;
    }

    .lightbox-content {
        max-width: 90vw;
    }

    .lightbox-body {
        flex-direction: column;
        align-items: center;
        gap: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lightbox-caption {
        flex: none;
        min-width: 0;
        max-width: 500px;
        text-align: center;
        padding: 1rem 0 0;
        max-height: none;
        overflow-y: visible;
    }

    .lightbox-img {
        max-width: 95vw;
        max-height: 72vh;
    }

    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: -3rem;
        transform: none;
        font-size: 2rem;
    }

    .lightbox-prev { left: calc(50% - 3.5rem); }
    .lightbox-next { right: calc(50% - 3.5rem); }

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

}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    .archive-item:hover,
    .archive-item:focus-visible {
        transform: none !important;
    }

    .archive-item-overlay {
        opacity: 1 !important;
    }
}
