@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');

/* --- CSS Variables & Theme Configuration --- */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Theme-independent values */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --max-width: 1200px;
    --header-height: 72px;

    /* Default Dark Theme Colors (Black, Red, Purple) */
    --bg-color: #050508;
    --bg-surface: #0f0f15;
    --bg-surface-elevated: #1a1525;
    --primary: #ef233c; /* Vibrant Red */
    --primary-rgb: 239, 35, 60;
    --secondary: #9d4edd; /* Electric Purple */
    --secondary-rgb: 157, 78, 221;
    --text-primary: #f8f9fa;
    --text-muted: #a5a5b5;
    --border-color: #1c1826;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 10px 10px -5px rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(15, 15, 21, 0.75);
    --glass-border: rgba(239, 35, 60, 0.08);
}

/* Light Theme Overrides (White, Red, Purple) */
[data-theme="light"] {
    --bg-color: #fafafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f3f0f7;
    --primary: #d90429; /* Deep Red */
    --primary-rgb: 217, 4, 41;
    --secondary: #7b2cbf; /* Darker Purple */
    --secondary-rgb: 123, 44, 191;
    --text-primary: #121015;
    --text-muted: #575560;
    --border-color: #e2dff0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(123, 44, 191, 0.1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- Layout Utility Classes --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
    position: relative;
    z-index: 2;
    width: 100%;
}

section {
    padding: clamp(4rem, 8vw, 8rem) 0 clamp(2rem, 4vw, 4rem) 0;
    position: relative;
}

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

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

ul {
    list-style: none;
}

button, input, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.section-title {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
}

.section-title span {
    background: linear-gradient(135deg, var(--primary), #b3001e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: var(--text-muted);
    text-align: center;
    max-width: 600px;
    margin: 0 auto clamp(2rem, 5vw, 4rem) auto;
    padding: 0 0.5rem;
}

/* --- Animations & Effects --- */
/* Ambient Blobs in Background */
.ambient-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    mix-blend-mode: screen;
    animation: floatBlob 20s infinite ease-in-out alternate;
}

[data-theme="light"] .blob {
    opacity: 0.08;
    mix-blend-mode: multiply;
}

.blob-1 {
    top: 10%;
    left: 10%;
    width: 450px;
    height: 450px;
    background-color: var(--primary);
}

.blob-2 {
    bottom: 10%;
    right: 10%;
    width: 500px;
    height: 500px;
    background-color: var(--secondary);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 50%;
    width: 300px;
    height: 300px;
    background-color: var(--secondary);
    animation-delay: -10s;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 100px) scale(1.1);
    }
    100% {
        transform: translate(-30px, -50px) scale(0.9);
    }
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

/* Delay modifiers */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* Custom Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem clamp(1.2rem, 3vw, 1.8rem);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: clamp(0.85rem, 2vw, 1rem);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #b3001e);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.5);
    background: #ff3b53;
}

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

.btn-secondary:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--text-muted);
}

.btn-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Glass Card Styles */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primary-rgb), 0.2);
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="light"] header {
    background: rgba(248, 250, 252, 0.8);
}

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

.logo {
    font-size: clamp(1.15rem, 3.5vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -1px;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--primary), #b3001e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-fast);
}

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

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

/* Utility buttons in nav (Theme, Menu Toggle) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--primary);
    transform: rotate(15deg);
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: inline-block;
}

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

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Mobile responsive menu */
@media (max-width: 992px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: 0;
        transform: translateX(100%);
        width: 70%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-surface);
        flex-direction: column;
        justify-content: flex-start;
        padding: 3rem 2rem;
        gap: 2.5rem;
        box-shadow: -10px 0 20px rgba(0, 0, 0, 0.2);
        transition: transform var(--transition-normal);
        z-index: 999;
    }

    .nav-menu.open {
        transform: translateX(0);
    }
}

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

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-welcome {
    font-size: clamp(0.75rem, 2vw, 1rem);
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(1.8rem, 6vw, 4rem);
    line-height: 1.1;
    margin-bottom: clamp(0.75rem, 2vw, 1.5rem);
    font-weight: 800;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), #b3001e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.8rem);
    font-weight: 500;
    margin-bottom: clamp(0.75rem, 2vw, 1.5rem);
    min-height: clamp(2rem, 4vw, 2.5rem);
}

.hero-description {
    font-size: clamp(0.85rem, 2.2vw, 1.1rem);
    color: var(--text-muted);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    max-width: 600px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: clamp(1.5rem, 3vw, 3rem);
    flex-wrap: wrap;
}

.hero-socials {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-socials-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animated interactive geometric canvas wrapper or SVG */
.hero-canvas-wrap {
    width: clamp(200px, 45vw, 380px);
    height: clamp(200px, 45vw, 380px);
    position: relative;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    max-width: 90vw;
}

.tech-orbits {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotate 60s linear infinite;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px dashed var(--border-color);
    border-radius: 50%;
}

.orbit-1 { width: 80%; height: 80%; }
.orbit-2 { width: 58%; height: 58%; }
.orbit-3 { width: 37%; height: 37%; }

.tech-node {
    position: absolute;
    width: clamp(8px, 1.5vw, 12px);
    height: clamp(8px, 1.5vw, 12px);
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.node-1 { top: 0; left: 50%; transform: translate(-50%, -50%); background-color: var(--primary); }
.node-2 { bottom: 20%; left: 10%; background-color: var(--secondary); }
.node-3 { top: 30%; right: 5%; background-color: var(--secondary); }

.hero-avatar {
    z-index: 5;
    position: relative;
    width: clamp(120px, 30vw, 250px);
    height: clamp(120px, 30vw, 250px);
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--bg-surface);
    box-shadow: var(--shadow-lg);
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

@media (max-width: 992px) {
    .hero {
        height: auto;
        min-height: 0;
        padding-top: calc(var(--header-height) + 2rem);
        padding-bottom: 2.5rem;
        display: block;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    .hero-content {
        align-items: center;
    }
    .hero-cta {
        justify-content: center;
    }
    .hero-visual {
        order: -1;
    }
    .hero-socials {
        justify-content: center;
    }
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
}

.about-info h3 {
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    margin-bottom: 1rem;
}

.about-info p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: clamp(0.88rem, 2vw, 1rem);
    word-break: break-word;
    overflow-wrap: break-word;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.5rem, 1.5vw, 1.5rem);
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.stat-card {
    text-align: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
}

.stat-number {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-heading);
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, var(--primary), #b3001e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: clamp(0.65rem, 1.8vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.about-visual {
    position: relative;
    padding: 0;
}

.visual-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: clamp(1.25rem, 3vw, 2.5rem);
    position: relative;
    overflow: hidden;
}

.visual-box::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.features-list {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.feature-item i {
    color: var(--secondary);
    font-size: 1rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.feature-title {
    font-weight: 600;
    font-size: clamp(0.82rem, 2vw, 0.95rem);
    margin-bottom: 0.2rem;
}

.feature-desc {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .features-list {
        grid-template-columns: 1fr;
    }
}

/* --- Timeline Section (Education & Experience) --- */
.timeline-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.tab-btn {
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

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

.timeline-content.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

/* Timeline Vertical Line */
.timeline-content::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}

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

/* Timeline dot */
.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid var(--primary);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    z-index: 5;
}

.timeline-item:hover .timeline-dot {
    background: var(--secondary);
    border-color: var(--secondary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

.timeline-role {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 700;
}

.timeline-org {
    color: var(--primary);
    font-weight: 500;
    font-size: 1rem;
}

.timeline-date {
    background: var(--bg-surface-elevated);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.timeline-desc {
    color: var(--text-muted);
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    word-break: break-word;
    overflow-wrap: break-word;
}

.timeline-desc ul {
    margin-top: 0.5rem;
    padding-left: 1.2rem;
    list-style-type: disc;
}

.timeline-desc li {
    margin-bottom: 0.4rem;
}

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

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.skill-category {
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.skill-category h3 {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

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

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-item {
    width: 100%;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.skill-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-surface-elevated);
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.skills-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.skill-tag {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* --- Projects Section --- */
.projects-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
    color: var(--text-primary);
    border-color: var(--primary);
}

.filter-btn.active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

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

.project-img-container {
    height: 200px;
    position: relative;
    overflow: hidden;
    background: var(--bg-surface-elevated);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

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

.project-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
}

.project-badge {
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.project-info {
    padding: clamp(1.2rem, 3vw, 1.8rem);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    margin-bottom: 0.6rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    margin-bottom: 1.2rem;
    flex-grow: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.project-links {
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.project-link:hover {
    color: var(--primary);
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: flex-start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2.5vw, 2.5rem);
}

.contact-card {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    padding: clamp(1rem, 2vw, 1.5rem);
}

.contact-icon {
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    min-width: 40px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-details h4 {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    margin-bottom: 0.2rem;
}

.contact-details p {
    color: var(--text-muted);
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    word-break: break-word;
    overflow-wrap: break-word;
}

.contact-details a {
    word-break: break-all;
}

.contact-form-wrap {
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
    width: 100%;
}

.form-input {
    width: 100%;
    padding: 1rem 0.5rem 0.5rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: border-color var(--transition-fast);
}

.form-label {
    position: absolute;
    left: 0.5rem;
    top: 0.8rem;
    color: var(--text-muted);
    pointer-events: none;
    font-size: clamp(0.85rem, 2vw, 1rem);
    transition: transform var(--transition-fast), color var(--transition-fast), font-size var(--transition-fast);
}

/* Float Label Animation */
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    transform: translateY(-1.5rem);
    font-size: 0.75rem;
    color: var(--primary);
}

.form-input:focus {
    border-color: var(--primary);
}

textarea.form-input {
    resize: none;
    height: 120px;
}

.form-error {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.3rem;
    display: none;
}

.form-group.error .form-input {
    border-color: #ef4444;
}

.form-group.error .form-error {
    display: block;
}

.submit-loader {
    display: none;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #ffffff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-success-msg {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 0;
    gap: 1rem;
    animation: fadeIn var(--transition-normal);
}

.form-success-msg i {
    font-size: 2.5rem;
    color: var(--secondary);
}

@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* --- Footer --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: clamp(1.5rem, 4vw, 3rem) 0;
    background: var(--bg-color);
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--primary), #b3001e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-copy {
    color: var(--text-muted);
    font-size: clamp(0.75rem, 2vw, 0.9rem);
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Scroll to top button */
.scroll-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablets & Small Laptops (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    section {
        padding: 3.5rem 0 2rem 0;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }
    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.82rem;
    }

    .projects-filter {
        gap: 0.5rem;
    }
}

/* Small Phones (max-width: 576px) */
@media (max-width: 576px) {
    footer .container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-socials {
        justify-content: center;
    }

    .hero-socials-label {
        display: none;
    }

    .contact-card {
        flex-direction: row;
    }

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

/* Extra Small Phones (max-width: 400px) - Galaxy Fold, iPhone SE etc */
@media (max-width: 400px) {
    .hero-canvas-wrap {
        width: 200px !important;
        height: 200px !important;
    }
    .hero-avatar {
        width: 120px !important;
        height: 120px !important;
    }

    .btn-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .stat-card {
        padding: 0.6rem 0.3rem;
    }

    .project-img-container {
        height: 160px;
    }

    .contact-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
}
