@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #FAF6EE; /* Warm cream background */
    --bg-darker: #F3ECE0; /* Slightly darker cream for scrollbars and alternate panels */
    --bg-card: rgba(255, 255, 255, 0.75); /* Frosted white glass cards */
    --bg-card-hover: rgba(255, 255, 255, 0.92);
    --primary: #9E7A56; /* Rich warm metallic bronze */
    --primary-rgb: 158, 122, 86;
    --secondary: #BFA07A; /* Softer champagne gold */
    --secondary-rgb: 191, 160, 122;
    --accent: #8E7051; /* Warm dark bronze */
    --accent-rgb: 142, 112, 81;
    --rose: #C66258; /* Terracotta rose */
    --cyan: #A6876D; /* Muted clay */
    --text-main: #3C352E; /* Rich warm dark brown for maximum readability */
    --text-muted: #7E7267; /* Muted warm taupe */
    --border-color: rgba(158, 122, 86, 0.15); /* Soft bronze borders */
    --border-hover: rgba(158, 122, 86, 0.3);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Smooth transition for theme colors */
body, section, .glass-card, .bento-card, .timeline-card, .nav-brand, .nav-menu, .nav-link, .nav-control-btn, input, textarea, h1, h2, h3, h4, p, span, i {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

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

@font-face {
    font-family: 'Azer';
    src: url('assets/fonts/alfont_com_29ltazer.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(158, 122, 86, 0.3) var(--bg-dark);
    overflow-x: hidden;
    width: 100%;
}

html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

/* Preloader Styling */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-darker);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

#preloader.loaded {
    transform: translateY(-100%);
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1), visibility 0.8s step-end;
}

.preloader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.preloader-title {
    font-family: 'Azer', var(--font-title);
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 2px;
    animation: pulseTitle 2s ease-in-out infinite;
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: rgba(158, 122, 86, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.preloader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--cyan));
    position: absolute;
    top: 0;
    left: 0;
    animation: fillProgress 1.5s cubic-bezier(0.1, 0.8, 0.1, 1) forwards;
}

@keyframes fillProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes pulseTitle {
    0%, 100% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: rgba(158, 122, 86, 0.3);
    border-radius: 4px;
    border: 2px solid var(--bg-darker);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(158, 122, 86, 0.6);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(191, 160, 122, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(158, 122, 86, 0.06) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(197, 168, 128, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Page Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--cyan));
    z-index: 10000;
    transition: width 0.1s ease;
}

/* Dynamic Mesh Background Blobs & Live Wallpaper Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.bg-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(158, 122, 86, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(158, 122, 86, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center center;
    opacity: 0.8;
}

.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
    mix-blend-mode: multiply;
    animation: floatBlob 20s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: 10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(191, 160, 122, 0.45) 0%, rgba(158, 122, 86, 0.05) 80%);
    animation-duration: 25s;
}

.blob-2 {
    bottom: -10%;
    right: 5%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(158, 122, 86, 0.35) 0%, rgba(191, 160, 122, 0.05) 80%);
    animation-duration: 30s;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 60%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.4) 0%, rgba(59, 130, 246, 0.05) 80%);
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes floatBlob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(4vw, -6vh) scale(1.1);
    }
    66% {
        transform: translate(-3vw, 4vh) scale(0.95);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glass Card Helper Class */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(158, 122, 86, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(158, 122, 86, 0.05), transparent 40%);
    z-index: 1;
    pointer-events: none;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 15px 40px rgba(158, 122, 86, 0.12);
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 1.25rem 0;
}

#navbar.scrolled {
    padding: 0.75rem 0;
    background: rgba(250, 246, 238, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(158, 122, 86, 0.08);
}

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

.nav-brand {
    font-size: 1.6rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 12px;
    font-family: 'Azer', var(--font-title);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(158, 122, 86, 0.12);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    cursor: default;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(158, 122, 86, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: var(--font-title);
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    display: inline-flex;
    flex-direction: column;
    overflow: hidden;
    height: 2.2rem;
    line-height: 1.2rem;
}

.nav-link span {
    display: block;
    line-height: 1.2rem;
    transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}

.nav-link:hover span {
    transform: translateY(-100%);
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(158, 122, 86, 0.08);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 15px rgba(158, 122, 86, 0.25);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    margin-right: 1.5rem;
    z-index: 1001;
}

.nav-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(158, 122, 86, 0.08);
    border: 1px solid rgba(158, 122, 86, 0.15);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0;
}

#langToggle {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    font-size: 1.15rem;
}

.nav-control-btn:hover {
    color: var(--text-main);
    background: rgba(158, 122, 86, 0.18);
    border-color: rgba(158, 122, 86, 0.3);
    transform: scale(1.05);
}

.nav-control-btn i {
    transition: transform 0.5s ease;
}

.nav-control-btn:hover i {
    transform: rotate(30deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    padding-bottom: 50px;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-text {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    position: relative;
    display: block;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent);
    border-radius: 50%;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(3);
        opacity: 0;
    }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    font-family: var(--font-title);
    line-height: 1.1;
    color: var(--text-main);
}

.hero-title-line {
    display: block;
    overflow: hidden;
}

.hero-title-line > span {
    display: inline-block;
}

.hero-title-line .title-grad {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-main);
    font-weight: 500;
    font-family: var(--font-title);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    padding: 0.85rem 2.2rem;
    border: none;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-title);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(158, 122, 86, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(158, 122, 86, 0.45);
}

.hero-socials {
    display: flex;
    gap: 1rem;
}

.hero-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-social-link:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 15px rgba(158, 122, 86, 0.3);
}

/* Interactive Floating Graphics */
.hero-graphics {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 400px;
}

.tech-sphere {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(158, 122, 86, 0.15) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotateSphere 40s linear infinite;
}

.tech-center {
    width: 90px;
    height: 90px;
    background: var(--bg-darker);
    border: 2px solid var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px rgba(158, 122, 86, 0.3);
    animation: pulseCenter 4s ease-in-out infinite;
    z-index: 5;
}

.tech-center i {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tech-orbit-item {
    position: absolute;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 1.25rem;
    animation: counterRotate 40s linear infinite;
}

/* Position Orbit Items */
.orbit-1 { top: 0; left: 50%; transform: translate(-50%, -50%); }
.orbit-2 { top: 25%; right: 0; transform: translate(50%, -50%); }
.orbit-3 { bottom: 25%; right: 0; transform: translate(50%, 50%); }
.orbit-4 { bottom: 0; left: 50%; transform: translate(-50%, 50%); }
.orbit-5 { bottom: 25%; left: 0; transform: translate(-50%, 50%); }
.orbit-6 { top: 25%; left: 0; transform: translate(-50%, -50%); }

@keyframes rotateSphere {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes counterRotate {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes pulseCenter {
    0%, 100% { transform: scale(1); box-shadow: 0 0 35px rgba(158, 122, 86, 0.3); }
    50% { transform: scale(1.08); box-shadow: 0 0 50px rgba(158, 122, 86, 0.45); }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: color 0.3s ease;
    z-index: 10;
}

.scroll-indicator:hover {
    color: #ffffff;
}

/* Sections General */
section {
    padding: 7rem 0;
    position: relative;
    overflow-x: hidden;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    font-family: var(--font-title);
    margin-bottom: 1.25rem;
    display: inline-block;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    margin: 0 auto;
    border-radius: 2px;
}

.section-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 1.5rem auto 0;
}

/* About Bento Grid Section */
.about {
    background: transparent;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    grid-auto-rows: minmax(180px, auto);
}

.bento-card {
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.bento-bio {
    grid-column: span 7;
}

.bento-stack {
    grid-column: span 5;
    grid-row: span 2;
}

.bento-metrics-panel {
    grid-column: span 5;
}

.bento-learning {
    grid-column: span 7;
}

.bento-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(158, 122, 86, 0.05);
    border: 1px solid rgba(158, 122, 86, 0.12);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.bento-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-title);
    color: var(--text-main);
    margin-bottom: 1rem;
}

.bento-bio p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.bento-location {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.25rem;
    margin-top: auto;
}

.bento-location i {
    color: var(--rose);
}

.local-time {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--cyan);
}

/* Stack Matrix Inside Bento */
.stack-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stack-category h4 {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-family: var(--font-title);
    letter-spacing: 0.5px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(158, 122, 86, 0.05);
    border: 1px solid rgba(158, 122, 86, 0.1);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.tech-tag:hover {
    color: var(--text-main);
    background: rgba(158, 122, 86, 0.15);
    border-color: rgba(158, 122, 86, 0.3);
    transform: translateY(-2px);
}

/* Bento Metrics */
.bento-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.bento-metric {
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.bento-metric:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-3px);
}

.bento-metric .num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--cyan); /* Solid bright cyan that never breaks */
    font-family: var(--font-title);
}

.bento-metric .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Learning Card */
.bento-learning p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.learning-indicators {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.indicator-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--cyan);
}

/* CV Preview Section */
.cv-preview {
    padding: 4rem 0;
}

.cv-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
}

.cv-thumb {
    width: 130px;
    height: auto;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.cv-info {
    flex: 1;
}

.cv-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-title);
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.cv-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.cv-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(158, 122, 86, 0.06);
    border: 1px solid rgba(158, 122, 86, 0.15);
    color: var(--primary);
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-title);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(158, 122, 86, 0.12);
    border-color: rgba(158, 122, 86, 0.3);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Projects Section & Filter Tabs */
.projects {
    background: transparent;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-family: var(--font-title);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(158, 122, 86, 0.35);
}

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

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease, box-shadow 0.3s ease;
}

.project-card.hide {
    opacity: 0;
    transform: scale(0.9);
    position: absolute;
    pointer-events: none;
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 220px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 19, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.project-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.project-action-btn:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 8px 20px rgba(158, 122, 86, 0.4);
}

.project-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    z-index: 2;
}

.project-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-title);
    color: var(--text-main);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.project-content h3 p {
    display: inline;
}

.project-card:hover .project-content h3 {
    color: var(--cyan);
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-tech .tech-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
}

/* Career Timeline */
.career {
    background: transparent;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--secondary), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 3.5rem;
}

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

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 1.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--secondary);
    box-shadow: 0 0 12px rgba(158, 122, 86, 0.6);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    background: var(--cyan);
    border-color: #ffffff;
    box-shadow: 0 0 18px var(--cyan);
    transform: scale(1.2);
}

.timeline-card {
    padding: 2rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.timeline-card:hover {
    transform: translateX(5px);
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-period {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan);
    font-family: var(--font-title);
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.timeline-location {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.timeline-location:hover {
    color: var(--primary);
}

.timeline-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-title);
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.timeline-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    background: rgba(158, 122, 86, 0.05);
    border: 1px solid rgba(158, 122, 86, 0.1);
    color: var(--text-muted);
    border-radius: 6px;
}

/* Contact Section */
.contact {
    background: transparent;
}

.contact-content {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-title);
    color: var(--text-main);
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.contact-item i {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 12px;
    background: rgba(158, 122, 86, 0.08);
    border: 1px solid rgba(158, 122, 86, 0.2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.contact-item-info h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.contact-item-info a,
.contact-item-info p {
    font-size: 1.05rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-item-info a:hover {
    color: var(--cyan);
}

.contact-social {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.contact-social h4 {
    font-size: 0.95rem;
    color: var(--text-main);
    font-family: var(--font-title);
    margin-bottom: 1rem;
}

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

.contact-social .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    background: rgba(158, 122, 86, 0.05);
    border: 1px solid rgba(158, 122, 86, 0.1);
    color: var(--text-muted);
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.15rem;
    transition: all 0.3s ease;
}

.contact-social .social-link:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    transform: translateY(-3px);
}

.contact-form {
    padding: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(158, 122, 86, 0.1);
}

.contact-form textarea {
    resize: none;
    margin-bottom: 1.5rem;
}

.contact-form button[type="submit"] {
    width: 100%;
    justify-content: center;
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    background: var(--bg-darker);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 11000;
}

.modal[aria-hidden="false"] {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 5, 10, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: min(960px, 94vw);
    height: min(720px, 88vh);
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(158, 122, 86, 0.2);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-title);
    color: var(--text-main);
}

.close-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
}

.modal-body {
    flex: 1;
    position: relative;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    padding: 1rem 1.75rem;
    border-radius: 12px;
    z-index: 10000;
    transform: translateX(120%);
    opacity: 0;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: var(--font-title);
    font-weight: 500;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* n8n Chatbot Adjustments */
#n8n-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.n8n-chat .chat-widget {
    border: 1px solid var(--border-color) !important;
    background: rgba(250, 246, 238, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(158, 122, 86, 0.15) !important;
}

.n8n-chat .chat-trigger {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    box-shadow: 0 4px 20px rgba(158, 122, 86, 0.35) !important;
}

/* Fallback Chat Widget Styles */
.chat-widget-fallback {
    position: relative;
}

.chat-trigger-fallback {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(158, 122, 86, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-trigger-fallback:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(158, 122, 86, 0.4);
}

.chat-message-fallback {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 320px;
    height: auto;
    background: rgba(250, 246, 238, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 15px 35px rgba(158, 122, 86, 0.08);
    color: var(--text-main);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.message-content h4 {
    color: var(--cyan);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-family: var(--font-title);
}

.message-content p {
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.contact-link {
    display: block;
    color: var(--text-main);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--cyan);
}

.contact-link i {
    margin-right: 0.5rem;
    color: var(--secondary);
}

/* Animations */
.loading {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.loading.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

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

    .status-badge {
        align-self: center;
    }

    .hero-description {
        margin: 0 auto;
    }

    .hero-graphics {
        height: 320px;
    }

    .tech-sphere {
        width: 250px;
        height: 250px;
    }

    .tech-center {
        width: 75px;
        height: 75px;
    }

    .tech-orbit-item {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

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

    .bento-bio, .bento-stack, .bento-metrics-panel, .bento-learning {
        grid-column: span 2;
    }

    .bento-stack {
        grid-row: auto;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: 5rem 0;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: rgba(7, 9, 19, 0.95);
        width: calc(100% - 4rem);
        margin: 0 2rem;
        text-align: center;
        transition: left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
        padding: 1.5rem;
        gap: 1rem;
        border-radius: 16px;
        border: 1px solid var(--border-color);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }

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

    .hamburger {
        display: flex;
    }

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

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

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

    .hero-graphics {
        height: 220px;
    }

    .tech-sphere {
        width: 180px;
        height: 180px;
    }

    .tech-center {
        width: 60px;
        height: 60px;
    }

    .tech-center i {
        font-size: 1.5rem;
    }

    .tech-orbit-item {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

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

    .timeline-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .timeline-location {
        font-size: 0.85rem;
    }

    .timeline-card {
        padding: 1.25rem;
    }

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

    .bento-bio, .bento-stack, .bento-metrics-panel, .bento-learning {
        grid-column: span 1;
    }

    .bento-card {
        padding: 1.75rem;
    }
}

/* Screen size under 480px tweaks */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    .bento-card {
        padding: 1.25rem;
    }
    
    .contact-form {
        padding: 1.25rem;
    }
    
    .cv-card {
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .tech-sphere {
        width: 140px;
        height: 140px;
    }
    
    .tech-center {
        width: 48px;
        height: 48px;
    }
    
    .tech-center i {
        font-size: 1.2rem;
    }
    
    .tech-orbit-item {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
    
    .hero-graphics {
        height: 180px;
    }
    
    .bento-metrics-grid {
        gap: 0.5rem;
    }
    
    .bento-metric {
        padding: 0.75rem 0.25rem;
    }
    
    .bento-metric .num {
        font-size: 1.4rem;
    }

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

    .timeline-card {
        padding: 1rem;
    }
}



/* Arabic RTL Styles Support */
html[dir="rtl"] body {
    text-align: right;
}

html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] .btn-primary,
html[dir="rtl"] .btn-secondary,
html[dir="rtl"] .filter-btn,
html[dir="rtl"] .nav-link,
html[dir="rtl"] .nav-brand {
    font-family: 'Azer', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html[dir="rtl"] .hero-title, 
html[dir="rtl"] .hero-subtitle, 
html[dir="rtl"] .section-title, 
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
    font-family: 'Azer', var(--font-title);
}

html[dir="rtl"] .hero-title {
    letter-spacing: 0.05em;
}

html[dir="rtl"] .status-badge {
    align-self: flex-end;
}
@media (max-width: 1024px) {
    html[dir="rtl"] .status-badge {
        align-self: center;
    }
}

html[dir="rtl"] .hero-text {
    text-align: right;
}
@media (max-width: 1024px) {
    html[dir="rtl"] .hero-text {
        text-align: center;
    }
}

html[dir="rtl"] .btn-primary i {
    transform: scaleX(-1);
}

/* RTL Timeline Overrides */
html[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 2rem;
}

html[dir="rtl"] .timeline::before {
    left: auto;
    right: 7px;
}

html[dir="rtl"] .timeline-dot {
    left: auto;
    right: -32px;
}

html[dir="rtl"] .timeline-card:hover {
    transform: translateX(-5px);
}

/* Local Time Align */
html[dir="rtl"] .local-time {
    margin-left: 0;
    margin-right: auto;
}

/* Modal header reverse alignment */
html[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white !important;
    border-radius: 50%;
    font-size: 32px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
    z-index: 9999;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.55);
    color: white !important;
}

.whatsapp-float i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    line-height: 1;
    margin: 0;
    padding: 0;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* WhatsApp Tooltip */
.whatsapp-tooltip {
    visibility: hidden;
    width: 150px;
    background-color: rgba(9, 13, 22, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 6px 12px;
    position: absolute;
    z-index: 10000;
    right: 75px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateX(10px);
}

/* Tooltip Arrow */
.whatsapp-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(9, 13, 22, 0.95);
}

.whatsapp-float:hover .whatsapp-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}

/* Maintain bottom-right placement on RTL */
html[dir="rtl"] .whatsapp-float {
    left: auto;
    right: 24px;
}

/* Tooltip placement adjustments for RTL */
html[dir="rtl"] .whatsapp-tooltip {
    left: auto;
    right: 75px;
    transform: translateX(10px);
}

html[dir="rtl"] .whatsapp-float:hover .whatsapp-tooltip {
    transform: translateX(0);
}

/* Responsive styles */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 86px;
        right: 24px;
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
}

/* Publications Section */
.publications {
    padding: 8rem 0;
    position: relative;
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2.5rem;
    margin-top: 3.5rem;
}

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

.publication-card {
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.publication-card .pub-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-bottom-left-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

html[dir="rtl"] .publication-card .pub-badge {
    right: auto;
    left: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 12px;
}

.pub-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1.25rem;
}

.pub-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.pub-journal {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pub-award {
    color: var(--rose);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.pub-title {
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.pub-abstract {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: justify;
}

html[dir="rtl"] .pub-abstract {
    text-align: right;
}

.pub-links {
    margin-top: auto;
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
}

.pub-link-btn {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.pub-link-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--border-color);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 172px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(158, 122, 86, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.scroll-to-top:hover {
    background: var(--primary);
    color: #FAF6EE;
    box-shadow: 0 8px 25px rgba(158, 122, 86, 0.3);
    transform: translateY(-5px);
}

/* Maintain bottom-right placement on RTL */
html[dir="rtl"] .scroll-to-top {
    left: auto;
    right: 24px;
}

@media (max-width: 768px) {
    .publications {
        padding: 5rem 0;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .publication-card {
        padding: 1.75rem;
    }
    
    .pub-title {
        font-size: 1.2rem;
    }
    
    .scroll-to-top {
        bottom: 148px;
        right: 24px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

/* --- 3D Card Flip and Certificate Styles --- */
.publication-card-wrapper {
    perspective: 1500px;
    position: relative;
    width: 100%;
}

.publication-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.publication-card-wrapper.flipped .publication-card-inner {
    transform: rotateY(180deg);
}

/* RTL layout flip mirroring */
html[dir="rtl"] .publication-card-wrapper.flipped .publication-card-inner {
    transform: rotateY(-180deg);
}

.publication-card-front {
    position: relative;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.publication-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    margin: 0;
    transform: rotateY(180deg);
    z-index: 2;
}

html[dir="rtl"] .publication-card-back {
    transform: rotateY(-180deg);
}

/* Certificate Layout with PDF Iframe */
.cert-card-layout {
    background: #FAF6EE !important; /* Cream background matching the theme */
    border: 1px solid var(--border-color) !important;
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
}

.cert-back-header {
    width: 100%;
    flex-shrink: 0;
}

.cert-iframe-container {
    width: 100%;
    flex-grow: 1;
    height: 380px; /* Default height */
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(158, 122, 86, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.cert-iframe-container iframe,
.cert-iframe-container .cert-img {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

@media (max-width: 768px) {
    .cert-card-layout {
        padding: 1rem !important;
        gap: 0.75rem;
    }
    
    .cert-iframe-container {
        height: 320px;
    }
}

/* --- Awards Section Timeline --- */
.awards {
    padding: 8rem 0;
    position: relative;
    background: var(--bg-dark);
}

.awards-timeline {
    position: relative;
    max-width: 900px;
    margin: 4rem auto 0;
    padding-left: 0;
}

.awards-timeline::before {
    content: '';
    position: absolute;
    left: 120px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--secondary), transparent);
}

.awards-item {
    position: relative;
    margin-bottom: 4rem;
    min-height: 120px;
    display: flex;
}

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

.awards-year {
    position: absolute;
    left: 20px;
    width: 80px;
    text-align: right;
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--primary);
    line-height: 2.2rem;
    letter-spacing: 0.5px;
    top: 1.8rem; /* Aligned with card content top */
}

.awards-dot {
    position: absolute;
    left: 109px;
    top: 2.1rem; /* Aligned with card content top */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FAF6EE;
    border: 3px solid var(--primary);
    box-shadow: 0 0 10px rgba(158, 122, 86, 0.4);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.awards-dot i {
    font-size: 0.7rem;
}

.awards-dot .text-gold {
    color: #D4AF37;
}

.awards-dot .text-silver {
    color: #A0A0A0;
}

.awards-dot .text-bronze {
    color: #CD7F32;
}

.awards-item:hover .awards-dot {
    transform: scale(1.25);
    background: var(--primary);
    box-shadow: 0 0 15px rgba(158, 122, 86, 0.7);
}

.awards-item:hover .awards-dot i {
    color: #FFFFFF !important;
}

.awards-card {
    margin-left: 160px;
    width: calc(100% - 160px);
    padding: 2rem;
    border-radius: 16px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.awards-card:not(.awards-card-front):not(.awards-card-back):hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(158, 122, 86, 0.12);
}

.awards-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    background: rgba(158, 122, 86, 0.08);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(158, 122, 86, 0.12);
    margin-bottom: 0.75rem; /* Spacing below badge */
}

.awards-title {
    font-family: var(--font-title);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.awards-issuer {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.awards-issuer i {
    font-size: 0.95rem;
}

.awards-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: justify;
}

/* Card Flip for Awards */
.awards-card-wrapper {
    position: relative;
    margin-left: 160px;
    width: calc(100% - 160px);
    perspective: 1500px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 320px; /* Ensure space for back face content */
}

.awards-card-wrapper:hover:not(.flipped) {
    transform: translateY(-5px);
}

/* Reset margin and width for cards inside the wrapper to prevent double shifting and squishing */
.awards-card-wrapper .awards-card {
    margin: 0 !important;
    width: 100% !important;
}

.awards-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.awards-card-wrapper.flipped .awards-card-inner {
    transform: rotateY(180deg);
}

html[dir="rtl"] .awards-card-wrapper.flipped .awards-card-inner {
    transform: rotateY(-180deg);
}

.awards-card-front {
    position: relative;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

.awards-card-front .pub-links {
    margin-top: auto !important;
}

.awards-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    margin: 0 !important;
    transform: rotateY(180deg);
    z-index: 2;
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #FAF6EE !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
}

html[dir="rtl"] .awards-card-back {
    transform: rotateY(-180deg);
}

.award-img-container {
    width: 100%;
    flex-grow: 1;
    height: 180px; /* Reduced from 280px to fit without overflowing card borders */
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: rgba(158, 122, 86, 0.03);
}

.award-project-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.award-img-container:hover .award-project-img {
    transform: scale(1.03);
}

/* RTL layout mirrors */
html[dir="rtl"] .awards-timeline::before {
    left: auto;
    right: 120px;
}

html[dir="rtl"] .awards-year {
    left: auto;
    right: 20px;
    text-align: left;
}

html[dir="rtl"] .awards-dot {
    left: auto;
    right: 109px;
}

html[dir="rtl"] .awards-card {
    margin-left: 0;
    margin-right: 160px;
    width: calc(100% - 160px);
}

html[dir="rtl"] .awards-card-wrapper {
    margin-left: 0;
    margin-right: 160px;
    width: calc(100% - 160px);
}

html[dir="rtl"] .awards-desc {
    text-align: right;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .awards {
        padding: 5rem 0;
    }
    
    .awards-timeline::before {
        left: 16px;
    }
    
    html[dir="rtl"] .awards-timeline::before {
        right: 16px;
        left: auto;
    }
    
    .awards-year {
        position: static;
        width: auto;
        text-align: left;
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        display: inline-block;
        background: var(--primary);
        color: #FAF6EE;
        padding: 0.15rem 0.6rem;
        border-radius: 4px;
        line-height: 1.2;
    }
    
    html[dir="rtl"] .awards-year {
        text-align: right;
    }
    
    .awards-dot {
        left: 5px;
        top: 2rem; /* Align with timeline card top */
    }
    
    html[dir="rtl"] .awards-dot {
        right: 5px;
        left: auto;
    }
    
    .awards-card, .awards-card-wrapper {
        margin-left: 40px;
        width: calc(100% - 40px);
    }
    
    html[dir="rtl"] .awards-card, html[dir="rtl"] .awards-card-wrapper {
        margin-right: 40px;
        margin-left: 0;
        width: calc(100% - 40px);
    }

    .awards-card {
        padding: 1.5rem;
    }

    .awards-card-wrapper {
        min-height: 290px;
    }

    .award-img-container {
        height: 140px;
    }

    @media (max-width: 480px) {
        .awards-card-back {
            padding: 1rem !important;
            gap: 0.75rem;
        }
        .awards-card-back .cert-close-btn {
            font-size: 0.8rem;
            padding: 0.4rem 0.8rem;
        }
        .award-img-container {
            height: 130px;
        }
    }
    
    .awards-badge {
        position: static;
        display: inline-block;
        margin-bottom: 0.75rem;
    }
    
    .awards-title {
        font-size: 1.15rem;
        padding-right: 0;
        padding-left: 0;
    }
    
    .awards-item {
        flex-direction: column;
        margin-bottom: 2.5rem;
    }
}

/* --- Premium Custom Cursor --- */
@media (pointer: fine) {
    body {
        cursor: none;
    }
    a, button, select, input, textarea, [role="button"], .pub-link-btn, .project-card, .bento-card, .filter-btn, .lang-btn, .hamburger, .cert-close-btn, .scrollToTop {
        cursor: none !important;
    }
}

.custom-cursor-dot,
.custom-cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, border-color 0.3s ease;
}

.custom-cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
}

.custom-cursor-outline {
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--primary);
    /* JS translation handles positioning, CSS transitions handle hover state changes */
}

/* Active state (when mouse moves inside screen) */
.custom-cursor-active .custom-cursor-dot,
.custom-cursor-active .custom-cursor-outline {
    opacity: 1;
}

/* Hover State over interactive elements */
body.cursor-hovering .custom-cursor-dot {
    transform: translate(-50%, -50%) scale(0.5);
    background-color: var(--secondary);
}

body.cursor-hovering .custom-cursor-outline {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--secondary);
    background-color: rgba(158, 122, 86, 0.08);
}

/* Hide on mobile / touch screen */
@media (pointer: coarse) {
    body {
        cursor: auto !important;
    }
    .custom-cursor-dot,
    .custom-cursor-outline {
        display: none !important;
    }
}

