:root {
    /* Colors */
    --bg-color: #05050a;
    --bg-secondary: #0a0a14;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-color: #f2f2f2;
    --accent-glow: rgba(255, 255, 255, 0.4);

    /* Enhanced Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    /* Typography */
    --font-heading: 'Times New Roman', Times, serif;
    --font-body: 'Times New Roman', Times, serif;

    /* Variables */
    --nav-width: 80px;
    --nav-expanded-width: 200px;
    --border-radius: 16px;
    --transition-fast: 0.2s ease;
    --transition-med: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body.dark-theme {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography styles */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 800;
}

.accent-dot {
    color: var(--accent-color);
}

/* Base Styles */
a {
    text-decoration: none;
    color: inherit;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 1px 1px var(--glass-highlight);
}

/* Ambient Background */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    background-color: var(--bg-color);
}

.blob {
    position: absolute;
    filter: blur(90px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: 10%;
    left: 20%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: 10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 60%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(255, 0, 128, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(10%, -10%) scale(1.1);
    }

    66% {
        transform: translate(-5%, 15%) scale(0.9);
    }

    100% {
        transform: translate(20%, 5%) scale(1.05);
    }
}

/* Floating Leaf Animations */
.leaf-breeze {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.leaf {
    position: absolute;
    opacity: 0.7;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.4));
    transition: margin-top 3.5s ease-out;
    margin-top: 0px;
}

.leaf.clicked {
    transition: margin-top 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    margin-top: -200px;
}

.leaf-tilt {
    transition: transform 3.5s ease-out;
    will-change: transform;
}

.leaf.clicked .leaf-tilt {
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: rotate(80deg) scale(1.1);
}

body.leaf-hover {
    cursor: pointer !important;
}

.leaf svg {
    animation: leaf-flutter 4s ease-in-out infinite alternate;
}

.leaf-1 {
    top: 5%;
    left: -10vw;
    animation: float-path-1 25s linear infinite;
}

.leaf-2 {
    top: 60%;
    left: -20vw;
    animation: float-path-2 30s linear infinite;
    animation-delay: 5s;
}

@keyframes leaf-flutter {
    0% {
        transform: rotate(-15deg) rotateX(10deg);
    }

    100% {
        transform: rotate(15deg) rotateX(-10deg);
    }
}

@keyframes float-path-1 {
    0% {
        transform: translate(0, 0) rotate(45deg);
        opacity: 0;
    }

    5% {
        opacity: 0.7;
    }

    95% {
        opacity: 0.7;
    }

    100% {
        transform: translate(120vw, 30vh) rotate(225deg);
        opacity: 0;
    }
}

@keyframes float-path-2 {
    0% {
        transform: translate(0, 0) rotate(-45deg);
        opacity: 0;
    }

    5% {
        opacity: 0.7;
    }

    95% {
        opacity: 0.7;
    }

    100% {
        transform: translate(120vw, -20vh) rotate(-225deg);
        opacity: 0;
    }
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--nav-width);
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 100;
    transition: width var(--transition-med);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.glass-nav:hover {
    width: var(--nav-expanded-width);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item i {
    font-size: 1.5rem;
    min-width: 30px;
    text-align: center;
    transition: color var(--transition-fast);
}

.nav-item span {
    margin-left: 1.5rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-med);
    white-space: nowrap;
}

.glass-nav:hover .nav-item span {
    opacity: 1;
    transform: translateX(0);
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: inset 0 1px 1px var(--glass-highlight);
    border-radius: 8px;
    margin: 0 0.5rem;
}

.nav-item.active i {
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Main Content */
main {
    margin-left: var(--nav-width);
    padding: 0 5%;
    max-width: 1400px;
}

section {
    min-height: 100vh;
    padding: 6rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.5) 100%);
    color: #111;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(240, 240, 240, 0.7) 100%);
    box-shadow: 0 8px 25px var(--accent-glow), inset 0 1px 2px rgba(255, 255, 255, 1);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 1px var(--glass-highlight);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Hero Section */
.hero-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cursor {
    display: inline-block;
    color: var(--accent-color);
    animation: blink 1s step-end infinite;
    -webkit-text-fill-color: var(--accent-color);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 450px;
}

.image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    z-index: -1;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

.hero-image-wrapper {
    position: relative;
    padding: 3px;
    border-radius: calc(var(--border-radius) + 3px);
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-med), box-shadow var(--transition-med);
    background: rgba(255, 255, 255, 0.05);
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 60%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 1) 100%);
    animation: rotate-border 2s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-med);
    z-index: 0;
}

.hero-image-wrapper:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 60px 15px rgba(255, 255, 255, 0.7);
}

.hero-image-wrapper:hover::before {
    opacity: 1;
}

@keyframes rotate-border {
    100% {
        transform: rotate(360deg);
    }
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
    z-index: 1;
    position: relative;
    object-fit: cover;
    background: var(--bg-color);
    /* To prevent gradient leaking inside the padding */
}

/* About Section */
.about-content {
    padding: 3rem;
    font-size: 1.1rem;
}

.about-content p {
    margin-bottom: 1.5rem;
}

/* Portfolio Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition-med), box-shadow var(--transition-med);
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 1px var(--glass-highlight);
    border-radius: 20px;
    font-weight: 500;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition-fast);
}

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

.project-link i {
    transition: transform var(--transition-fast);
}

.project-link:hover i {
    transform: translateX(5px);
}

/* Contact Section */
.contact-card {
    padding: 4rem;
    text-align: center;
}

.contact-desc {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.015);
    transition: var(--transition-fast);
}

.contact-item:not(.no-hover):hover {
    background: rgba(0, 210, 255, 0.05);
    transform: translateY(-5px);
}

.contact-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 1px var(--glass-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    transition: var(--transition-med);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-item:not(.no-hover):hover .contact-icon {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.5) 100%);
    border-color: rgba(255, 255, 255, 0.8);
    color: #111;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
}

/* Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    visibility: hidden;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding-top: 8rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image-container {
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-width: 0px;
    }

    .glass-nav {
        top: auto;
        bottom: 0;
        width: 100% !important;
        height: 70px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        background: rgba(10, 10, 10, 0.8);
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 0;
    }

    .nav-item {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem;
        justify-content: center;
    }

    .nav-item span {
        display: block;
        opacity: 1;
        transform: none;
        margin-left: 0;
    }

    .glass-nav:hover .nav-item span {
        transform: none;
    }

    .nav-item i {
        min-width: auto;
        font-size: 1.25rem;
    }

    main {
        margin-left: 0;
        padding-bottom: 70px;
        /* Space for bottom nav */
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .about-content,
    .contact-card {
        padding: 2rem;
    }

    .hero-section {
        padding-top: 4rem;
    }

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