:root {
    /* The "Cyber-Noir" Palette */
    --bg-dark: #050505;
    --bg-panel: #0f0f0f;
    --bg-card: #121212;
    --primary-red: #ff2a2a;
    --dim-red: #591010;
    --text-main: #f0f0f0;
    --text-muted: #888888;
    --border: rgba(255, 255, 255, 0.08);

    /* Spacing & Layout */
    --container-width: 1150px;
    --nav-height: 80px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------------- RESET & BASE ---------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Mesh Animation */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(255, 42, 42, 0.03), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 42, 42, 0.02), transparent 25%);
    pointer-events: none;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    color: #fff;
}

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

ul {
    list-style: none;
}

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

.text-red {
    color: var(--primary-red);
}

.bg-darker {
    background-color: #0a0a0a;
}

/* ---------------- NAVIGATION ---------------- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.logo .dot {
    color: var(--primary-red);
    font-size: 2rem;
    line-height: 0;
}

.nav-menu {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.highlight-link {
    color: var(--primary-red) !important;
    font-weight: 700;
}

/* Mobile Menu */
.nav-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 6px 0;
    transition: 0.3s;
}

/* ---------------- BUTTONS ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-red);
    color: #fff;
    border: 1px solid var(--primary-red);
    box-shadow: 0 0 20px rgba(255, 42, 42, 0.2);
}

.btn-primary:hover {
    background: transparent;
    box-shadow: 0 0 40px rgba(255, 42, 42, 0.4);
}

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

.btn-outline:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* ---------------- HERO ---------------- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--nav-height);
}

.hero-subtitle {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 40px;
}

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.5;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary-red);
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

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

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

/* ---------------- SECTIONS GENERAL ---------------- */
.section {
    padding: 120px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-red), transparent);
    opacity: 0.5;
}

/* ---------------- ABOUT ---------------- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: center;
}

.about-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.about-img {
    width: 100%;
    display: block;
    filter: grayscale(100%) contrast(1.1);
    transition: var(--transition);
}

.img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 42, 42, 0.1);
    mix-blend-mode: overlay;
    transition: var(--transition);
}

.about-img-wrapper:hover .about-img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.about-img-wrapper:hover .img-overlay {
    background: transparent;
}

.stats-row {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    padding-top: 30px;
}

.stat-item h3 {
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 5px;
}

.stat-item p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------------- SKILLS (OFFICIAL ICONS) ---------------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 24px;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    /* Slightly more rounded */
    padding: 35px 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.skill-card:hover {
    border-color: var(--primary-red);
    transform: translateY(-8px);
    box-shadow: 0 10px 30px -10px rgba(255, 42, 42, 0.15);
    background: linear-gradient(145deg, var(--bg-card), #1a1a1a);
}

.img-box {
    height: 60px;
    /* Fixed height container */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.skill-card img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(100%) brightness(0.9);
    /* Start B&W */
    transition: all 0.4s ease;
    opacity: 0.8;
}

/* Reveal full color and glow on hover */
.skill-card:hover img {
    filter: grayscale(0%) brightness(1.1);
    transform: scale(1.1);
    opacity: 1;
    drop-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Specific adjustments for Unity/dark logos on dark background */
.logo-unity,
.logo-pytorch {
    /* If the logo is black text, we might need to invert it. 
       Note: The PyTorch logo provided usually has white text, 
       but if it doesn't, uncomment the line below: */
    /* filter: grayscale(100%) invert(1) !important; */
}

.skill-card:hover .logo-unity {
    /* filter: grayscale(0%) invert(1) !important; */
}

.skill-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    transition: var(--transition);
}

.skill-card:hover h3 {
    color: #fff;
}

/* ---------------- RESEARCH (FEATURED) ---------------- */
.paper-card {
    background: radial-gradient(circle at top right, #1a0a0a, var(--bg-card));
    border: 1px solid rgba(255, 42, 42, 0.3);
    border-radius: 16px;
    padding: 3px;
    /* border width for glowing effect */
    position: relative;
    transform-style: preserve-3d;
}

.paper-content {
    background: var(--bg-card);
    border-radius: 13px;
    padding: 40px;
    position: relative;
    z-index: 2;
}

.paper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.badge {
    background: rgba(255, 42, 42, 0.1);
    color: var(--primary-red);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 42, 42, 0.3);
}

.pulsing-badge {
    animation: pulse 2s infinite;
}

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

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

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

.paper-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.authors {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
    font-style: italic;
}

.paper-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 8px;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-red);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.abstract {
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.7;
}

.paper-actions {
    display: flex;
    gap: 15px;
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 1px;
    background: var(--border);
}

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

.timeline-dot {
    position: absolute;
    left: -4px;
    top: 5px;
    width: 9px;
    height: 9px;
    background: var(--primary-red);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-red);
}

.timeline-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--primary-red);
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1.25rem;
}

.timeline-content h4 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.timeline-content ul {
    padding-left: 18px;
    list-style-type: disc;
    color: #bbb;
}

/* ---------------- PROJECTS ---------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-panel);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.icon-link {
    font-size: 2rem;
    color: #fff;
    transform: scale(0.8);
    transition: var(--transition);
}

.icon-link:hover {
    transform: scale(1.1);
    color: var(--primary-red);
}

.project-info {
    padding: 25px;
}

.tags {
    margin-bottom: 15px;
}

.tags span {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary-red);
    border: 1px solid rgba(255, 42, 42, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
}

.project-info h3 {
    margin-bottom: 10px;
}

.project-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---------------- CONTACT & FOOTER ---------------- */
.contact-lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.contact-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 60px;
}

.large-btn {
    padding: 16px 40px;
    font-size: 1rem;
}

.social-links {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.social-links a {
    position: relative;
}

.social-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-red);
    transition: 0.3s;
}

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

.social-links a:hover::after {
    width: 100%;
}

.separator {
    margin: 0 10px;
    color: var(--border);
}

footer {
    padding: 30px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    margin: 0 5px;
    box-shadow: 0 0 8px #00ff00;
}

/* ---------------- ANIMATION UTILITIES ---------------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

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

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

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

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--nav-height);
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        transition: 0.4s;
        border-top: 1px solid var(--border);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: block;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .paper-metrics {
        grid-template-columns: 1fr;
    }

    .contact-actions {
        flex-direction: column;
    }
}