:root {
    --bg-color: #050505;
    --text-color: #f5f5f5;
    --text-muted: #888888;
    --accent-color: #ffffff;
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Syne', sans-serif;
    --transition-speed: 0.6s;
    --container-padding: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    overflow-x: hidden;
    line-height: 1.6;
    cursor: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Custom Cursor */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.1s;
}

body:hover .cursor {
    opacity: 1;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 100;
    mix-blend-mode: difference;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.nav-list {
    display: flex;
    gap: 3rem;
}

.nav-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    /* Offset for fixed header */
}

.hero-content {
    z-index: 2;
    text-align: center;
    mix-blend-mode: normal;
    /* Changed for better visibility on dark bg */
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 12vw, 10rem);
    /* Increased max size */
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.04em;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.2s cubic-bezier(0.165, 0.84, 0.44, 1), transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: linear-gradient(to bottom, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease 0.4s, transform 1s ease 0.4s;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 1;
    opacity: 0.5;
    filter: blur(80px);
    animation: pulse 10s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* About Section */
.about {
    padding: 15rem 0;
    /* Increased padding for more breathing room */
}

.section-label {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.7;
}

.about-text {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 4.5vw, 4.5rem);
    line-height: 1.2;
    font-weight: 400;
    /* Lighter weight for elegance */
    color: #cccccc;
    max-width: 1200px;
}

.about-text .highlight {
    color: #ffffff;
    font-weight: 600;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

/* Subtle underline effect for highlights */
.about-text .highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.about-text:hover .highlight::after {
    width: 100%;
}

/* Work Grid */
.work {
    padding: 10rem 0 15rem;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    /* Larger cards */
    gap: 6rem;
    /* More space */
    margin-top: 6rem;
}

.work-item {
    cursor: pointer;
    /* group: work-item; REMOVED invalid property */
}

.work-image-wrapper {
    overflow: hidden;
    margin-bottom: 2rem;
    border-radius: 2px;
    /* Sharper edges */
    position: relative;
    background: #111;
}

.work-image {
    width: 100%;
    height: 600px;
    /* Taller images */
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.5s ease;
    filter: grayscale(100%) brightness(0.8);
    opacity: 0.8;
}

.work-item:hover .work-image {
    transform: scale(1.03);
    filter: grayscale(0%) brightness(1);
    opacity: 1;
}

.work-info h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #fff;
    transform: translateY(10px);
    transition: transform 0.5s ease;
}

.work-item:hover .work-info h3 {
    transform: translateY(0);
}

.work-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Footer */
.footer {
    padding: 10rem 0 5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, var(--bg-color) 0%, #080808 100%);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-title {
    font-size: 1rem;
    margin-bottom: 2rem;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

.footer-email {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 8rem;
    display: inline-block;
    position: relative;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.footer-email::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-email:hover::after {
    width: 100%;
}

.footer-links {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.socials {
    display: flex;
    gap: 3rem;
}

.social-link {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #ffffff;
}

.copyright {
    color: #444;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem;
    z-index: 100;
    mix-blend-mode: difference;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}



/* --- Home Revamp: Precise Layout --- */

body.home-body {
    overflow: hidden;
    background-color: #000;
}

/* Fullscreen Layout Wrapper - Exact Sileent Match */
.home-layout-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 40px 40px;
    /* Matched About/Edu Padding */
    box-sizing: border-box;
    z-index: 100;
    display: block;
    pointer-events: none;
}

.nav-item {
    position: absolute;
    /* Space Grotesk is the closest free match to Sileent's grotesque font */
    font-family: 'Space Grotesk', sans-serif;
    color: #fff;
    mix-blend-mode: difference;
    pointer-events: auto;
    font-weight: 500;
    letter-spacing: -0.04em;
    /* Tight tracking like reference */
    opacity: 0.9;
}

/* Top Left: Sileent */
/* Top Left: Sileent */
.nav-logo {
    top: 40px;
    left: 40px;
    /* Matched to padding */
    /* Exact match minimal-logo */
    font-family: 'Space Grotesk', sans-serif;
    /* Match Main Font */
    font-size: 28px;
    /* Match About */
    font-weight: 700;
    /* Match About */
    letter-spacing: -0.5px;
    /* Match About */
    text-transform: none;
    text-decoration: none;
}

/* Top Right: Grid Icon Container */
/* Top Right: Grid (Text) */
.nav-grid-btn {
    top: 40px;
    right: 40px;
    /* Matched to padding */
    font-size: 26px;
    /* Matched to 26px */
    font-weight: 500;
    cursor: default;
    /* purely decorative */
    width: auto;
    /* Allow auto width */
    height: auto;
    display: block;
    white-space: nowrap;
    /* Prevent wrapping */
}



/* Top Center: 001 */
.nav-counter {
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    line-height: 1;
}

.counter-main {
    display: block;
    font-size: 26px;
    /* Increased from 22px */
    font-weight: 500;
}

.counter-sub {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.7;
    font-family: 'Inter', sans-serif;
    /* Keep sub-info clean */
    letter-spacing: 0;
}

/* Bottom Left: Nav List (Work, Lab...) */
.nav-menu-list {
    bottom: 40px;
    left: 40px;
    /* Matched to padding */
    display: flex;
    gap: 15px;
    align-items: baseline;
}

.nav-link-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 30px;
    /* Increased to 30px */
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    letter-spacing: -0.05em;
    font-weight: 400;

    /* Animation: Left-to-Right Fill */
    background: linear-gradient(to right, #fff 50%, rgba(255, 255, 255, 0.4) 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    transition: background-position 0.4s ease-out;
}

.nav-link-item:hover {
    background-position: 0 0;
}


/* Bottom Right: Title */
.nav-title {
    bottom: 40px;
    right: 40px;
    /* Matched to padding */
    font-size: 26px;
    /* Increased to 26px */
    letter-spacing: -0.03em;
    text-align: right;
    font-weight: 500;
}

.nav-title::before {
    content: 'SHOWREEL';
    display: block;
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 5px;
    opacity: 0.6;
    letter-spacing: 0.1em;
    font-weight: 400;
}

/* Background Image Container */
.background-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #000;
}

/* Replaced video with image tag style in HTML, but here we style the container or img class */
.bg-image,
.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    /* Visible but allows text readability */
    /* Brighter B&W as requested */
    filter: grayscale(100%) brightness(1.2) contrast(1.1);
}

/* Ensure grid section is hidden by default in home body */
body.home-body .masonry-grid-section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Grid View Active State */
body.home-body.grid-view-active {
    overflow: auto;
}

body.home-body.grid-view-active .background-video-container,
body.home-body.grid-view-active .nav-counter,
body.home-body.grid-view-active .nav-logo,
body.home-body.grid-view-active .nav-menu,
body.home-body.grid-view-active .nav-title {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.home-body.grid-view-active .masonry-grid-section {
    display: block;
    opacity: 1;
    pointer-events: auto;
    /* Enable clicks */
    padding-top: 150px;
}

body.home-body.grid-view-active .nav-grid-btn {
    z-index: 200;
    /* Keep button above grid */
}

/* Let clicks pass through empty space */
.header>* {
    pointer-events: auto;
    /* Re-enable clicks on logo/menu */
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
}

.menu-trigger {
    cursor: pointer;
    font-family: var(--font-primary);
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 200;
}

/* --- Overlay Menu --- */
.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 10vw;
    /* Left aligned like Sileent */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.overlay-menu.active {
    opacity: 1;
    pointer-events: all;
}

.overlay-nav-list {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    text-align: left;
}

.overlay-nav-item {
    overflow: hidden;
    /* For reveal animation */
}

.overlay-nav-item a {
    font-family: var(--font-heading);
    /* Syne for the main text */
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.overlay-nav-item a span.nav-num {
    font-family: var(--font-serif);
    /* Playfair for numbers */
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
    transform: translateY(-20px);
    /* Superscript-ish alignment */
}

.overlay-nav-item a:hover {
    color: var(--text-muted);
    transform: translateX(10px);
}

.overlay-socials {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    gap: 1.5rem;
    font-family: var(--font-primary);

    .nav-link-item {
        /* Ensure non-active items are transparent as requested */
        color: rgba(255, 255, 255, 0.4);
        text-decoration: none;
    }


    /* --- Masonry Grid (Home & Lab) --- */
    .masonry-grid-section {
        padding: 150px 0 100px;
    }

    .masonry-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 2rem;
        grid-auto-flow: dense;
    }

    .grid-item {
        position: relative;
        border-radius: 4px;
        overflow: hidden;
        background-color: #111;
        cursor: pointer;
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }

    .grid-item:hover {
        transform: scale(0.98);
        z-index: 10;
    }

    /* Simulated Masonry Layout */
    .grid-item:nth-child(odd) {
        grid-row: span 2;
    }

    .grid-item:nth-child(3n) {
        grid-row: span 3;
    }

    .grid-item:nth-child(5n) {
        grid-column: span 2;
        grid-row: span 2;
    }

    /* Media Wrapper for Image & Video */
    .media-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
    }

    .grid-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: grayscale(100%);
        transition: filter 0.5s ease, opacity 0.5s ease;
        opacity: 0.8;
    }

    .grid-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transition: opacity 0.5s ease;
        filter: grayscale(0%);
        pointer-events: none;
        /* Let clicks pass to item */
    }

    .grid-item:hover .grid-image {
        opacity: 0;
        /* Hide image on hover */
    }

    .grid-item:hover .grid-video {
        opacity: 1;
        /* Show video on hover */
    }

    .grid-info {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 2rem;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
        pointer-events: none;
    }

    .grid-item:hover .grid-info {
        opacity: 1;
        transform: translateY(0);
    }

    .grid-title {
        font-family: var(--font-heading);
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: #fff;
        text-transform: uppercase;
    }

    .grid-category {
        font-family: var(--font-primary);
        font-size: 0.8rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    /* --- Page Specific placeholders --- */
    .page-header {
        padding: 200px 0 100px;
        text-align: left;
    }

    .page-title {
        font-family: var(--font-heading);
        font-size: clamp(4rem, 12vw, 10rem);
        /* Huge Title */
        line-height: 0.85;
        margin-bottom: 4rem;
        text-transform: uppercase;
        letter-spacing: -0.04em;
    }

    .work-meta-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
        margin-bottom: 8rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding: 2rem 0;
    }

    .meta-item h4 {
        font-family: var(--font-primary);
        color: var(--text-muted);
        font-size: 0.8rem;
        text-transform: uppercase;
        margin-bottom: 1rem;
        letter-spacing: 0.1em;
    }

    .meta-item p {
        font-family: var(--font-heading);
        font-size: 1.25rem;
        font-weight: 600;
    }

    .work-content {
        max-width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        margin: 0 auto 8rem;
    }

    .work-text {
        font-size: 1.5rem;
        line-height: 1.4;
        margin-bottom: 2rem;
        grid-column: 2;
        /* Offset text to the right */
    }

    .next-project {
        display: block;
        margin-top: 8rem;
        text-align: center;
        font-family: var(--font-heading);
        font-size: clamp(4rem, 15vw, 20rem);
        /* Massive Next Link */
        text-transform: uppercase;
        padding: 4rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        line-height: 0.8;
        transition: color 0.3s ease;
    }

    .next-project:hover {
        color: var(--text-muted);
        font-style: italic;
        /* Sileent quirk */
    }

    /* --- About Page Split Layout (Reference Style) --- */
    .about-wrapper {
        display: flex;
        min-height: 100vh;
        width: 100%;
        color: #fff;
        font-family: 'Space Grotesk', sans-serif;
        position: relative;
        background-color: #050505;
        /* Deep dark bg */
    }

    /* Left: Image Section (Fixed) */
    .about-image-section {
        width: 45%;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 0;
    }

    .profile-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: grayscale(100%) contrast(1.1);
        /* Aesthetic */
    }

    /* Right: Content Section (Scrollable) */
    .about-content-section {
        width: 55%;
        margin-left: 45%;
        /* Offset */
        padding: 140px 80px 100px 80px;
        background: #050505;
        min-height: 100vh;
        z-index: 1;
        box-sizing: border-box;
        position: relative;
    }

    /* Typography */
    .section-title {
        font-family: 'Syne', sans-serif;
        font-size: 32px;
        /* Reference size */
        font-weight: 700;
        margin-bottom: 30px;
        letter-spacing: -0.02em;
        text-transform: uppercase;
        color: #fff;
    }

    .bio-text {
        font-family: 'Inter', sans-serif;
        font-size: 15px;
        /* Body text size */
        line-height: 1.6;
        color: #ccc;
        font-weight: 300;
        max-width: 600px;
        margin-bottom: 100px;
        /* Spacer */
    }

    .en-bio,
    .kr-bio {
        margin-bottom: 30px;
    }

    .personal-link {
        color: #aaa;
        text-decoration: none;
        font-size: 14px;
        border-bottom: 1px solid #555;
        padding-bottom: 2px;
        transition: color 0.3s;
    }

    .personal-link:hover {
        color: #fff;
        border-color: #fff;
    }

    /* CV Grid Layout */
    .cv-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2 Columns */
        gap: 40px;
        border-top: 1px solid #222;
        padding-top: 60px;
    }

    .cv-group {
        margin-bottom: 60px;
    }

    .cv-group-title {
        font-family: 'Syne', sans-serif;
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 30px;
        text-transform: uppercase;
        color: #fff;
    }

    .cv-items {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .cv-item {
        margin-bottom: 24px;
        display: block;
    }

    .cv-year {
        display: block;
        font-size: 12px;
        font-weight: 600;
        opacity: 0.5;
        margin-bottom: 6px;
        font-family: 'Space Grotesk', sans-serif;
        color: #888;
    }

    .cv-desc {
        display: block;
        font-size: 14px;
        line-height: 1.4;
        color: #ddd;
        font-weight: 500;
        text-transform: uppercase;
        font-family: 'Inter', sans-serif;
    }

    /* Responsive */
    @media (max-width: 1024px) {
        .about-wrapper {
            flex-direction: column;
        }

        .about-image-section {
            position: relative;
            width: 100%;
            height: 50vh;
        }

        .profile-image {
            height: 100%;
        }

        .about-content-section {
            width: 100%;
            margin-left: 0;
            padding: 60px 30px;
        }

        .cv-container {
            grid-template-columns: 1fr;
        }
    }