:root {
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.7);
    --text-muted: rgba(255,255,255,0.4);
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --accent: #ffffff;
    --border: rgba(255,255,255,0.1);
    --font-display: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Inter', sans-serif;
    /* --font-mono: 'Orbit', monospace; */
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -1px;
}

h1 { font-size: clamp(4rem, 12vw, 10rem); line-height: 1; }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 2rem; }
h3 { font-size: 1.1rem; letter-spacing: 0; }

p { max-width: 600px; }

/* Canvas Background */
#p5-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

/* Content Layer */
.content-layer {
    position: relative;
    z-index: 1;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

section {
    padding: clamp(5rem, 12vw, 10rem) 0;
}

/* Glass effect for content readability */
.glass-panel {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 0;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
    will-change: transform;
}

nav.nav-scrolled {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 1000;
    letter-spacing: -1px;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    letter-spacing: 2px;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.hero-text-wrapper {
    mix-blend-mode: difference;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2.5rem, 14vw, 11rem);
    margin-bottom: 1.5rem;
    line-height: 0.95;
}

.hero-line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.1em;
}

.hero .subtitle {
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    font-weight: 300;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-indicator::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* About Section */
#about {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    position: relative;
}

#about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, rgba(10,10,10,0.95));
    pointer-events: none;
}

#about .about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

#about .about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

#about .about-text p:first-of-type {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 400;
}

.philosophy {
    padding: 2rem;
    background: rgba(255,255,255,0.03);
    border-left: 2px solid rgba(255,255,255,0.3);
    font-style: italic;
}

/* ==================== */
/* BENTO WORK SECTION   */
/* ==================== */
#work {
    background: transparent;
    padding: 10rem 0;
}

#work h2 {
    text-align: center;
    margin-bottom: 4rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, 280px);
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bento-item {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Bento layout - asymmetric */
.bento-item:nth-child(1) {
    grid-column: span 5;
    grid-row: span 2;
}
.bento-item:nth-child(2) {
    grid-column: span 4;
    grid-row: span 1;
}
.bento-item:nth-child(3) {
    grid-column: span 3;
    grid-row: span 1;
}
.bento-item:nth-child(4) {
    grid-column: span 3;
    grid-row: span 1;
}
.bento-item:nth-child(5) {
    grid-column: span 4;
    grid-row: span 1;
}

.bento-item img {
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: calc(100% + 60px);
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
    filter: brightness(0.6) saturate(0.9);
    will-change: transform;
}

.bento-item:hover img {
    transform: scale(1.08);
    filter: brightness(0.9) saturate(1);
}

.bento-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-item:hover .bento-content {
    transform: translateY(0);
    opacity: 1;
}

.bento-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.bento-item p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    max-width: 100%;
}

.bento-label {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.6);
    z-index: 3;
}

.bento-number {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    font-family: var(--font-mono);
    font-size: 4rem;
    color: rgba(255,255,255,0.1);
    line-height: 1;
    z-index: 1;
}

/* ========================= */
/* IMMERSIVE PROJECT SCROLL  */
/* ========================= */
.project-showcase {
    margin-top: 8rem;
    padding: 4rem 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.showcase-header h3 {
    font-size: 1.8rem;
}

.showcase-header .scroll-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.showcase-header .scroll-hint::after {
    content: '\2192';
    animation: hintPulse 1.5s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(5px); opacity: 1; }
}

.showcase-track {
    display: flex;
    gap: 2rem;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
}

.showcase-track::-webkit-scrollbar {
    display: none;
}

.showcase-track:active {
    cursor: grabbing;
}

.showcase-card {
    flex: 0 0 400px;
    height: 500px;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #000;
    border: 1px solid rgba(255,255,255,0.05);
    transition: border-color 0.3s ease;
}

.showcase-card:hover {
    border-color: rgba(255,255,255,0.2);
}

.showcase-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.4s ease;
    filter: brightness(0.85);
    will-change: transform;
}

.showcase-card:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

.showcase-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    transform: translateY(60px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-card:hover .showcase-card-content {
    transform: translateY(0);
}

.showcase-card h4 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.showcase-card p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

.showcase-card .role {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.1);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.8);
}

.listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1.2rem;
    background: #1DB954;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.listen-btn:hover {
    background: #1ed760;
    transform: translateY(-1px);
}

.listen-btn svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.showcase-footer {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
    text-align: right;
}

.showcase-footer a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.showcase-footer a:hover {
    color: var(--text-primary);
}

/* Skills Section */
#skills {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.skill-category h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.skill-category li:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

/* Experience Section */
#experience {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
}

.experience-grid {
    display: grid;
    gap: 3rem;
}

.experience-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.experience-item:last-child {
    border-bottom: none;
}

.experience-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.experience-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.experience-content .company {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

.experience-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Blog Section */
#blog {
    background: rgba(255,255,255,0.03);
    color: #fff;
    text-align: center;
}

#blog h2 {
    color: #fff;
}

#blog p {
    margin: 0 auto 2rem;
    color: rgba(255,255,255,0.7);
}

.blog-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-decoration: none;
    padding: 1rem 2rem;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.blog-link:hover {
    background: #fff;
    color: #000;
}

.blog-link svg {
    transition: transform 0.3s ease;
}

.blog-link:hover svg {
    transform: translateX(4px);
}

/* Contact Section */
#contact {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-text h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1.5rem;
}

.contact-text p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.social-links a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 0;
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    outline: none;
    transition: border-color 0.3s ease;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease, letter-spacing 0.3s ease;
}

.submit-btn:hover {
    background: var(--accent);
    color: #000;
    letter-spacing: 3px;
}

/* Footer */
footer {
    padding: 3rem 0;
    background: rgba(10, 10, 10, 0.95);
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin: 0 auto;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
}

/* Fallback for no-JS or no-GSAP */
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Custom Cursor */
.custom-cursor,
.cursor-follower {
    display: none;
}

@media (pointer: fine) {
    .custom-cursor {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 8px;
        height: 8px;
        background: #fff;
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        mix-blend-mode: difference;
    }

    .cursor-follower {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 36px;
        height: 36px;
        border: 1px solid rgba(255,255,255,0.5);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9998;
        mix-blend-mode: difference;
        transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    }

    .cursor-follower.cursor-hover {
        width: 56px;
        height: 56px;
        border-color: rgba(255,255,255,0.8);
        margin-left: -10px;
        margin-top: -10px;
    }

    body {
        cursor: none;
    }

    a, button, .bento-item, .showcase-card {
        cursor: none;
    }
}

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

    .fade-in {
        opacity: 1;
        transform: none;
    }

    #p5-container {
        display: none;
    }

    .custom-cursor,
    .cursor-follower {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 1000px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .bento-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 350px;
    }
    .bento-item:nth-child(2),
    .bento-item:nth-child(3),
    .bento-item:nth-child(4),
    .bento-item:nth-child(5) {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 280px;
    }

    .bento-content {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 900px) {
    #about .about-content,
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .experience-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .nav-links {
        display: none;
    }

    .showcase-card {
        flex: 0 0 320px;
        height: 420px;
    }
}

@media (max-width: 600px) {
    section {
        padding: 5rem 0;
    }

    .hero {
        min-height: 90vh;
    }

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

    .bento-item:nth-child(1),
    .bento-item:nth-child(2),
    .bento-item:nth-child(3),
    .bento-item:nth-child(4),
    .bento-item:nth-child(5) {
        grid-column: span 1;
        min-height: 280px;
    }
}
