:root {
    /* Dark Mode (Default) */
    --bg-color: #000000;
    --text-color: #f5f5f7;
    --text-muted: #a1a1a6;
    --accent-color: #2997ff;
    --card-bg: #1d1d1f;
    --card-hover-bg: #2d2d2f;
    --nav-bg: rgba(0, 0, 0, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(255, 255, 255, 0.3);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #1d1d1f;
    --text-muted: #86868b;
    --accent-color: #0071e3;
    --card-bg: #f5f5f7;
    --card-hover-bg: #e8e8ed;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-hover: rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: padding 0.3s, background 0.3s;
}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
    z-index: 1001;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-color);
}

.btn {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-btn {
    background: var(--text-color);
    color: var(--bg-color);
}

.nav-btn:hover {
    opacity: 0.9;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    margin-top: 20px;
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
}

.primary-btn:hover {
    background: #0077ed;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1.2rem;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    transition: 0.3s;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

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

.mobile-nav-links {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-link {
    font-size: 2rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
}

.mobile-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 12px 30px;
    font-size: 1.2rem;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 20px;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none;
    max-width: 800px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    background: linear-gradient(180deg, var(--text-color), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(30px);
    line-height: 1.1;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--text-muted);
    margin-top: 10px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-desc {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-muted);
    margin-top: 20px;
    opacity: 0;
    transform: translateY(30px);
}

/* Sticky About Section */
.scroll-section {
    height: 300vh;
    position: relative;
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 1200px;
    padding: 0 50px;
    gap: 40px;
    position: relative;
}

.about-visual {
    width: 400px;
    height: 500px;
    /* Frame Style */
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    border-radius: 10px;
}

.about-text-container {
    width: 50%;
    height: 300px;
    position: relative;
}

.scroll-text-block {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    opacity: 0;
    width: 100%;
}

.scroll-text-block h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    color: var(--text-color);
}

.scroll-text-block p {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-muted);
    line-height: 1.4;
}

/* Horizontal Scroll Projects */
.horizontal-section {
    height: 400vh;
    position: relative;
}

.horizontal-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.horizontal-content {
    display: flex;
    gap: 50px;
    padding-left: 10vw;
}

.project-panel {
    min-width: 60vw;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-panel {
    min-width: 30vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.intro-panel h2 {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.intro-panel p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.project-card-apple {
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 30px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-card-apple:hover {
    transform: scale(1.02);
}

.card-content {
    position: relative;
    z-index: 2;
}

.project-card-apple h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tech-stack {
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.card-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 80%;
}

.card-visual {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    height: 80%;
    z-index: 1;
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
    transform: translate(20%, -20%);
}

.gradient-1 {
    background: linear-gradient(45deg, #ff0055, #ff00cc);
}

.gradient-2 {
    background: linear-gradient(45deg, #00ccff, #0055ff);
}

.gradient-3 {
    background: linear-gradient(45deg, #00ff99, #00cc55);
}

/* Skills Categories */
.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.skills-categories {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-category h3 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.skill-card {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, background 0.3s;
    border: 1px solid var(--border-color);
}

.skill-card:hover {
    transform: translateY(-5px);
    background: var(--card-hover-bg);
    border-color: var(--border-color-hover);
}

.skill-card i,
.skill-card span:first-child {
    font-size: 2rem;
}

.skill-card span {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Experience Timeline */
.timeline {
    border-left: 2px solid var(--border-color);
    margin-left: 20px;
    padding-left: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    margin-bottom: 60px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -49px;
    top: 5px;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    border: 4px solid var(--bg-color);
}

.year {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.timeline-item h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 5px;
}

.role {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.desc {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Contact */
.contact-section {
    text-align: center;
    padding: 150px 20px;
}

.contact-email {
    font-size: clamp(1.2rem, 4vw, 2rem);
    margin-bottom: 10px;
    color: var(--text-color);
}

.contact-phone {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

footer {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.section {
    padding: 100px 20px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    margin-bottom: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .sticky-content {
        padding: 0 20px;
        gap: 20px;
    }

    .about-visual {
        width: 350px;
        height: 450px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 20px;
    }

    .nav-right {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Adjust Sticky Section for Mobile */
    .sticky-content {
        flex-direction: column;
        /* Stack vertically */
        justify-content: center;
        align-items: center;
        gap: 40px;
    }

    .about-visual {
        width: 280px;
        height: 350px;
        margin-bottom: 0;
    }

    .about-text-container {
        width: 100%;
        height: 200px;
        /* Fixed height for text */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .scroll-text-block {
        text-align: center;
        width: 100%;
        padding: 0 20px;
        /* Ensure text doesn't float up */
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
    }

    .scroll-text-block h2 {
        font-size: 2rem;
    }

    .scroll-text-block p {
        font-size: 1rem;
    }

    /* Keep Horizontal Scroll Active on Mobile */
    .horizontal-content {
        padding-left: 50vw;
        /* Start from center */
        gap: 20px;
    }

    .project-panel {
        min-width: 85vw;
        /* Almost full screen width */
        height: 60vh;
    }

    .intro-panel {
        min-width: 85vw;
        align-items: center;
        text-align: center;
    }

    /* Skills */
    .skills-categories {
        gap: 40px;
    }

    .skill-list {
        justify-content: center;
    }

    .skill-category h3 {
        text-align: center;
    }
}