:root {
    --bg-color: #18181b;
    /* Zinc 900 */
    --text-primary: #e2e8f0;
    /* Slate 200 */
    --text-secondary: #a1a1aa;
    /* Zinc 400 */
    --accent-color: #f97316;
    /* Orange 500 */
    --hover-bg: rgba(255, 255, 255, 0.05);
    --font-main: 'Outfit', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* For pseudo-element positioning */
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background-color: var(--accent-color);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

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

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

/* Scrolling Grid Animation */
@keyframes bg-scrolling-reverse {
    100% {
        background-position: 50px 50px;
    }
}

/* Background effect (Grid) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Grid pattern */
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAholAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAABnSURBVHja7M5RDYAwDEXRDgmvEocnlrQS2SwUFST9uEfBGWs9c97nbGtDcquqiKhOImLs/UpuzVzWEi1atGjRokWLFi1atGjRokWLFi1atGjRokWLFi1af7Ukz8xWp8z8AAAA//8DAJ4LoEAAlL1nAAAAAElFTkSuQmCC");
    background-repeat: repeat;
    animation: bg-scrolling-reverse 2s infinite linear;
    opacity: 0.1;
    /* Slightly more visible to react with spotlight */
    z-index: -2;
    /* Bottom layer */
    pointer-events: none;
}

/* Spotlight effect (Interactive) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(249, 115, 22, 0.1),
            /* Accent color glow (Orange) */
            transparent 80%);
    z-index: -1;
    /* Above grid, below content */
    pointer-events: none;
    mix-blend-mode: screen;
    /* Makes the grid lines 'pop' under the light */
}

/* Layout */
.container {
    display: flex;
    min-height: 100vh;
    max-width: 850px;
    /* Further reduced from 1024px */
    margin: 0 auto;
    padding: 0 2rem;
    gap: 3rem;
    /* Reduced gap for tighter layout */
}

/* Sidebar (Left) */
.sidebar {
    width: 35%;
    /* Slightly narrower */
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 0;
    animation: fadeIn 1.4s ease-out forwards;
    /* Fade in animation */
}

.profile-header h1 {
    font-size: 2rem;
    /* Reduced from 3rem to fit on one line */
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
    /* Reduced spacing */
    line-height: 1.1;
    /* Tighter line height */
}

.profile-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;

    /* Typing Effect */
    display: inline-block;
    overflow: hidden;
    border-right: 3px solid var(--accent-color);
    white-space: nowrap;
    margin: 0 auto 1rem auto;
    /* Center it */
    animation:
        typing 3.5s steps(30, end),
        blink-caret 0.75s step-end infinite;
    max-width: fit-content;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent-color)
    }
}

.tagline {
    color: var(--text-secondary);
    max-width: 300px;
    margin-bottom: 3rem;
}

/* Navigation */
.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    width: fit-content;
}

.nav-link:hover {
    color: #fff;
}

.nav-link .line {
    display: block;
    width: 30px;
    height: 1px;
    background-color: var(--text-secondary);
    margin-right: 15px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.nav-link.active {
    color: #fff;
}

.nav-link.active .line {
    width: 60px;
    background-color: var(--accent-color);
    /* Orange when active */
}

.nav-link:hover .line {
    background-color: var(--accent-color);
    /* Orange on hover */
}

/* Content (Right) */
.content {
    width: 65%;
    /* Slightly wider to compensate */
    padding: 4rem 0;
    /* Removed left padding, using gap instead */
}

.section {
    min-height: 50vh;
    /* Ensure enough scroll space */
    margin-bottom: 3rem;
    /* Reduced from 6rem */
    padding-top: 2rem;
    /* Offset for scroll spy accuracy if needed */
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
    /* Start invisible */
}

/* Staggered animation delays for sections */
.section:nth-of-type(1) {
    animation-delay: 0.4s;
}

.section:nth-of-type(2) {
    animation-delay: 0.6s;
}

.section:nth-of-type(3) {
    animation-delay: 0.8s;
}

.section:nth-of-type(4) {
    animation-delay: 1.0s;
}

#about {
    min-height: 40vh;
    /* First section can be smaller */
}

.section h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section h3 svg {
    color: var(--accent-color);
    width: 28px;
    height: 28px;
}

.section-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Social Icons */
.about-socials {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.social-btn:hover {
    background-color: var(--accent-color);
    color: #fff;
    /* Icon becomes white */
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
    border-color: var(--accent-color);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* Timeline Styles */
.timeline-item {
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    /* Remove underline for links */
    padding: 1rem;
    /* Add padding for hover area */
    border-radius: 8px;
    border: 1px solid transparent;
    /* Prevent layout shift on hover */
    position: relative;
    /* For arrow positioning */
}

/* External Link Arrow */
.timeline-item::after,
.project-card::after {
    content: '↗';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.2rem;
    color: var(--accent-color);
    opacity: 0;
    transform: translate(-10px, 10px);
    /* Start offset */
    transition: all 0.3s ease;
}

.timeline-item:hover::after,
.project-card:hover::after {
    opacity: 1;
    transform: translate(0, 0);
}

.timeline-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.timeline-item:hover .details h4 {
    color: var(--accent-color);
}

.timeline-item .date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 0.25rem;
}

.timeline-item .details h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

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

/* Project Cards */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-card {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 8px;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    border: 1px solid transparent;
    text-decoration: none;
    /* Remove underline for links */
    display: block;
    /* Ensure it takes full width */
    position: relative;
    /* For arrow positioning */
}

.project-card:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(249, 115, 22, 0.3);
    /* Accent color border on hover */
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.project-card h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

.tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tags span {
    background-color: rgba(249, 115, 22, 0.1);
    color: var(--accent-color);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.mobile-footer {
    display: none;
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        padding: 0 1.5rem;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 4rem 0 2rem 0;
        align-items: flex-start;
    }

    .content {
        width: 100%;
        padding: 0 0 4rem 0;
    }

    .nav-menu {
        display: none;
        /* Hide sidebar nav on mobile, could replace with hamburger */
    }

    .section h3 {
        display: block;
        /* Show section titles on mobile */
        position: sticky;
        top: 0;
        backdrop-filter: blur(8px);
        /* Reduced blur slightly */
        -webkit-backdrop-filter: blur(8px);
        padding: 1rem 1.5rem;
        /* Add horizontal padding to match container */
        margin-left: -1.5rem;
        /* Pull to left edge */
        margin-right: -1.5rem;
        /* Pull to right edge */
        z-index: 10;
        margin-top: -1px;
        /* Fix potential gap */
    }

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

    .mobile-footer {
        display: block;
    }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--accent-color);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: #ea580c;
    /* Darker orange */
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

/* ==================== CV Modal Styles ==================== */

/* CTA Button - Inline with social icons */
.cv-cta-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--accent-color), #ea580c);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
    height: 45px;
}

.cv-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.cv-cta-btn:active {
    transform: translateY(-1px);
}

.cv-cta-btn svg {
    flex-shrink: 0;
}

/* Modal Overlay */
.cv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cv-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.cv-modal-card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.cv-modal-overlay.active .cv-modal-card {
    transform: scale(1);
    opacity: 1;
}

/* Close Button */
.cv-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.cv-modal-close:hover {
    background-color: var(--accent-color);
    color: #fff;
    transform: rotate(90deg);
}

/* Modal Content */
.cv-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-image {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Modal Footer */
.cv-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.cv-download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-color), #ea580c);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.cv-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

/* Responsive Modal */
@media (max-width: 1024px) {
    .cv-modal-overlay {
        padding: 1rem;
    }

    .cv-modal-card {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 20px;
    }

    .cv-image {
        max-height: calc(95vh - 120px);
    }
}