/* Global Variables */
:root {
    --bg-color: #0F172A;
    --bg-alt-color: #1E293B;
    --bg-card: #1E293B;
    /* Added explicit card bg */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --accent-color: #38BDF8;
    /* Sky Blue */
    --accent-hover: #0EA5E9;
    --gold: #F59E0B;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --transition: all 0.3s ease;

    --container-width: 1200px;
    --section-padding: 120px 0;
    /* Increased whitespace */

    /* Modern Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    cursor: none;
    /* Custom cursor */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: var(--section-padding);
}

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

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-color);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-outline {
    opacity: 0.5;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin: 0 auto 4rem;
    position: relative;
    width: fit-content;
    display: block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: var(--transition);
    cursor: pointer;
    /* Fallback */
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
    color: var(--bg-color);
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

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

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

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    padding-bottom: 50px;
    /* Header height */
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.hero-content {
    flex: 1;
}

.hero-subtitle {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 20px;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-image-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img {
    width: 380px;
    height: 380px;
    object-fit: cover;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: 2;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
    animation: morph-img 8s ease-in-out infinite;
    position: relative;
}

.hero-shape {
    position: absolute;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), transparent 70%),
        radial-gradient(circle at 70% 70%, #4F46E5, transparent 70%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    filter: blur(40px);
    opacity: 0.6;
    animation: morph 8s ease-in-out infinite;
    z-index: 1;
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    }

    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

@keyframes morph-img {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    }

    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-primary);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% {
        top: 10px;
        opacity: 1;
    }

    100% {
        top: 30px;
        opacity: 0;
    }
}

/* About Section */
.about {
    background-color: var(--bg-alt-color);
}

.about-content {
    display: flex;
    justify-content: center;
    text-align: center;
}

.about-text {
    max-width: 800px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.personal-details {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.detail-item {
    text-align: left;
}

.detail-item .label {
    display: block;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.detail-item .value {
    color: var(--text-primary);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category {
    background-color: var(--bg-alt-color);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.skill-category h3 {
    margin-bottom: 20px;
    color: var(--accent-color);
    font-size: 1.3rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tags span {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 40px;
}

.project-card {
    background-color: var(--bg-alt-color);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
}

.project-image {
    height: 250px;
    background-color: #2D3748;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.project-content {
    padding: 30px;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.project-tags span {
    font-size: 0.8rem;
    color: var(--accent-color);
}

.project-links {
    display: flex;
    gap: 20px;
}

.project-links a {
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Experience & Education */
.experience {
    background-color: var(--bg-alt-color);
}

.timeline-column {
    background-color: var(--bg-alt-color);
    padding: 60px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    max-width: 900px;
    margin: 0 auto;
}

.timeline-column:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.timeline {
    position: relative;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 40px;
    /* Increased from 30px to give more room for date/title */
    margin-top: 30px;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -46px;
    /* Adjusted to match new padding-left (40px + border-width + half dot) */
    top: 5px;
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

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

.timeline-item h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.timeline-item h4 {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.timeline-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.cert-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.cert-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.cert-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.contact-link i {
    color: var(--accent-color);
    font-size: 1.2rem;
    transition: var(--transition);
}

.contact-link span {
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.contact-link:hover span {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.contact-link:hover i {
    transform: scale(1.1);
}

.contact-form {
    background-color: var(--bg-alt-color);
    padding: 40px;
    border-radius: 20px;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px 0;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.form-group label {
    position: absolute;
    left: 0;
    top: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
}

.form-group input:focus~label,
.form-group input:valid~label,
.form-group textarea:focus~label,
.form-group textarea:valid~label {
    top: -24px;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
}

/* Footer */
.footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent-color);
}

/* Media Queries */
@media (max-width: 991px) {
    .section-title {
        font-size: 2rem;
    }

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

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .navbar {
        display: none !important;
        /* Completely hide navbar container on mobile */
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .nav-link {
        font-size: 1.5rem;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Hide hamburger menu entirely on mobile */
    .menu-toggle {
        display: none;
    }

    .hero .container {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        padding-top: 20px;
        /* Reduced to move image closer to header */
    }

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-image-wrapper {
        margin-bottom: -15px;
        /* Negative margin to pull text closer */
        margin-top: 10px;
        /* Reduced space above image even more */
    }

    .hero-content {
        margin-top: -10px;
    }

    .hero-image-container {
        width: 280px;
        height: 280px;
    }

    .hero-img {
        width: 260px;
        height: 260px;
    }

    .hero-shape {
        width: 300px;
        height: 300px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 80%;
        max-width: 300px;
        text-align: center;
    }

    .logo {
        font-size: 1.4rem;
    }

    .scroll-down {
        display: none;
    }

    .section {
        padding: 60px 0;
    }

    .footer .container {
        flex-direction: column;
        gap: 20px;
    }

    .exp-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .timeline {
        padding-left: 20px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Location details */
.timeline-item .location {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.8;
}

.timeline-item .location i {
    color: var(--accent-color);
    font-size: 0.8rem;
}

/* Centered Timeline (Experience Section) */
.centered-timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
    border-left: none;
    /* Override default timeline border */
}

/* Central Line */
.centered-timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

/* Timeline Items */
.centered-timeline .timeline-item {
    padding: 30px;
    background-color: var(--bg-alt-color);
    width: 45%;
    position: relative;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.centered-timeline .timeline-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Positioning */
.centered-timeline .timeline-item.left {
    left: 0;
}

.centered-timeline .timeline-item.right {
    left: 55%;
}

/* Dots on Central Line */
.centered-timeline .timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -50px;
    /* Adjust for left items */
    background-color: var(--bg-color);
    border: 4px solid var(--accent-color);
    top: 30px;
    border-radius: 50%;
    z-index: 1;
    transition: var(--transition);
}

.centered-timeline .timeline-item.right::after {
    left: -61px;
    /* Adjust for right items (50px gap + 11px to center on 4px line?) needs tuning */
}

/* Connectors (Arrows) */
.centered-timeline .timeline-item::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 32px;
    width: 0;
    z-index: 1;
    border: medium solid var(--bg-alt-color);
}

.centered-timeline .timeline-item.left::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--bg-alt-color);
}

.centered-timeline .timeline-item.right::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--bg-alt-color) transparent transparent;
}


/* Fix dot positioning for left/right */
.centered-timeline .timeline-item.left::after {
    right: -11.5%;
    /* Approximate position, needs checking */
}

.centered-timeline .timeline-item.right::after {
    left: -11.5%;
}

/* Better Dot Positioning using calculation */
.centered-timeline .timeline-item.left::after {
    right: -61px;
    /* 50% (center) is 5% away from 45% width. Container width is variable.
                     Let's verify logic: 
                     Gap between items is 10%. Line is at 50%. 
                     Item width 45%. 
                     So gap between item edge and center line is 5%.
                     This is tricky with % positioning for dots.
                     Let's use fixed pixels if possible or calc.
                  */
    right: unset;
    left: 111.1%;
    /* 50 / 45 approx */
}

.centered-timeline .timeline-item.right::after {
    left: -24px;
    /* Hardcode trial */
    right: unset;
    /* Reset */
}

/* Let's try a different approach for dots: stick them to the main container, not the item */
/* Actually, sticking to item is better for responsiveness if we keep % widths. */

/* Refined Dot Positioning */
.centered-timeline .timeline-item::after {
    top: 30px;
    /* Align with arrow */
}

.centered-timeline .timeline-item.left::after {
    left: calc(100% + 5vw - 7px);
    /* 45% + 5% = 50% line. 
                                     But 5vw of container... 
                                     Let's use absolute positioning relative to the line? No. */
    /* Re-think: simple percentage */
    left: 110.8%;
    /* (50 - 45) / 45 * 100 ... no.
                      Distance from left edge of item to center = 50% of container.
                      Item width = 45% of container.
                      So dist = 50/45 = 111.11% of item width.
                   */
    left: 111.1%;
    margin-left: -10px;
    /* Center the 20px dot */
}

.centered-timeline .timeline-item.right::after {
    left: -11.1%;
    /* Distance from left edge of right item to center = -5% of container.
                     -5 / 45 = -11.11%
                  */
    margin-left: -10px;
}


/* Reset Default Timeline Styles */
.centered-timeline .timeline-item h3 {
    margin-top: 0;
}

.centered-timeline .timeline-item .year {
    display: inline-block;
    margin-bottom: 10px;
}

/* Responsive Media Queries */
@media screen and (max-width: 768px) {
    .centered-timeline::after {
        left: 31px;
    }

    .centered-timeline .timeline-item {
        width: 100%;
        padding: 20px;
        padding-left: 60px;
        left: 0 !important;
    }

    .centered-timeline .timeline-item.right {
        left: 0;
    }

    /* Hide custom centered timeline arrows and dots on mobile,
       to rely on the base .timeline-item styling instead.
       This prevents stray characters and overlapping dots. */
    .centered-timeline .timeline-item::before,
    .centered-timeline .timeline-item::after {
        display: none !important;
    }

    /* Modify card appearance for mobile to look like default timeline but with card style */
    .centered-timeline .timeline-item {
        margin-bottom: 30px;
    }
}

/* Scroll Animation Styles */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.animate-on-scroll.show {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delays */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}