:root {
    --bg-body: #fbfbfd;
    --bg-card: #ffffff;
    --bg-secondary: #f5f5f7;

    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    /* Darker for better contrast */
    --text-link: #0066cc;

    --accent: #2997ff;
    /* Apple Blue */
    --accent-hover: #0071e3;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Darker for light mode visibility */
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.16);

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;

    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #050505;
    --bg-card: #121212;
    --bg-secondary: #1c1c1e;

    --text-primary: #f5f5f7;
    --text-secondary: #86868b;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
    /* Offset for fixed header */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    border-radius: 50%;
    filter: blur(90px);
    /* Increased blur slightly for smoother large orbs */
    opacity: 0.85;
    /* Increased opacity */
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(41, 151, 255, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(140, 69, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -10s;
}

[data-theme="dark"] .orb-1 {
    background: radial-gradient(circle, rgba(41, 151, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
}

[data-theme="dark"] .orb-2 {
    background: radial-gradient(circle, rgba(140, 69, 255, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
}

.orb-1 {
    width: 600px;
    /* Increased size */
    height: 600px;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.35) 0%, rgba(0, 0, 0, 0) 70%);
    /* Stronger Blue */
    top: -15%;
    left: -15%;
    animation-delay: 0s;
}

.orb-2 {
    width: 700px;
    /* Increased size */
    height: 700px;
    background: radial-gradient(circle, rgba(175, 82, 222, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    /* Stronger Purple */
    bottom: -15%;
    right: -15%;
    animation-delay: -10s;
}

.orb-3 {
    width: 500px;
    /* Increased size */
    height: 500px;
    background: radial-gradient(circle, rgba(255, 149, 0, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    /* Stronger Orange */
    top: 30%;
    left: 10%;
    animation-delay: -5s;
}

.orb-4 {
    width: 650px;
    /* Increased size */
    height: 650px;
    background: radial-gradient(circle, rgba(255, 45, 85, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    /* Stronger Pink */
    bottom: 10%;
    left: 40%;
    animation-delay: -2s;
}



@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    transition: color 0.5s ease;
}

h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1.1;
    font-weight: 700;
}

/* Waving Hand Animation */
.wave-hand {
    display: inline-block;
    animation: wave 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

h2.section-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    text-align: center;
    margin-bottom: 3rem;
}

p.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
    margin: -1.5rem auto 4rem auto;
    /* pulls it closer to title but keeps bottom space */
    font-weight: 400;
}

p.lead {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

/* Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 60px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bg-secondary {
    background-color: var(--bg-secondary);
    transition: background-color 0.5s ease;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Visible border for light mode */
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.875rem;
}

.btn-primary {
    background: rgba(41, 151, 255, 0.7);
    color: white;
    box-shadow: 0 8px 20px rgba(41, 151, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: rgba(41, 151, 255, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(41, 151, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-pulse {
    animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(41, 151, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(41, 151, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(41, 151, 255, 0);
    }
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    /* Gray shade for light mode */
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Timeline Dots Gradient */


.timeline-dot {
    position: absolute;
    left: -5px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    /* Default (Light Mode) */
    background: linear-gradient(135deg, #007aff, #5856d6);
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
    border: 2px solid #fff;
}

[data-theme="dark"] .timeline-dot {
    background: linear-gradient(135deg, #2997ff, #8c45ff);
    box-shadow: 0 0 10px rgba(41, 151, 255, 0.4);
    border: none;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Visible border */
    background: rgba(0, 0, 0, 0.05);
    /* Gray background */
}

[data-theme="dark"] .badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 70px;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 24px;
}

.navbar.glass {
    background-color: rgba(251, 251, 253, 0.65);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .navbar.glass {
    background-color: rgba(10, 10, 10, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}


.nav-logo {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    min-width: 120px;
    /* Prevent shift during animation */
    display: inline-block;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-link.active {
    color: var(--text-primary);
    font-weight: 600;
}

[data-theme="dark"] .nav-link.active {
    color: white;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
    margin-left: 12px;
}

/* Background Elements */
.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 200, 0, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: 40%;
    left: 20%;
    animation-delay: -5s;
}

.orb-4 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(255, 0, 100, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: 20%;
    left: 50%;
    animation-delay: -2s;
}

[data-theme="dark"] .orb-3 {
    background: radial-gradient(circle, rgba(255, 200, 0, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
}

[data-theme="dark"] .orb-4 {
    background: radial-gradient(circle, rgba(255, 0, 100, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Hero Section */
.hero {
    padding-top: 100px;
    padding-bottom: 40px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.profile-image-wrapper {
    width: 160px;
    height: 160px;
    margin: 0 auto 32px;
    position: relative;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
    /* Ensure bg behind image */
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
    transition: border-color 0.5s ease;
}

.thug-glasses {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.profile-image-wrapper:hover .thug-glasses {
    opacity: 0.9;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 16px 0 24px;
    font-weight: 400;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 48px;
}

.about-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.5s ease, transform 0.4s ease, box-shadow 0.4s ease, border-color 0.5s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .about-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.about-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
    border-color: rgba(41, 151, 255, 0.3);
}

.about-card .icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 20px;
    background: rgba(41, 151, 255, 0.1);
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.about-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
    line-height: 1.6;
}

/* Skills */
.skills-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 12px;
}

[data-theme="dark"] .skill-category h3 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-list span {
    background: var(--bg-card);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

[data-theme="dark"] .skill-list span {
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.skill-list span:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(41, 151, 255, 0.05);
    box-shadow: 0 4px 12px rgba(41, 151, 255, 0.15);
}

.skill-list span i {
    font-size: 1.1rem;
    opacity: 0.8;
}


/* Theme-Aware Icons */
.hf-icon-light {
    display: inline-block;
}

.hf-icon-dark {
    display: none;
}

[data-theme="dark"] .hf-icon-light {
    display: none;
}

[data-theme="dark"] .hf-icon-dark {
    display: inline-block;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.project-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.5s ease, transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .project-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.project-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.project-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #34c759;
    /* Apple Green */
    letter-spacing: 0.05em;
    padding: 4px 8px;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 6px;
}

.project-status.private {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .project-status.private {
    background: rgba(255, 255, 255, 0.1);
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.project-tags span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    transition: background-color 0.5s ease;
}

.project-link {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.project-link:hover {
    gap: 10px;
    text-decoration: underline;
}

.project-link.disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    text-decoration: none;
    opacity: 0.5;
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .timeline::before {
    background: rgba(255, 255, 255, 0.1);
}

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

.timeline-dot {
    position: absolute;
    left: -5px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-body);
    /* Adapt to bg color */
    box-shadow: 0 0 0 2px var(--accent);
    transition: border-color 0.5s ease;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.timeline-content h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 12px;
}

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

.timeline-content a {
    color: var(--accent);
    text-decoration: underline;
}

/* Contact */
.contact-container {
    max-width: 1000px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 64px;
    background: var(--bg-card);
    padding: 64px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: background-color 0.5s ease;
}

[data-theme="dark"] .contact-grid {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
}

.contact-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.contact-item h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-item a,
.contact-item p {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--text-primary);
    color: var(--bg-card);
    /* Invert text color on hover */
    transform: translateY(-3px);
}

.contact-form textarea,
.contact-form input {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: var(--bg-body);
    /* Input same as body for card contrast */
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

[data-theme="dark"] .contact-form textarea,
[data-theme="dark"] .contact-form input {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-form textarea:focus,
.contact-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.1);
}

.contact-form button {
    margin-top: 8px;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--bg-body);
    transition: background-color 0.5s ease, border-top 0.5s ease;
}

[data-theme="dark"] .footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 900px) {

    .about-grid,
    .skills-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 24px;
        border-radius: 24px;
        border: 1px solid rgba(0, 0, 0, 0.05);
        gap: 20px;
        text-align: center;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    }

    [data-theme="dark"] .nav-links {
        background-color: rgba(20, 20, 20, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .about-grid,
    .skills-wrapper,
    .projects-grid,
    .publications-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust padding for mobile */
    .section {
        padding: 60px 0;
    }

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

    .timeline-dot {
        left: 15px;
    }

    .timeline-item {
        padding-left: 60px;
    }
}

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

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

/* Publications */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 32px;
}

.pub-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.5s ease, transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .pub-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pub-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.pub-year {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.pub-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.pub-authors {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.pub-authors strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pub-meta {
    margin-bottom: 24px;
    flex-grow: 1;
}

.pub-venue {
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    display: inline-block;
}

.pub-actions {
    display: flex;
    gap: 12px;
}

.mt-5 {
    margin-top: 48px;
}

.text-center {
    text-align: center;
}

.me-2 {
    margin-right: 8px;
}

/* Arrow Hover Effect */
.arrow-hover .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.arrow-hover .btn-secondary::after {
    content: '→';
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateX(-5px);
}

.arrow-hover:hover .btn-secondary::after {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .publications-grid {
        grid-template-columns: 1fr;
    }
}

/* Caption Container */
.caption-container {
    position: fixed;
    bottom: 110px;
    /* Increased from 90px to create gap */
    right: 30px;
    width: 300px;
    display: flex;
    flex-direction: column-reverse;
    /* New items at visual bottom (Start of axis) */
    align-items: flex-end;
    gap: 12px;
    z-index: 1500;
    pointer-events: none;
}

@media (max-width: 768px) {
    .caption-container {
        bottom: 85px;
        right: 20px;
        width: 260px;
    }
}

.caption-bubble {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    /* Callout shape */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid rgba(0, 0, 0, 0.05);

    /* Animation: Enter from bottom, slide up to position */
    animation: bubbleEnter 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
    /* Polished spring */
    transform-origin: bottom right;
    opacity: 0;
    will-change: transform, opacity, filter;
}

.caption-bubble.fade-out {
    animation: bubbleExit 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    /* Smoother, longer exit */
}

[data-theme="dark"] .caption-bubble {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes bubbleEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes bubbleExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
        filter: blur(8px);
        /* Vaporize effect */
    }
}

/* Typewriter Cursor */
.cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    /* Explicit height */
    background-color: #86868b;
    /* Grayish */
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.typewriter-text {
    font-weight: 600;
    color: var(--text-secondary);
    /* Gray */
    display: inline-block;
}

.highlight-text {
    font-weight: 700;
    color: var(--accent);
}

/* Replay Button */
.replay-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

@media (max-width: 768px) {
    .caption-container {
        bottom: 20px;
        /* Align with replay button */
        right: 80px;
        /* Start to the left of the 48px button + margin */
        left: 20px;
        /* Stretch across */
        width: auto;
        /* fluid width */
        height: 48px;
        /* Constrain height to match button */
        flex-direction: row-reverse;
        align-items: center;
        padding-right: 0;
        pointer-events: none;
        overflow: hidden;
        -webkit-mask-image: linear-gradient(to right, transparent, black 15%);
        mask-image: linear-gradient(to right, transparent, black 15%);
        justify-content: flex-start;
        /* Items start from right (flex-reverse) */
    }

    .caption-bubble {
        padding: 8px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
        border-radius: 999px;
        border-bottom-right-radius: 999px;
        animation: bubbleEnterMobile 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
        transform-origin: center right;
        margin-left: 8px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    }

    .caption-bubble.fade-out {
        animation: bubbleExitMobile 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .replay-btn {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

@keyframes bubbleEnterMobile {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes bubbleExitMobile {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-15px) scale(0.95);
        filter: blur(6px);
    }
}

[data-theme="dark"] .replay-btn {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.replay-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.replay-btn:hover {
    transform: translateY(-5px) scale(1.05);
    color: var(--accent);
    box-shadow: 0 12px 40px rgba(41, 151, 255, 0.25);
    background: var(--bg-card);
}

.replay-btn.pulse-attention {
    animation: attentionPulse 2s infinite;
}

@keyframes attentionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(41, 151, 255, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(41, 151, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(41, 151, 255, 0);
    }
}