:root {
    /* Theme Colors - Deep Professional Dark */
    --bg-body: #050505;

    /* Glassmorphism Variables */
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --blur-strength: 16px;

    --text-primary: #ededed;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    /* Accents */
    --accent-green: #4ade80;
    --accent-purple: #c084fc;
    --accent-patent: #f59e0b;
    --accent-photo: #38bdf8;

    /* Spacing */
    --radius: 12px;
    --nav-width: 280px;
}

* {
    box-sizing: border-box;
}

body.preload * {
    animation-duration: 0s !important;
    -webkit-animation-duration: 0s !important;
    transition: none !important;
}

body.composited .chat-window {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

/* --- BACKGROUND CANVAS --- */
#bio-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: #050505;
    /* Solid very dark bg, dots drawn by JS */
}

/* Deep Lighting Blobs */
.ambient-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
    transition: transform 0.5s ease-out;
    will-change: transform;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.15) 0%, transparent 70%);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
}

/* --- Security: Prevent Text Selection --- */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;

    /* Prevent highlighting text to deter copying */
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+/Edge */
    user-select: none;
    /* Standard */
}

/* Allow selection only in input fields (like the chat) so users can type */
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

html {
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* --- Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Glassmorphism Utility --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
    will-change: transform;
}

/* --- Layout Grid --- */
.layout {
    max-width: 1140px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--nav-width) 1fr;
    gap: 0;
    padding: 60px 24px;
    align-items: start;
}

/* --- Left Sidebar --- */
.sidebar {
    position: sticky;
    top: 40px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-right: 40px;
    padding-bottom: 20px;
    z-index: 4000;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* Profile Block */
.profile-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0 0 16px;
    border-radius: var(--radius);
    flex-shrink: 0;
}



.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid rgba(74, 222, 128, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(74, 222, 128, 0.08);
    transition: transform 0.4s ease, border-color 0.4s ease;
    transform: translateZ(0);
    background-color: #222;
    display: block;
    margin: 0 auto;
    position: relative;
    left: -44px;
}

.avatar:hover {
    transform: scale(1.05);
    border-color: var(--accent-green);
}

.name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary);
}

.role {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
}

.bio {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 65ch;
}

/* --- Navigation Links --- */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    flex-shrink: 0;
}

/* The Moving Glider Pill (Vertical Line) */
.nav-glider {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 44px;
    background: var(--accent-green);
    border: none;
    border-radius: 0;
    z-index: 2;
    opacity: 0;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
    transition: top 0.7s cubic-bezier(0.23, 1, 0.32, 1), height 0.7s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
}

.nav-item {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.6;
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: color 0.2s, opacity 0.3s ease;
    position: relative;
    z-index: 2;
}

.nav-item:hover {
    color: var(--text-primary);
    opacity: 1;
}

.nav-item.active {
    color: var(--text-primary);
    font-weight: 500;
    opacity: 1;
}

.nav-item i,
.nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
    min-width: 18px;
}

.nav-item:hover i,
.nav-item:hover svg,
.nav-item.active i,
.nav-item.active svg {
    opacity: 1;
    color: var(--accent-green);
}

/* Social Links */
.socials {
    display: flex;
    gap: 16px;
    padding: 0;
    flex-shrink: 0;
}

.social-link {
    color: var(--text-tertiary);
    transition: transform 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    color: var(--accent-green);
    transform: translateY(-3px);
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 20px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(12px);
    z-index: 3000;
    border-bottom: 1px solid var(--glass-border);
    justify-content: space-between;
    align-items: center;
}

.mobile-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 15, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3500;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Main Content --- */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 76px;
    padding-left: 60px;
    min-height: 80vh;
    padding-bottom: 120px;
}

section {
    scroll-margin-top: 80px;
}

/* Section Header Layout */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
    margin-bottom: 24px;
}

#testimonials .section-title {
    margin-bottom: 16px;
}

.section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border), transparent);
}

.section-link-btn {
    font-size: 12px;
    color: var(--accent-photo);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 16px;
}

.section-link-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent-photo);
    color: #fff;
}

/* v4: Typing Hero Text */
.hero-headline {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: white;
    min-height: 2.2em;
}

.typewriter-text {
    background: linear-gradient(to right, var(--accent-green), var(--accent-photo));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 60ch;
    line-height: 1.7;
}

/* Competencies Grid */
.competency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.comp-card {
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 16px;

    /* Apply unified glass panel */
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}

.comp-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.comp-card i,
.comp-card svg {
    color: var(--accent-green);
    width: 24px;
    height: 24px;
}

.comp-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* v4: Connected Experience Timeline */
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.exp-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    position: relative;
    padding-bottom: 32px;
}

.exp-item:last-child {
    padding-bottom: 0;
}

.exp-date {
    font-size: 13px;
    color: var(--text-tertiary);
    font-family: monospace;
    padding-top: 2px;
    text-align: right;
}

.exp-timeline-node {
    position: absolute;
    left: 156px;
    top: 6px;
    bottom: 0;
    width: 3px;
    /* Increased weight */
    background: linear-gradient(to bottom, var(--glass-highlight), var(--glass-border) 80%);
    border-radius: 2px;
}

.exp-item:last-child .exp-timeline-node {
    display: none;
}

.exp-dot {
    position: absolute;
    left: -9px;
    top: 0;
    width: 14px;
    /* Increased size */
    height: 14px;
    border-radius: 50%;
    background: var(--bg-body);
    border: 2px solid var(--text-tertiary);
    transition: border-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.4s, transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s;
}

.exp-item:hover .exp-dot,
.exp-item.current .exp-dot {
    border-color: var(--accent-green);
    background: var(--accent-green);
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.6);
    /* Richer glow */
    transform: scale(1.2);
}

.exp-details {
    padding-left: 24px;
}

.exp-details h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.exp-org {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: block;
}

.exp-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 65ch;
}

/* Education Grid */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.edu-card {
    padding: 24px;
    border-radius: var(--radius);
}

.edu-degree {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

.edu-school {
    color: var(--text-secondary);
    font-size: 13px;
}

/* v4: Animated Skill Bars */
.skills-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.skill-category h4 {
    font-size: 14px;
    color: var(--text-primary);
    /* Brighter */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* Increased tracking */
    margin-bottom: 24px;
    margin-top: 0;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Optional: Add a subtle glow dot before category titles */
.skill-category h4::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.skill-bar-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skill-bar-item {
    width: 100%;
}

.sb-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.sb-track {
    width: 100%;
    height: 6px;
    background: var(--glass-bg);
    border-radius: 3px;
    overflow: hidden;
}

.sb-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-photo));
    width: 0%;
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

section.active .sb-fill {
    width: var(--w);
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.project-card {
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
    text-decoration: none;
    position: relative;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--glass-highlight);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.project-img {
    width: 200px;
    background: #222;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.project-content {
    padding: 32px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
    max-width: 65ch;
}

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

.tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 500;
}

/* Photography - Album Style */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.photo-item {
    height: 280px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;

    /* Apply unified glass panel */
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}

.photo-item:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.photo-item:hover img {
    transform: scale(1.1);
}

/* Album Icon Overlay */
.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    pointer-events: none;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-album-label {
    color: var(--accent-photo);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
    font-weight: 700;
}

.photo-loc {
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Album Modal */
.album-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 6000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.album-modal.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.album-header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.album-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    color: white;
    font-weight: 600;
}

.album-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

.album-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 20px;
}

.album-main-img {
    max-width: 90%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.album-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    max-width: 100%;
}

.album-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: 0.2s;
}

.album-thumb.active {
    border-color: var(--accent-photo);
    opacity: 1;
}

.album-thumb:hover {
    opacity: 1;
}

/* Patents & Pubs */
.list-group {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;

    /* Apply unified glass panel */
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.2);
}

.list-item {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--glass-border);
    transition: background-color 0.3s ease, padding-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    text-decoration: none;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 32px;
    /* Smoother indent */
}

.list-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.list-meta {
    font-size: 13px;
    color: var(--text-tertiary);
}

.list-year {
    font-size: 13px;
    color: var(--text-tertiary);
    font-family: monospace;
}

.view-all-link {
    text-align: right;
    display: block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--accent-photo);
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* v12: UPDATED Testimonials */
.testimonial {
    /* REMOVED border-left */
    /* border-left: 4px solid var(--accent-purple); */
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    padding-left: 32px;
    /* Added padding for new line */
    border-radius: 0 12px 12px 0;
    margin-bottom: 0;
    position: relative;
    /* For pseudo-element */
}

/* NEW: Short Vertical Accent Bar */
.testimonial::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20px;
    /* Start aligned with top content */
    width: 4px;
    height: 40px;
    /* Fixed short height */
    background: var(--accent-purple);
    border-radius: 0 4px 4px 0;
}

.testimonial-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quote {
    font-size: 16px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
    line-height: 1.7;
    max-width: 65ch;
}

.author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.author span {
    font-weight: 400;
    color: var(--text-tertiary);
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.project-modal.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.modal-card {
    background: #111;
    border: 1px solid var(--glass-border);
    width: 800px;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 20px;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.7);
}

.project-modal.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    height: 300px;
    position: relative;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-body {
    padding: 40px;
}

.modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 24px;
}

.modal-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 24px;
}

/* New Modal Link Button */
.modal-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-purple);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, background-color 0.2s;
    margin-top: 16px;
}

.modal-link-btn:hover {
    background: #a855f7;
    transform: translateY(-2px);
}

.modal-link-btn.hidden {
    display: none;
}

/* --- Chat Widget Styles --- */
.chat-widget-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    /* Reduced from 48px */
    height: 40px;
    /* Reduced from 48px */
    background: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(192, 132, 252, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #fff;
}

.chat-widget-toggle:hover {
    transform: scale(1.1) rotate(5deg);
}

.chat-window {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 320px;
    height: 450px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-badge {
    font-size: 10px;
    background: linear-gradient(135deg, var(--accent-purple), #8b5cf6);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
}

.chat-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

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

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

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px 12px 12px 12px;
    color: var(--text-primary);
}

.message.user {
    align-self: flex-end;
    background: var(--accent-purple);
    border-radius: 12px 12px 4px 12px;
    color: white;
}

.message.bot strong {
    color: var(--accent-green);
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 10px 16px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.chat-input:focus {
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.08);
}

.send-btn {
    background: var(--accent-purple);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: transform 0.2s, background-color 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
    background: #a855f7;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.suggestions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.suggestion-chip {
    font-size: 12px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: border-color 0.2s, color 0.2s;
}

.suggestion-chip:hover {
    border-color: var(--accent-purple);
    color: white;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    align-self: flex-start;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Media Queries - MOBILE ENHANCEMENTS */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .layout {
        grid-template-columns: 1fr;
        gap: 40px;
        /* Increased bottom padding for relaxed feel */
        padding: 100px 20px 100px;
        /* LIMIT WIDTH OF CONTENT ON MOBILE */
        max-width: 500px;
        /* Constrain content width */
        margin-left: auto;
        /* Center layout if screen is wider */
        margin-right: auto;
        padding-left: 32px;
        /* Add breathing room on sides */
        padding-right: 32px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 80%;
        background: #0a0a0a;
        border-right: 1px solid var(--glass-border);
        transform: translateX(-100%);
        padding: 24px;
        padding-right: 24px;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        max-height: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body {
        background-attachment: scroll;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .main-content {
        padding-left: 0;
        border-left: none;
        /* MASSIVE INCREASE IN GAP: 64px -> 80px for breathing room */
        gap: 80px;
    }

    /* Timeline adjust for mobile */
    .exp-item {
        grid-template-columns: 1fr;
        /* Increased internal spacing */
        gap: 16px;
        /* Increased bottom padding */
        padding-bottom: 40px;
        padding-left: 20px;
    }

    .exp-timeline-node {
        left: 0;
        top: 0;
    }

    .exp-dot {
        left: -5px;
    }

    .exp-date {
        text-align: left;
        padding-top: 0;
        margin-bottom: 4px;
    }

    .exp-details {
        padding-left: 10px;
        border: none;
    }

    /* Increased gap for project cards */
    .project-grid {
        gap: 32px;
    }

    .project-card {
        flex-direction: column;
    }

    .project-img {
        width: 100%;
        height: 200px;
    }

    /* Increased gap for skills */
    .skills-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .chat-window {
        width: calc(100% - 40px);
        bottom: 100px;
        right: 20px;
        left: 20px;
    }

    .hero-headline {
        font-size: 32px;
    }

    /* Relaxed Hero Text */
    .hero-sub {
        line-height: 1.8;
        margin-bottom: 40px;
    }

    .modal-card {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .site-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ========================================= */
/* MOBILE LIVELINESS (STRATEGY A & B)     */
/* ========================================= */

/* 1. Global styles for the active state - defined OUTSIDE media query
           so they apply whenever the JS adds the class. */
.mobile-active {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.3) !important;
    /* Brighter/Whiter border */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    /* Deep neutral shadow */
    z-index: 10;
    background: rgba(255, 255, 255, 0.08);
    /* Slightly brighter background */
    transition: all 0.4s ease;
    /* Ensure smooth transition */
}

/* Specific tweak for project cards to ensure image scales nicely */
.mobile-active .project-img {
    transform: scale(1.05);
}

/* Strategy B: Ambient Breathing 
           Subtle pulse for cards when not active, to show they are "alive" */
@keyframes mobile-breathe {

    0%,
    100% {
        border-color: var(--glass-border);
    }

    50% {
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* Only apply breathing animation on touch/small screens */
@media (max-width: 768px),
(hover: none) and (pointer: coarse) {

    .glass-panel,
    .project-card,
    .photo-item {
        /* Optional: Add breathing effect if you want constant motion */
        /* animation: mobile-breathe 4s infinite ease-in-out; */
        will-change: transform, border-color;
        /* Performance optimization */
    }
}

/* --- Footer --- */
.site-footer {
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 24px;
    padding-left: calc(var(--nav-width) + 24px + 60px);
    /* sidebar + layout padding + main-content padding */
    padding-right: 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 32px;
}

.footer-text {
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

.scroll-top-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-tertiary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-top-btn:hover {
    color: var(--accent-green);
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.2);
}