/* --- 1. FONTS IMPORT (Loads automatically) --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Space+Grotesk:wght@400;600;700&display=swap');

/* --- 2. VARIABLES & RESET --- */
:root {
    /* Theme Colors: Void Black & Electric Violet */
    --bg: #050505;
    --bg-alt: #0F0F0F;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --text: #e2e8f0;
    --muted: #889ab0;

    /* Borders & Cards */
    --card-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --radius-md: 12px;

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(56, 189, 248, 0.08) 0%, transparent 40%);
}

/* --- 3. TYPOGRAPHY --- */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: #fff;
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

/* --- 4. NAVIGATION --- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-top: 20px;
    pointer-events: none;
}

.nav {
    pointer-events: auto;
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: var(--font-heading);
}

.logo-standalone {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.logo-standalone svg {
    width: 100%;
    height: 100%;
    display: block;
}

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

nav ul {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #8b5cf6;
    text-shadow: 0 0 12px var(--accent-glow);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: #16131c;
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
    transform: rotate(15deg) scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover img {
    transform: rotate(20deg) scale(1.1);
}

/* --- 5. MAIN CONTAINER --- */
main {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

section {
    padding: 4rem 0;
}

/* Headings */
.section-subtitle {
    color: var(--accent);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

.section-divider {
    display: none;
}

/* --- 6. HERO SECTION --- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 2rem;
    gap: 2rem;
}

.hero-visual {
    order: -1;
    display: flex;
    justify-content: center;
}

.avatar-card {
    width: 180px;
    height: 180px;
    padding: 5px;
    background: transparent;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    overflow: hidden;
    position: relative;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.avatar-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-orbit,
.avatar-glow {
    display: none;
}

/* Hero Content */
.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.hero-title span {
    display: block;
    font-size: 0.5em;
    color: var(--accent);
    margin-top: 0.5rem;
}

.hero-text {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    color: var(--muted);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
}

.chip {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--text);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: #7c3aed;
    border-color: #7c3aed;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* --- 7. ABOUT SECTION --- */
.about-container {
    display: grid;
    grid-template-columns: 1.3fr 2.7fr;
    gap: 4rem;
    align-items: start;
}

/* Bio */
.bio-text p {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.bio-text strong {
    color: #2d4a69;
    font-weight: 600;
}

.bio-text span {
    color: var(--accent);
}

/* Skills */
.subsection-header {
    font-size: 1.2rem;
    color: #fff;
    margin: 2.5rem 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: var(--transition);
}

.skill-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px -5px rgba(139, 92, 246, 0.2);
}

.skill-header {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.skill-tags span {
    font-size: 0.75rem;
    padding: 3px 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.skill-card:hover .skill-tags span {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Timeline */
.timeline-wrapper {
    position: relative;
}

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 1rem;
    padding-left: 0;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 106px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--border));
    z-index: 0;
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 2px;
}

.timeline-date {
    width: 85px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.4;
    flex-shrink: 0;
    margin-right: 0;
    padding-right: 10px;
    padding-left: 0;
    white-space: normal;
}

.timeline-date span:first-child {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.timeline-date .month {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: 100px;
    top: 45px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 2;
    transition: var(--transition);
}

.timeline-item:hover .timeline-marker {
    background: var(--accent);
    transform: scale(1.4);
    box-shadow: 0 0 25px var(--accent);
}

.timeline-preview {
    margin-left: 15px;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.timeline-item:hover .timeline-preview {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

.timeline-preview h4 {
    font-size: 1rem;
    margin: 0;
    color: var(--text);
}

.timeline-preview .company {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-range {
    white-space: nowrap;
    text-align: center;
}

/* Timeline Popup */
.timeline-popup {
    position: absolute;
    left: auto;
    right: 105%;
    top: 12px;
    width: 300px;
    background: #0a0a0a;
    border: 1px solid var(--accent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.timeline-popup::before {
    content: "";
    position: absolute;
    top: 25px;
    left: auto;
    right: -7px;
    width: 12px;
    height: 12px;
    background: #0a0a0a;
    border: 1px solid var(--accent);
    border-bottom: none;
    border-left: none;
    transform: rotate(45deg);
    z-index: 101;
}

.timeline-item:hover .timeline-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-15px) scale(1);
    pointer-events: auto;
}

.popup-header {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.popup-role {
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
    font-weight: 600;
}

.timeline-popup p {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

/* --- 8. RESUME & PROJECTS --- */
.resume-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--radius);
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
}

/* Project Cards Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* --- PROJECT CARD STYLES (UPDATED FOR MODAL) --- */
.project-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    padding-bottom: 1.23rem;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Cards are no longer anchor tags */
    text-decoration: none;
    color: inherit;
    cursor: default;
}

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

/* Project Images */
.project-thumb {
    width: 100%;
    height: 180px;
    cursor: pointer;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

/* Project Text Content */
.project-card>*:not(.project-thumb) {
    padding: 0 1.5rem;
}

.project-title {
    margin-top: 1.2rem;
    font-size: 1.2rem;
    color: #fff;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    /* Truncate long text */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Push meta tags to bottom */
    flex-grow: 1;
}

.project-meta {
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tag {
    font-size: 0.75rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    border-radius: 50px;
}

/* --- EXPAND BUTTON --- */
.card-expand-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.project-card:hover .card-expand-btn {
    opacity: 1;
    transform: scale(1.2);
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent));
}

/* --- 9. CONTACT FORM --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
}

.contact-card p {
    margin-bottom: 2rem;
    color: var(--muted);
}

.contact-card p {
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .contact-grid {
        /* minmax(0, 1fr) prevents long URLs from breaking the layout */
        grid-template-columns: 1.5fr minmax(0, 1fr);
        gap: 4rem;
        align-items: start;
    }
}

.field {
    margin-bottom: 1.5rem;
}

.field label {
    display: block;
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.field input,
.field textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    font-size: 1rem;
    color: var(--text);
    font-family: var(--font-body);
    transition: var(--transition);
    border-radius: 0;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
    background: linear-gradient(to bottom, transparent, rgba(139, 92, 246, 0.05));
    padding-left: 10px;
}

.contact-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.contact-row:hover {
    border-color: var(--accent);
    transform: translateX(5px);
}

footer {
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* --- 10. LIGHT MODE --- */
body.light-mode {
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    background-image: none;
}

body.light-mode .nav {
    background: rgba(255, 255, 255, 0.9);
}

body.light-mode .hero-title,
body.light-mode h2,
body.light-mode h3,
body.light-mode .modal-header h2 {
    color: #1e293b;
}

body.light-mode .chip {
    background: #f1f5f9;
    color: #475569;
}

body.light-mode .field input,
body.light-mode .field textarea {
    color: #1e293b;
    border-bottom-color: #cbd5e1;
}

body.light-mode .project-card,
body.light-mode .timeline-item,
body.light-mode .contact-row {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-content {
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

/* --- 11. MODAL STYLES (New Feature) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

/* Modal Internal Layout */
.modal-banner-container {
    width: 100%;
    height: 300px;
    background: #000;
}

.modal-banner-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-body {
    padding-top: 1rem;
    padding-bottom: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.modal-header h2 {
    font-size: 2rem;
    margin: 0;
    color: var(--text);
}

.modal-links {
    display: flex;
    gap: 10px;
}

/* Small button variants for modal */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.modal-description-scroll {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
}

/* Utility to hide buttons if link is empty */
.hidden {
    display: none !important;
}

.hidden-content {
    display: none;
}

.modal-description-scroll h3.modal-subheading {
    font-size: 1.2rem;
    color: var(--accent);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-heading);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
}

.modal-description-scroll ul.modal-list {
    list-style: none;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.modal-description-scroll ul.modal-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--muted);
}

.modal-description-scroll ul.modal-list li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.modal-description-scroll strong {
    color: var(--text);
    font-weight: 600;
}

.modal-description-scroll p {
    margin-bottom: 1rem;
}

/* --- 12. RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .nav {
        padding: 0.8rem 1rem;
    }

    nav ul {
        gap: 10px;
        font-size: 0.8rem;
    }

    /* Modal Mobile */
    .modal-banner-container {
        height: 200px;
    }

    .modal-header {
        flex-direction: column;
    }

    .modal-links {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-marker {
        left: 23px;
    }

    .timeline-date {
        display: none;
    }

    .timeline-item {
        gap: 35px;
    }

    .timeline-popup {
        position: relative;
        left: 0;
        top: 15px;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: var(--card-bg);
        border: 1px solid var(--border);
        box-shadow: none;
        z-index: 1;
    }

    .timeline-popup::before {
        display: none;
    }
}