/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --text: #e8e8e8;
    --text-muted: #666;
    --accent: #fff;
    --font-sans: -apple-system, 'Segoe UI', system-ui, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
    --font-mono: 'Consolas', 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    cursor: none;
}

*, *::before, *::after {
    cursor: none !important;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.6;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 40px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: opacity 0.3s ease;
}

.logo:hover .logo-img {
    opacity: 0.6;
}

.logo:hover {
    opacity: 1;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent);
    opacity: 1;
}

/* ===== Works ===== */
.works {
    padding: 160px 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.project {
    display: grid;
    grid-template-columns: 1fr 45% 1fr;
    align-items: center;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-hero {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-hero.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-detail {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-detail.visible {
    opacity: 1;
    transform: translateY(0);
}

.about-grid {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

.contact-inner {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    transition-delay: 0.2s;
}

.contact-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-info {
    padding-right: 40px;
}

.project-title {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    transition: color 0.4s ease;
}

.project:hover .project-title {
    color: var(--accent);
}

.project-image {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.project-image img {
    width: 100%;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project:hover .project-image img,
.project:hover .placeholder-img {
    transform: scale(1.03);
}

.placeholder-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.placeholder-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.project-meta {
    text-align: right;
    padding-left: 40px;
}

.project-year {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ===== Contact / Footer ===== */
.contact {
    padding: 120px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.contact-heading {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 500;
    font-style: normal;
    text-transform: none;
    letter-spacing: -0.01em;
    margin-bottom: 36px;
    color: var(--accent);
    line-height: 1.3;
}

.contact-email {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 4px;
    transition: all 0.3s ease;
    margin-bottom: 40px;
}

.contact-email:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
    opacity: 1;
}

.contact-socials {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.social-link {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--accent);
    opacity: 1;
}

/* ===== Project Detail Page ===== */
.project-hero {
    padding: 170px 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.project-hero-media {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.project-hero-media img {
    width: 100%;
    max-height: calc(100vh - 360px);
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.project-hero-media:hover img {
    opacity: 0.85;
}

.project-hero-media video {
    width: 100%;
    max-height: calc(100vh - 360px);
    object-fit: contain;
}

.play-btn {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.play-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

.project-detail {
    padding: 0 40px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.project-detail-header {
    margin-bottom: 48px;
}

.project-detail-title {
    font-family: var(--font-mono);
    font-size: clamp(28px, 3.5vw, 44px);
    font-weight: 400;
    margin-bottom: 32px;
    color: var(--accent);
}

.project-detail-meta {
    display: flex;
    gap: 60px;
    margin-bottom: 48px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.meta-value {
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
}

.project-detail-description {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1000px;
}

.project-detail-description p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Gallery */
.project-gallery {
    padding: 40px 40px 120px;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.project-gallery .gallery-item {
    aspect-ratio: 16 / 10;
    background: #111;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-gallery .gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-gallery .gallery-item.full {
    grid-column: 1 / -1;
    aspect-ratio: 21 / 9;
}

.project-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-gallery .gallery-item:hover img {
    transform: scale(1.02);
}

.project-gallery .gallery-item {
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    user-select: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    opacity: 0.7;
    transition: opacity 0.3s;
    background: none;
    border: none;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    opacity: 0.7;
    transition: opacity 0.3s;
    background: none;
    border: none;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    letter-spacing: 2px;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 40px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
    opacity: 1;
}

.back-link::before {
    content: '←';
}

/* ===== About Page ===== */
.about {
    padding: 160px 40px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: start;
}

.about-heading {
    font-family: var(--font-mono);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 400;
    font-style: italic;
    margin-bottom: 20px;
    color: var(--accent);
}

.about-text p {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.about-skills {
    margin-top: 60px;
}

.about-skills h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    font-size: 13px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: var(--text);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.about-photo {
    aspect-ratio: 3 / 4;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-photo-placeholder {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .project {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 60px;
    }

    .project-info {
        padding-right: 0;
        order: 2;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .project-meta {
        padding-left: 0;
        order: 2;
        display: none;
    }

    .project-info::after {
        content: attr(data-year);
        font-size: 16px;
        color: var(--text-muted);
    }

    .project-image {
        order: 1;
    }

    .project-detail-description {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 12px 20px;
    }

    .logo-img {
        height: 40px;
    }

    .nav {
        gap: 20px;
    }

    .works {
        padding: 120px 24px 40px;
    }

    .project-hero {
        padding: 100px 24px 20px;
    }

    .project-hero-media img,
    .project-hero-media video {
        max-height: calc(100vh - 280px);
    }

    .project-hero {
        padding-top: 100px;
        padding-bottom: 10px;
    }

    .project-hero-media {
        margin-bottom: 10px;
    }

    .project-detail-title {
        font-size: clamp(22px, 6vw, 32px);
        margin-bottom: 20px;
    }

    .project-detail {
        padding-bottom: 40px;
    }

    .project-detail-meta {
        gap: 20px;
        margin-bottom: 24px;
    }

    /* Vertical stacked gallery on mobile */
    .project-gallery {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px 24px 60px;
    }

    .project-gallery .gallery-item {
        aspect-ratio: 16 / 10;
    }

    .project-gallery .gallery-item.full {
        grid-column: unset;
        aspect-ratio: 16 / 10;
    }

    .project-detail-meta {
        flex-wrap: wrap;
        gap: 24px;
    }

    .contact {
        padding: 80px 24px;
    }
}

/* ===== Cursor ===== */
.custom-cursor {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.15s ease;
    transform: translate(-50%, -50%);
}

.custom-cursor.hover {
    transform: translate(-50%, -50%) scale(4);
}

@media (hover: none), (pointer: coarse) {
    .custom-cursor {
        display: none !important;
    }
    *, *::before, *::after {
        cursor: auto !important;
    }
}
