:root {
    --bg-color: #000000;
    --bg-secondary: #161617;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #2997ff;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --max-width: 1200px;
    --nav-height: 44px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(22, 22, 23, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.logo {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 24px;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Base Layout */
main {
    padding-top: var(--nav-height);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 100px 20px;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    padding: 120px 20px 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    flex-direction: column;
}

.profile-container {
    margin-bottom: 30px;
    animation: fadeInDown 1s ease-out;
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-content .subtitle {
    font-size: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.highlight {
    background: linear-gradient(90deg, #2997ff, #ad3dfc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(90deg, #2997ff, #ad3dfc);
    color: #ffffff;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(41, 151, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(173, 61, 252, 0.4);
}

/* About Section */
.about-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.large-text {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
    /* Base color is dimmed */
    max-width: 900px;
}

.large-text span {
    opacity: 0.2;
    /* Default state */
    transition: opacity 0.5s ease;
}

.large-text span.active {
    opacity: 1;
    /* Highlighted state */
    color: var(--text-primary);
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--bg-secondary);
}

.timeline-item {
    padding-left: 40px;
    margin-bottom: 60px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.2);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.timeline-content .description {
    margin-top: 10px;
    line-height: 1.6;
}

/* Projects Section */
.projects-section {
    background-color: #050505;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 24px;
    grid-auto-rows: minmax(280px, auto);
}

.bento-item {
    background: var(--bg-secondary);
    border-radius: 30px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bento-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bento-item:hover::after {
    opacity: 1;
}

.bento-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.bento-item.large {
    grid-column: span 2;
    grid-row: span 2;
    background: linear-gradient(135deg, #1c1c1e 0%, #101010 100%);
}

.bento-item.wide {
    grid-column: span 3;
}

.project-content {
    z-index: 1;
}

.project-content h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.project-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.4;
}

.project-tags {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Footer */
.footer {
    padding: 40px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 60px 20px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content .subtitle {
        font-size: 1.5rem;
    }

    .large-text {
        font-size: 2rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-item.large,
    .bento-item.wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 40px;
    }

    .timeline {
        margin-left: 20px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    opacity: 0;
    transition: opacity 0.4s ease;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Prevent clicks when hidden/opacity 0 if display flex is toggled */
}

.modal.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    /* Enable clicks when shown */
}

.modal-content {
    background-color: #1c1c1e;
    margin: auto;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    color: var(--text-primary);

    /* Zoom Animation Initial State */
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s ease;
}

.modal.show .modal-content {
    /* Zoom Animation End State */
    transform: scale(1);
    opacity: 1;
}

.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    position: absolute;
    top: 20px;
    right: 25px;
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

#modal-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    margin-right: 30px;
}

#modal-body {
    margin-top: 25px;
    line-height: 1.6;
    color: #d1d1d6;
    font-size: 1.1rem;
    max-height: 70vh;
    /* Scrollable content */
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom scrollbar for modal body */
#modal-body::-webkit-scrollbar {
    width: 6px;
}

#modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#modal-body::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

#modal-body h4 {
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.3rem;
}

#modal-body ul {
    list-style-position: inside;
    margin-bottom: 15px;
    margin-left: 10px;
}

#modal-body li {
    margin-bottom: 8px;
}

/* Contact Section */
.contact-section {
    padding-bottom: 100px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: 40px;
    min-height: 200px;
}

.contact-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    /* Slightly lighter on hover */
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-icon {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    margin-bottom: 15px;
    background: rgba(41, 151, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
}

.contact-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    word-break: break-all;
    /* Ensure long emails wrap */
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 60px 20px;
    }

    /* Mobile Navbar */
    .navbar {
        height: auto;
        padding: 10px 0;
        background: rgba(22, 22, 23, 0.95);
        /* Slightly more opaque on mobile */
    }

    .nav-content {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        display: flex;
        gap: 20px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-links a {
        margin-left: 0;
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content .subtitle {
        font-size: 1.5rem;
    }

    .large-text {
        font-size: 2rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-item.large,
    .bento-item.wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 40px;
    }

    .timeline {
        margin-left: 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-card {
        padding: 30px;
    }

    .contact-tagline {
        font-size: 1.1rem;
        padding: 0 10px;
    }
}

/* Skills Section */
.skills-section {
    background-color: #000000;
    /* Distinct background */
    padding-bottom: 50px;
}

/* Contact Tagline */
.contact-tagline {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 40px;
    background: linear-gradient(90deg, #2997ff, #9d00ff);
    -webkit-background-clip: text;
    /* Standard property for text gradient */
    background-clip: text;
    color: transparent;
    /* Fallback for transparency */
    -webkit-text-fill-color: transparent;
    opacity: 0.9;
}

/* Mouse Sparkle Effect */
.sparkle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9999;
    animation: sparkleAnim 0.8s forwards;
    transform: translate(-50%, -50%);
}

@keyframes sparkleAnim {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
}