:root {
    --bg-deep: #050505;
    --bg-card: rgba(25, 25, 30, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0aa;
    --text-light: #a0a0aa;
    --accent: #00E5FF;
    --accent-glow: rgba(0, 229, 255, 0.3);
    --accent-secondary: #7000FF;
    --gradient-text: linear-gradient(90deg, #00E5FF, #7000FF, #00E5FF);
}

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

html {
    scroll-behavior: smooth;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
.logo {
    font-family: 'Outfit', sans-serif;
}

/* Typography specifics — only highlight spans inside headings and named elements */
.name span,
.section-title span {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientShift 6s linear infinite;
}

@keyframes gradientShift {
    to { background-position: 200% center; }
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animated Background */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #0a0a0f 0%, #000000 100%);
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle at center, rgba(112, 0, 255, 0.15) 0%, transparent 70%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle at center, rgba(0, 229, 255, 0.15) 0%, transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle at center, rgba(0, 255, 157, 0.08) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(5%, 10%) scale(1.1);
    }

    100% {
        transform: translate(-5%, -5%) scale(0.9);
    }
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}

.hover-glow:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.4);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1100;
    transition: background-color 0.3s ease, padding 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    padding: 1rem 0;
    background-color: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.15rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Layout Utilities */
.section {
    min-height: 100vh;
    padding: 8rem 2rem 4rem;
    position: relative;
}

.section-container {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 800;
}

.subsection-title {
    font-size: 1.8rem;
    margin: 3rem 0 1.5rem;
    font-weight: 600;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    width: 100%;
    gap: 4rem;
}

.hero-text {
    flex: 1;
}

.greeting {
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.name {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.role {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.hero-summary {
    max-width: 650px;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    line-height: 1.75;
}

.hero-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    max-width: 640px;
    margin-bottom: 1rem;
}

.hero-keywords span {
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.18);
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.2;
}

.location {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.divider {
    color: var(--border-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.glass-btn:hover {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    max-width: 450px;
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pulse 4s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

.hero-image {
    width: 300px;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: rotate(3deg);
    transition: transform 0.5s ease;
}

.hero-image:hover {
    transform: rotate(0deg) scale(1.02);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(15%) contrast(1.05);
}

/* AI Transforming Logo Animation */
.ai-logo {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 0.2rem 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 2px;
    text-decoration: none;
}

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

.ai-ntonio {
    display: inline-block;
    overflow: hidden;
    white-space: pre;
    color: var(--text-primary);
    animation: expandTextAntonio 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.ai-i {
    position: relative;
    color: transparent !important; /* hide the L */
    display: inline-block;
}

.ai-i::before {
    content: 'I';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent); /* 'I' in accent color */
    animation: fadeOutI 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.ai-i::after {
    content: 'L';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent); /* 'L' in accent color */
    animation: fadeInL 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.ai-obo {
    display: inline-block;
    overflow: hidden;
    white-space: pre;
    color: var(--accent);
    animation: expandTextObo 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.ai-s { color: var(--accent-secondary); }

.ai-antos {
    display: inline-block;
    overflow: hidden;
    white-space: pre;
    color: var(--accent-secondary);
    animation: expandTextAntos 8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* Cursor Blink */
.ai-logo-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: var(--accent-secondary);
    margin-left: 2px;
    animation: logoBlink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes expandTextAntonio {
    0%, 20% { max-width: 0; opacity: 0; }
    35%, 85% { max-width: 120px; opacity: 1; }
    100% { max-width: 0; opacity: 0; }
}

@keyframes expandTextObo {
    0%, 20% { max-width: 0; opacity: 0; }
    35%, 85% { max-width: 80px; opacity: 1; }
    100% { max-width: 0; opacity: 0; }
}

@keyframes expandTextAntos {
    0%, 20% { max-width: 0; opacity: 0; margin-right: 0px; }
    35%, 85% { max-width: 120px; opacity: 1; margin-right: 4px; }
    100% { max-width: 0; opacity: 0; margin-right: 0px; }
}

@keyframes fadeOutI {
    0%, 20% { opacity: 1; transform: translateY(0) scale(1); }
    35%, 85% { opacity: 0; transform: translateY(-5px) scale(0.9); } 
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInL {
    0%, 20% { opacity: 0; transform: translateY(5px) scale(0.9); }
    35%, 85% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(5px) scale(0.9); }
}

@keyframes logoBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Work in Progress Animation */
.wip-container {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 20px;
    margin-top: 0.5rem;
}

.wip-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent);
    animation: pulse-glow 1.5s infinite alternate;
}

@keyframes pulse-glow {
    0% { transform: scale(0.9); opacity: 0.5; box-shadow: 0 0 5px var(--accent); }
    100% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--accent); }
}

.wip-text {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
}

.wip-dots::after {
    content: '';
    animation: dots 2s infinite steps(4, end);
    width: 1.5em;
    display: inline-block;
    text-align: left;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(25, 25, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: var(--accent);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    z-index: 999;
}

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

.back-to-top:hover {
    background: var(--accent);
    color: var(--bg-deep);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-3px);
}

/* Hamburger Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1050;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav.open {
    opacity: 1;
    visibility: visible;
}

.mobile-nav ul {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-nav ul a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.mobile-nav ul a:hover,
.mobile-nav ul a.active {
    color: var(--accent);
}

/* Shared Profile and Skills Layout */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.tag {
    padding: 0.4rem 1rem;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

.about-skills {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3 i {
    color: var(--accent);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-list span {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.skill-list span:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Language List */
.language-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.language-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    transition: background 0.3s, transform 0.3s;
}

.language-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.language-flag {
    width: 2.2rem;
    height: 1.6rem;
    border-radius: 3px;
    flex-shrink: 0;
    font-size: 1.6rem;
    line-height: 1;
}

.language-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.language-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

.language-level {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 500;
    -webkit-text-fill-color: unset !important;
}

.level-native {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent) !important;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.level-advanced {
    background: rgba(112, 0, 255, 0.15);
    color: #b06fff !important;
    border: 1px solid rgba(112, 0, 255, 0.3);
}

.level-intermediate {
    background: rgba(0, 200, 150, 0.15);
    color: #00c896 !important;
    border: 1px solid rgba(0, 200, 150, 0.3);
}

.level-basic {
    background: rgba(255, 160, 0, 0.15);
    color: #ffa000 !important;
    border: 1px solid rgba(255, 160, 0, 0.3);
}

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

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent) 0%, transparent 100%);
    opacity: 0.5;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 30px;
    width: 20px;
    height: 20px;
    background: var(--bg-deep);
    border: 4px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 1;
    transition: transform 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.2);
}

.timeline-content {
    padding: 2rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.timeline-title h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.timeline-title h4 {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 500;
}

.institution-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
    border-bottom: 1px dotted rgba(0, 229, 255, 0.4);
}

.institution-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.timeline-logo {
    width: 55px;
    height: 55px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.timeline-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.timeline-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

.timeline-note {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.timeline-list li {
    margin-bottom: 0.65rem;
}

.timeline-list li:last-child {
    margin-bottom: 0;
}

.timeline-list--columns {
    columns: 2;
    column-gap: 2.25rem;
}

.timeline-list--columns li {
    break-inside: avoid;
}

/* Education Grid */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.edu-card {
    display: flex;
    flex-direction: column;
}

.edu-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.edu-logo {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 10px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edu-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.edu-title h3 {
    font-size: 1.1rem;
    line-height: 1.3;
}

.edu-title h4 {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin-top: 0.2rem;
}

.edu-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.edu-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.thesis {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    color: var(--text-primary) !important;
    margin-bottom: 0.8rem;
}

.thesis-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
    background: rgba(0, 229, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    width: fit-content;
}

.thesis-link:hover {
    background: var(--accent);
    color: var(--bg-deep);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--accent-glow);
}

.video-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-link i {
    color: #ff0000;
    /* YouTube red */
}

.video-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Certifications */
.cert-card {
    padding: 1.5rem;
}

.cert-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cert-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px;
}

.cert-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.cert-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.cert-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cert-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s;
}

.cert-link:hover {
    color: white;
}

/* Publications */
.publications-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.publications-grid.two-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pub-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.compact-card {
    padding: 1.5rem;
}

.compact-card .pub-title,
.compact-card .project-content h3 {
    font-size: 1.1rem;
}

.pub-date {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.pub-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.pub-authors {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.pub-journal {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.pub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: rgba(0, 229, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    width: fit-content;
}

.pub-link:hover {
    background: var(--accent);
    color: var(--bg-deep);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--accent-glow);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: gap 0.3s;
}

.project-link:hover {
    gap: 0.8rem;
    color: white;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-top: 1rem;
}

/* Skills */
.skills-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.skills-matrix .skill-category {
    min-height: 100%;
}

.skill-category--wide {
    grid-column: 1 / -1;
}

.language-panel {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) 2fr;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.5rem;
}

.language-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 1.2rem;
}

.language-panel-header h3 i {
    color: var(--accent);
}

.language-panel-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.language-panel .language-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.language-panel .language-item {
    min-height: 132px;
}

/* Footer */
footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.footer-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-social a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.footer-social a:hover {
    color: var(--accent);
    background: rgba(0, 229, 255, 0.1);
    transform: translateY(-3px);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

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

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

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

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

/* Responsive adjustments */
@media (max-width: 900px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 5rem;
        gap: 3rem;
    }

    .hero-image {
        width: 250px;
        height: 250px;
    }

    .hero-image-wrapper::before {
        width: 270px;
        height: 270px;
    }

    .social-links {
        justify-content: center;
    }

    .location {
        justify-content: center;
    }

    .hero-summary {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-keywords {
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }

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

@media (max-width: 1040px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 6rem 1.5rem 3rem;
    }

    .name {
        font-size: 3rem;
    }

    .role {
        font-size: 1.5rem;
    }

    .nav-content {
        position: relative;
    }

    .theme-toggle {
        position: absolute;
        left: calc(50% - 18px);
    }

    .timeline::before {
        left: 0;
    }

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

    .timeline-dot {
        left: -9px;
        width: 16px;
        height: 16px;
    }

    .timeline-header {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .timeline-logo {
        margin-bottom: 0.5rem;
    }

    .edu-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 42px;
        height: 42px;
    }

    .systems-grid,
    .projects-grid,
    .publications-grid.two-column-grid,
    .skills-matrix {
        grid-template-columns: 1fr;
    }

    .timeline-list--columns {
        columns: 1;
    }

    .language-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .language-panel .language-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .hero-keywords {
        gap: 0.45rem;
    }

    .hero-keywords span {
        font-size: 0.8rem;
        padding: 0.34rem 0.6rem;
    }

    .language-panel .language-list {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   VISUAL ENHANCEMENTS
   ========================================= */

/* Animated gradient border ring around hero image */
.hero-glow-ring {
    position: absolute;
    width: 330px;
    height: 330px;
    border-radius: 22px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(3deg);
    z-index: 0;
    animation: ring-spin 4s linear infinite;
    opacity: 0.85;
}

.hero-glow-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        #00E5FF,
        #7000FF,
        #00ffab,
        #00E5FF
    );
}

.hero-glow-ring::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 20px;
    background: var(--bg-deep);
}

/* 363deg = 3deg initial offset + 360deg full rotation → seamless loop */
@keyframes ring-spin {
    to { transform: translate(-50%, -50%) rotate(363deg); }
}

.hero-image {
    z-index: 1;
    position: relative;
}

/* Animated gradient shimmer on section titles */
.section-title span {
    background: linear-gradient(
        90deg,
        #00E5FF 0%,
        #7000FF 40%,
        #00ffab 60%,
        #00E5FF 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

/* Subtle dot-grid pattern overlay */
.bg-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

/* ---- Research Focus Section ---- */
.focus-section {
    min-height: auto;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

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

.focus-card {
    text-align: left;
    padding: 2.5rem 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}

.focus-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-text);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.focus-card:hover::before {
    opacity: 1;
}

.focus-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.3);
}

.focus-icon {
    width: 64px;
    height: 64px;
    margin: 0 0 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(112, 0, 255, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--accent);
    border: 1px solid rgba(0, 229, 255, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.focus-card:hover .focus-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25);
}

.focus-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.focus-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.profile-panel {
    margin-top: 2rem;
}

.profile-panel h3 {
    color: var(--text-primary);
    font-size: 1.45rem;
    margin-bottom: 1rem;
}

.profile-panel p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.profile-panel p:last-of-type {
    margin-bottom: 0;
}

/* ---- Selected Systems Section ---- */
.systems-section,
.skills-section {
    min-height: auto;
}

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

.system-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.system-label {
    width: fit-content;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    background: rgba(0, 229, 255, 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.system-card h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1.3;
}

.system-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.tech-list,
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
}

.tech-list span,
.project-tags span {
    padding: 0.28rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.2;
}

.note-pill {
    width: fit-content;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 200, 150, 0.12);
    border: 1px solid rgba(0, 200, 150, 0.25);
    color: #00c896;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Delay class for 4th focus card */
.delay-3 {
    transition-delay: 0.45s;
}

/* Delay class for 5th focus card */
.delay-4 {
    transition-delay: 0.6s;
}

.delay-5 {
    transition-delay: 0.75s;
}

/* Enhanced skill tags with subtle glow */
.tag {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
}

/* Responsive for focus section */
@media (max-width: 900px) {
    .hero-glow-ring {
        width: 280px;
        height: 280px;
    }

    .focus-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-glow-ring {
        width: 260px;
        height: 260px;
    }

    .focus-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    .focus-card {
        padding: 1.5rem 1rem;
    }

    .focus-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

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

/* =========================================
   THEME TOGGLE BUTTON
   ========================================= */

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(0, 229, 255, 0.08);
    transform: rotate(20deg);
}

/* =========================================
   LIGHT MODE THEME
   ========================================= */

[data-theme="light"] {
    --bg-deep: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #0a0a14;
    --text-secondary: #4a4a5a;
    --text-light: #4a4a5a;
    --accent: #0088bb;
    --accent-glow: rgba(0, 136, 187, 0.25);
    --accent-secondary: #5500bb;
    --gradient-text: linear-gradient(90deg, #0088bb, #5500bb, #0088bb);
}

[data-theme="light"] .bg-animated {
    background: radial-gradient(circle at center, #dce6f5 0%, #f0f4f8 100%);
}

[data-theme="light"] .bg-animated::after {
    background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}

[data-theme="light"] .blob-1 {
    background: radial-gradient(circle at center, rgba(85, 0, 187, 0.08) 0%, transparent 70%);
    opacity: 0.55;
}

[data-theme="light"] .blob-2 {
    background: radial-gradient(circle at center, rgba(0, 136, 187, 0.1) 0%, transparent 70%);
    opacity: 0.55;
}

[data-theme="light"] .blob-3 {
    background: radial-gradient(circle at center, rgba(0, 180, 130, 0.07) 0%, transparent 70%);
    opacity: 0.55;
}

[data-theme="light"] .navbar.scrolled {
    background-color: rgba(240, 244, 248, 0.92);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mobile-nav {
    background: rgba(240, 244, 248, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] footer {
    background: rgba(220, 230, 245, 0.6);
}

[data-theme="light"] .glass-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-btn {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .glass-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 5px 15px var(--accent-glow);
}

[data-theme="light"] .back-to-top {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 136, 187, 0.35);
}

[data-theme="light"] .hover-glow:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 0 25px rgba(0, 136, 187, 0.15);
    border-color: rgba(0, 136, 187, 0.4);
}

[data-theme="light"] .focus-card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1), 0 0 25px rgba(0, 136, 187, 0.12);
    border-color: rgba(0, 136, 187, 0.3);
}

[data-theme="light"] .skill-list span {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .hero-keywords span {
    background: rgba(0, 136, 187, 0.08);
    border-color: rgba(0, 136, 187, 0.18);
}

[data-theme="light"] .tech-list span,
[data-theme="light"] .project-tags span {
    background: rgba(0, 0, 0, 0.045);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .skill-list span:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .language-item {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .language-item:hover {
    background: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .video-link {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .video-link:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .cert-icon {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .footer-social a {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .footer-social a:hover {
    background: rgba(0, 136, 187, 0.1);
}

[data-theme="light"] .section-title span {
    background: linear-gradient(
        90deg,
        #0088bb 0%,
        #5500bb 40%,
        #009966 60%,
        #0088bb 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease-in-out infinite;
}

[data-theme="light"] .thesis-link:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 10px var(--accent-glow);
}

[data-theme="light"] .pub-link:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 10px var(--accent-glow);
}

[data-theme="light"] .cert-link:hover {
    color: var(--accent-secondary);
}

[data-theme="light"] .project-link:hover {
    color: var(--accent-secondary);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 136, 187, 0.08);
    border-color: var(--accent);
}

[data-theme="light"] .institution-link {
    border-bottom-color: rgba(0, 136, 187, 0.4);
}
/* Blog Specific Styles */
.blog-container {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent-secondary);
    transform: translateX(-5px);
}

.blog-content {
    line-height: 1.8;
}

.blog-content h1, .blog-content h2, .blog-content h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-content h1 { font-size: 2.5rem; }
.blog-content h2 { font-size: 2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 0.5rem; }
.blog-content h3 { font-size: 1.5rem; }

.blog-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.blog-content ul, .blog-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content a {
    color: var(--accent);
    text-decoration: none;
}

.blog-content a:hover {
    text-decoration: underline;
}

.blog-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-light);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.blog-content figure {
    margin: 1.5rem 0 2rem;
}

.blog-content figure img {
    display: block;
    margin: 0;
}

.blog-content figure.figure-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.blog-content figcaption {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
    font-style: italic;
}

.blog-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.blog-content pre {
    background: #1a1a2e;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.blog-content pre code {
    background: transparent;
    padding: 0;
}

.blog-content table {
    width: 100%;
    margin: 1.75rem 0 2.25rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    font-size: 0.94rem;
    line-height: 1.55;
    scroll-margin-top: 110px;
}

.blog-content thead {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
}

.blog-content th,
.blog-content td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.blog-content th {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.blog-content td {
    color: var(--text-secondary);
}

.blog-content th + th,
.blog-content td + td {
    border-left: 1px solid rgba(255, 255, 255, 0.055);
}

.blog-content tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.028);
}

.blog-content tbody tr:hover {
    background: rgba(0, 229, 255, 0.055);
}

.blog-content tbody tr:last-child td {
    border-bottom: 0;
}

.blog-content td:first-child {
    color: var(--text-primary);
    font-weight: 650;
}

.blog-content table code {
    white-space: nowrap;
}

.blog-content .mc-mini-table {
    box-shadow: none;
}

[data-theme="light"] .blog-content table {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .blog-content thead {
    background: linear-gradient(180deg, #f8fafc, #eef4fb);
}

[data-theme="light"] .blog-content th {
    background: linear-gradient(180deg, #f8fafc, #eef4fb);
    color: #0f172a;
}

[data-theme="light"] .blog-content td {
    color: #475569;
}

[data-theme="light"] .blog-content td:first-child {
    color: #111827;
}

[data-theme="light"] .blog-content th,
[data-theme="light"] .blog-content td {
    border-bottom-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .blog-content th + th,
[data-theme="light"] .blog-content td + td {
    border-left-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .blog-content tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.025);
}

[data-theme="light"] .blog-content tbody tr:hover {
    background: rgba(0, 136, 187, 0.075);
}

@media (max-width: 768px) {
    .blog-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    .blog-content th,
    .blog-content td {
        min-width: 9rem;
        padding: 0.75rem 0.85rem;
    }

}

@media (max-width: 640px) {
    .blog-content figure.figure-scroll {
        padding-bottom: 0.35rem;
    }

    .blog-content figure.figure-scroll img {
        min-width: 640px;
        max-width: none;
    }

    .blog-content table:not(.mc-mini-table) {
        display: block;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .blog-content table:not(.mc-mini-table) thead {
        display: none;
    }

    .blog-content table:not(.mc-mini-table) tbody,
    .blog-content table:not(.mc-mini-table) tr,
    .blog-content table:not(.mc-mini-table) td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .blog-content table:not(.mc-mini-table) tr {
        margin: 1rem 0;
        overflow: hidden;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.04);
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
    }

    .blog-content table:not(.mc-mini-table) td {
        display: block;
        padding: 0.85rem 0.95rem;
        border-left: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .blog-content table:not(.mc-mini-table) td:last-child {
        border-bottom: 0;
    }

    .blog-content table:not(.mc-mini-table) td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.35rem;
        color: var(--text-primary);
        font-size: 0.78rem;
        font-weight: 750;
        line-height: 1.35;
        text-transform: uppercase;
    }

    .blog-content table:not(.mc-mini-table) td:first-child {
        background: rgba(0, 229, 255, 0.055);
    }

    [data-theme="light"] .blog-content table:not(.mc-mini-table) tr {
        background: rgba(255, 255, 255, 0.96);
        border-color: rgba(15, 23, 42, 0.12);
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    }

    [data-theme="light"] .blog-content table:not(.mc-mini-table) td {
        border-bottom-color: rgba(15, 23, 42, 0.12);
    }

    [data-theme="light"] .blog-content table:not(.mc-mini-table) td:first-child {
        background: rgba(0, 136, 187, 0.06);
    }
}

/* Tabs and Widgets */
.widget-container {
    margin: 2rem 0;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1.5rem;
}

.tab-headers {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Accordion */
.blog-accordion {
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.blog-accordion summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none; /* remove default arrow in some browsers */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-accordion summary::-webkit-details-marker {
    display: none;
}

.blog-accordion summary::after {
    content: '+';
    color: var(--accent);
    font-size: 1.2rem;
    transition: var(--transition);
}

.blog-accordion[open] summary::after {
    content: '−';
}

.accordion-content {
    padding: 0 1rem 1rem 1rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Light mode overrides for Blog specific elements */
[data-theme="light"] .blog-content pre {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .blog-content code {
    background: rgba(0, 0, 0, 0.05);
    color: #e83e8c;
}

[data-theme="light"] .blog-content pre code {
    color: var(--text-primary);
    background: transparent;
}

[data-theme="light"] .widget-container {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .blog-accordion {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .blog-content blockquote {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .tab-headers {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .accordion-content {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .tab-btn {
    color: var(--text-secondary);
}

[data-theme="light"] .tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

[data-theme="light"] .widget-container {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0,0,0,0.02);
    border-radius: 12px;
}

[data-theme="light"] .blog-accordion {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fdfdfd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

[data-theme="light"] .blog-accordion summary {
    background: #f8fafc;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .blog-accordion summary:hover {
    background: #f0f4f8;
}

/* Fix navbar missing background */
.navbar.blog-nav, .navbar.scrolled {
    background-color: rgba(5, 5, 5, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid var(--border-color);
}
[data-theme="light"] .navbar.blog-nav, [data-theme="light"] .navbar.scrolled {
    background-color: rgba(240, 244, 248, 0.95) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
