/*
 * Aman Malik Personal Portfolio CMS
 * Premium Neon & Glassmorphism Design System Stylesheet
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

/* Base Reset & Variables */
:root {
    /* Color variables (Accents populated dynamically in head) */
    --primary: var(--theme-primary, #00f0ff);
    --secondary: var(--theme-secondary, #a855f7);
    --primary-rgb: var(--theme-primary-rgb, 0, 240, 255);
    --secondary-rgb: var(--theme-secondary-rgb, 168, 85, 247);
    
    /* Font stacks */
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-accent: 'Poppins', sans-serif;

    /* Transition defaults */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light / Dark Theme Colors */
[data-theme="dark"] {
    --bg-base: #09090b;
    --bg-base-rgb: 9, 9, 11;
    --bg-surface: #121215;
    --card-bg: rgba(18, 18, 22, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f4f4f5;
    --text-sub: #a1a1aa;
    --text-muted: #52525b;
    --shadow-color: rgba(0, 0, 0, 0.6);
    --neon-glow: rgba(var(--primary-rgb), 0.25);
    --accent-glow: rgba(var(--secondary-rgb), 0.2);
}

[data-theme="light"] {
    --bg-base: #f4f5f6;
    --bg-base-rgb: 244, 245, 246;
    --bg-surface: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(9, 9, 11, 0.08);
    --text-main: #09090b;
    --text-sub: #52525b;
    --text-muted: #a1a1aa;
    --shadow-color: rgba(9, 9, 11, 0.05);
    --neon-glow: rgba(var(--primary-rgb), 0.12);
    --accent-glow: rgba(var(--secondary-rgb), 0.1);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    transition: background-color 0.5s ease, color 0.5s ease;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Typography Rules */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

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

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

/* Page Loader Animation */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255,255,255,0.03);
    border-radius: 50%;
    border-top-color: var(--primary);
    border-bottom-color: var(--secondary);
    animation: spin 1s cubic-bezier(0.55, 0.085, 0.68, 0.53) infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    z-index: 10000;
    width: 0;
}

/* Custom Interactive Cursor */
.custom-cursor-dot,
.custom-cursor-circle {
    pointer-events: none;
    position: fixed;
    border-radius: 50%;
    opacity: 0;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}
@media (max-width: 1024px) {
    .custom-cursor-dot,
    .custom-cursor-circle {
        display: none !important;
    }
}
.custom-cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}
.custom-cursor-circle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--secondary);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}
.cursor-hovering .custom-cursor-circle {
    width: 50px;
    height: 50px;
    background-color: rgba(var(--secondary-rgb), 0.1);
    border-color: var(--primary);
}

/* Layout Utilities */
.section {
    padding: 7rem 0;
    position: relative;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}
.section-subtitle {
    font-family: var(--font-accent);
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
    display: inline-block;
}
.section-title {
    font-size: 2.75rem;
    color: var(--text-main);
    position: relative;
    display: inline-block;
}
.section-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: var(--transition-smooth);
}
.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 12px 40px var(--neon-glow);
}

/* Glowing Neon Button */
.btn-neon {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff !important;
    padding: 0.85rem 1.85rem;
    font-family: var(--font-accent);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: var(--transition-bounce);
    border: none;
    cursor: pointer;
}
.btn-neon:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--neon-glow);
}
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main) !important;
    padding: 0.85rem 1.85rem;
    font-family: var(--font-accent);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 50px;
    transition: var(--transition-smooth);
    cursor: pointer;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.15);
}

/* Header & Sticky Navbar */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999 !important;
    transform: translate3d(0, 0, 0);
    will-change: transform;
    transition: var(--transition-smooth);
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
[data-theme="light"] header {
    background: rgba(244, 245, 246, 0.95);
    border-bottom: 1px solid rgba(9, 9, 11, 0.05);
}
header.scrolled {
    background: rgba(9, 9, 11, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
[data-theme="light"] header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid rgba(9, 9, 11, 0.08);
    box-shadow: 0 10px 30px rgba(9, 9, 11, 0.05);
}
.navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    transition: var(--transition-smooth);
}
header.scrolled .navbar {
    padding: 0.85rem 2rem;
}
.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
}
.nav-links a {
    font-family: var(--font-accent);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-sub);
    position: relative;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition-smooth);
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition-smooth);
}
.theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

/* Mobile Sidebar */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition-smooth);
}
.mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .mobile-nav-toggle:hover {
    background: rgba(9, 9, 11, 0.05);
}
.mobile-nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition-smooth);
}
.sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--card-border);
    z-index: 100000 !important;
    display: flex;
    flex-direction: column;
    padding: 3rem 2rem;
    gap: 3rem;
    transition: var(--transition-smooth);
    box-shadow: -10px 0 30px var(--shadow-color);
}
.sidebar.active {
    right: 0;
}
.sidebar-close {
    align-self: flex-end;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}
.sidebar-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.sidebar-links a {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Hero / Home Section */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    padding: 12rem 2rem 5rem;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    z-index: 10;
}
@media (min-height: 850px) {
    #hero {
        justify-content: center;
        padding-top: 6rem;
    }
}
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
}
.hero-tag {
    font-family: var(--font-accent);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 50px;
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    position: relative;
    z-index: 1;
}
.hero-tag:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 0 25px rgba(var(--primary-rgb), 0.25);
    transform: translateY(-2px);
}
.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}
.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.3);
}
.hero-rotating-text {
    font-family: var(--font-accent);
    height: 50px;
    font-size: 2.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    display: inline-block;
    position: relative;
}
.hero-rotating-text::after {
    content: '|';
    margin-left: 5px;
    color: var(--primary);
    animation: caret-blink 0.8s step-end infinite;
    -webkit-text-fill-color: var(--primary);
}
@keyframes caret-blink {
    from, to { color: transparent; }
    50% { color: var(--primary); }
}
.hero-desc {
    font-size: 1.1rem;
    color: var(--text-sub);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 3.5rem;
}
.hero-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.hero-socials a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
}
.hero-socials a:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--neon-glow);
    transform: translateY(-3px);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4.5rem;
    align-items: center;
}
.about-img-area {
    position: relative;
}
.about-img-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--shadow-color);
}
.about-img-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--primary), var(--secondary)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    pointer-events: none;
    border-radius: 20px;
}
.about-img-frame img {
    transition: var(--transition-smooth);
}
.about-img-frame:hover img {
    transform: scale(1.05);
}
.about-experience-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1.25rem 1.75rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px var(--accent-glow);
}
.about-experience-badge h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.about-experience-badge p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}
.about-content h3 {
    font-size: 1.85rem;
    margin-bottom: 1.5rem;
}
.about-bio {
    color: var(--text-sub);
    margin-bottom: 2.5rem;
}
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.about-stat-card {
    padding: 1.5rem;
    text-align: center;
}
.about-stat-num {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    display: inline-block;
}
.about-stat-lbl {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 500;
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}
.skills-category-title {
    font-size: 1.35rem;
    margin-bottom: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.skill-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.skill-info {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-accent);
    font-size: 0.95rem;
    font-weight: 500;
}
.skill-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.skill-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
}
.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.1, 1, 0.1, 1);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.service-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}
.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.1));
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition-smooth);
}
.service-card:hover .service-icon {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 5px 15px var(--accent-glow);
    transform: rotateY(360deg);
}
.service-title {
    font-size: 1.35rem;
}
.service-desc {
    color: var(--text-sub);
    font-size: 0.95rem;
    flex-grow: 1;
}
/* Clickable linked service card */
a.service-card-linked {
    color: inherit;
    cursor: pointer;
    transition: var(--transition-smooth), border-color 0.3s;
}
a.service-card-linked:hover {
    border-color: var(--primary) !important;
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(var(--primary-rgb), 0.18);
}
a.service-card-linked .service-icon {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 5px 15px var(--accent-glow);
}

/* Timeline (Experience & Education) */
.timeline-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
}
.timeline-tab-btn {
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-sub);
    cursor: pointer;
    padding: 0.5rem 1.5rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition-smooth);
}
.timeline-tab-btn.active {
    color: var(--primary);
    border-color: var(--primary);
}
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}
.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    transform: translateX(-50%);
}
.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 3rem;
    margin-bottom: 3.5rem;
}
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}
.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}
.timeline-dot {
    position: absolute;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--bg-base);
    border: 3px solid var(--primary);
    z-index: 5;
    box-shadow: 0 0 10px var(--primary);
}
.timeline-item:nth-child(odd) .timeline-dot {
    right: -8px;
}
.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}
.timeline-card {
    padding: 2rem;
}
.timeline-date {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.timeline-title {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}
.timeline-org {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 1rem;
}
.timeline-desc {
    color: var(--text-sub);
    font-size: 0.9rem;
}

/* Projects Showcase */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
}
.filter-btn {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-accent);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-sub);
    transition: var(--transition-smooth);
}
.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.project-card {
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.project-img-area {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}
.project-img-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-img-area img {
    transform: scale(1.08);
}
.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--bg-base-rgb), 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: var(--transition-smooth);
}
.project-card:hover .project-overlay {
    opacity: 1;
}
.project-link-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
}
.project-link-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 15px var(--primary);
    transform: scale(1.1);
}
.project-card-info {
    padding: 1.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.project-card-category {
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.project-card-title {
    font-size: 1.35rem;
}
.project-card-desc {
    color: var(--text-sub);
    font-size: 0.9rem;
    flex-grow: 1;
}
.project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.tech-badge {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-sub);
}

/* Testimonials Section */
.testimonials-slider-container {
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
}
.testimonials-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.testimonial-slide {
    min-width: 100%;
    padding: 0 1rem;
}
.testimonial-body-card {
    padding: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.testimonial-review {
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-main);
    line-height: 1.7;
}
.testimonial-client {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.testimonial-client-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px var(--neon-glow);
}
.testimonial-client-info {
    text-align: left;
}
.testimonial-client-name {
    font-size: 1.1rem;
    font-weight: 700;
}
.testimonial-client-role {
    font-size: 0.85rem;
    color: var(--text-sub);
}
.testimonial-rating {
    color: #f59e0b;
    display: flex;
    gap: 0.25rem;
}
.testimonials-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
}
.testimonials-nav-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--card-border);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.testimonials-nav-btn.active {
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    width: 28px;
}

/* ================================================
   GALLERY — Category Filter Tabs + Actual-Ratio Masonry
   ================================================ */

/* ==========================================================
   GALLERY — Category Grid Cards + Aspect-Ratio Sub-Gallery
   ========================================================== */

/* Gallery Category Cards Grid */
.gallery-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}
.category-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}
.category-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.15);
}
.category-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 65%; /* 16:10 aspect ratio */
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}
.category-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.category-card:hover .category-card-img {
    transform: scale(1.08);
}
.category-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.85) 100%);
}
.category-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    z-index: 2;
}
.category-card-count {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}
.category-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-family: var(--font-heading);
}
.category-card-desc {
    font-size: 0.88rem;
    color: var(--text-sub);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}
.category-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin-top: auto;
    transition: var(--transition-smooth);
}
.category-card-btn i {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}
.category-card:hover .category-card-btn {
    color: var(--primary);
}
.category-card:hover .category-card-btn i {
    transform: translateX(5px);
}

/* Sub-Gallery Images View Styles */
.gallery-images-view {
    display: none; /* Controlled by JS */
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gallery-images-view.active {
    display: block;
    opacity: 1;
}
.gallery-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-wrap: wrap;
    gap: 1rem;
}
.gallery-back-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}
.gallery-back-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    color: var(--primary);
}
.gallery-back-btn i {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}
.gallery-back-btn:hover i {
    transform: translateX(-4px);
}
.gallery-active-info {
    text-align: right;
}
.gallery-active-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
    font-family: var(--font-heading);
}
.gallery-active-count {
    font-size: 0.8rem;
    color: var(--text-sub);
}

/* Tablet / Mobile tweaks for Category Cards */
@media (max-width: 992px) {
    .gallery-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}
@media (max-width: 600px) {
    .gallery-categories-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .gallery-sub-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .gallery-active-info {
        text-align: left;
    }
}

/* Masonry Grid — actual aspect ratio */
.gallery-masonry {
    columns: 4 240px;
    column-gap: 1.25rem;
}
.gallery-item-wrap {
    break-inside: avoid;
    margin-bottom: 1.25rem;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.gallery-item-wrap.hidden {
    display: none;
}
.gallery-item-wrap.fade-out {
    opacity: 0;
    transform: scale(0.94);
}
.gallery-item {
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    display: block;
}
/* ACTUAL RATIO — no forced height */
.gallery-item img {
    width: 100%;
    height: auto;          /* Preserve natural aspect ratio */
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item:hover img {
    transform: scale(1.06);
}
.gallery-info-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 1rem;
    opacity: 0;
    transition: var(--transition-smooth);
    border-radius: 12px;
}
.gallery-item:hover .gallery-info-overlay {
    opacity: 1;
}
.gallery-overlay-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 44px;
    height: 44px;
    background: rgba(var(--primary-rgb), 0.2);
    border: 1px solid rgba(var(--primary-rgb), 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    backdrop-filter: blur(8px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    opacity: 0;
}
.gallery-item:hover .gallery-overlay-icon {
    opacity: 1;
    transform: translate(-50%, -50%);
}
.gallery-info-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}
.gallery-info-cat {
    font-size: 0.72rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* Legacy grid class (kept for compatibility) */
.gallery-grid {
    columns: 3 280px;
    column-gap: 1.5rem;
}


/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.blog-card {
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.blog-img-area {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}
.blog-img-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.blog-card:hover .blog-img-area img {
    transform: scale(1.05);
}
.blog-card-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}
.blog-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}
.blog-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.blog-card-title {
    font-size: 1.35rem;
    line-height: 1.3;
}
.blog-card-title:hover {
    color: var(--primary);
}
.blog-card-desc {
    font-size: 0.9rem;
    color: var(--text-sub);
    flex-grow: 1;
}
.blog-read-more {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.blog-card:hover .blog-read-more {
    gap: 0.75rem;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4.5rem;
}
.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.contact-info-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}
.contact-info-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid var(--card-border);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.contact-info-details h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.contact-info-details p,
.contact-info-details a {
    font-size: 0.95rem;
    color: var(--text-sub);
}
.contact-info-details a:hover {
    color: var(--primary);
}
.contact-map-card {
    height: 200px;
    margin-top: 2rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}
.contact-map-card iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: invert(90%) hue-rotate(180deg);
}
[data-theme="light"] .contact-map-card iframe {
    filter: none;
}
.contact-form-card {
    padding: 3rem;
}
.contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.contact-form-grid .form-group:nth-child(3),
.contact-form-grid .form-group:nth-child(4) {
    grid-column: span 2;
}
.form-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-input-group label {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-sub);
}
.form-input-group input,
.form-input-group textarea {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.85rem 1.15rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}
.form-input-group input:focus,
.form-input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.15);
}
.contact-submit-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    display: none;
}
.contact-submit-status.success {
    color: #10b981;
}
.contact-submit-status.error {
    color: #ef4444;
}

/* Floating Actions */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
}
.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: var(--transition-bounce);
}
.floating-btn:hover {
    transform: translateY(-3px);
}
.whatsapp-btn {
    background-color: #25d366;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}
.back-to-top {
    background-color: var(--bg-surface);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    opacity: 0;
    visibility: hidden;
}
.back-to-top.active {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
}

/* Footer Section */
footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--card-border);
    padding: 5rem 0 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.footer-desc {
    color: var(--text-sub);
    font-size: 0.95rem;
}
.footer-links-col h4,
.footer-newsletter h4 {
    font-size: 1.15rem;
    margin-bottom: 1.75rem;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.footer-links a {
    color: var(--text-sub);
    font-size: 0.95rem;
}
.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}
.footer-newsletter p {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.newsletter-form {
    display: flex;
    gap: 0.5rem;
}
.newsletter-form input {
    flex-grow: 1;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.9rem;
}
.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
}
.newsletter-form button {
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.03);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.lightbox-content {
    position: relative;
    max-width: 900px;
    max-height: 80vh;
}
.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transition: opacity 0.15s ease-in-out;
}
.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}
.lightbox-content {
    max-width: min(90vw, 1100px);
}
.lightbox-caption {
    margin-top: 0.75rem;
    text-align: center;
    display: none;
}
.lightbox-caption .lb-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.2rem;
}
.lightbox-caption .lb-cat {
    font-size: 0.78rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Lightbox Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    transition: var(--transition-smooth);
}
.lightbox-nav:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px var(--neon-glow);
}
.lightbox-nav i {
    width: 24px;
    height: 24px;
}
.lightbox-prev {
    left: 2.5rem;
}
.lightbox-next {
    right: 2.5rem;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    .lightbox-nav i {
        width: 20px;
        height: 20px;
    }
    .lightbox-prev {
        left: 0.75rem;
    }
    .lightbox-next {
        right: 0.75rem;
    }
}

/* Project & Blog Detail Pages Layouts */
.project-details-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4.5rem;
    align-items: start;
}
.blog-details-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 4rem;
    align-items: start;
}
.project-details-sidebar {
    position: sticky;
    top: 120px;
}

/* Responsive Queries */
@media (max-width: 1200px) {
    /* Mobile Header Navigation Triggered at 1200px */
    header {
        background: rgba(9, 9, 11, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    [data-theme="light"] header {
        background: rgba(244, 245, 246, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(9, 9, 11, 0.08) !important;
    }

    .navbar {
        padding: 0.9rem 1.5rem;
    }
    .mobile-nav-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
    }
    
    /* Mobile Sidebar Premium Glassmorphism */
    .sidebar {
        background: rgba(18, 18, 22, 0.98) !important;
        backdrop-filter: blur(25px);
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 100000 !important;
    }
    [data-theme="light"] .sidebar {
        background: rgba(255, 255, 255, 0.98) !important;
        border-left: 1px solid rgba(9, 9, 11, 0.08);
        z-index: 100000 !important;
    }

    /* Hero Responsive Overlap Fix (Triggered at 1200px for all tablets/mobiles) */
    #hero {
        height: auto !important;
        min-height: 100vh;
        padding-top: 12rem !important; /* Always push tagline safely below navbar */
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        padding-bottom: 4.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start !important; /* Stack naturally to avoid short screens pushing tagline into navbar */
    }
    .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    .hero-tag {
        font-size: 0.8rem;
        letter-spacing: 0.1em;
        margin-bottom: 1.5rem;
        padding: 0.4rem 1rem;
        line-height: 1.4;
        white-space: normal;
        text-align: center;
        display: inline-block;
    }
    .hero-title {
        font-size: 3.25rem;
    }
    .hero-rotating-text {
        font-size: 1.75rem;
        height: auto;
        min-height: 45px;
        margin-bottom: 1.5rem;
    }
    .hero-desc {
        font-size: 1rem;
        margin-bottom: 2.25rem;
    }

    /* Details layouts */
    .project-details-grid,
    .blog-details-grid {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
    .project-details-sidebar {
        position: static !important;
    }

    /* Premium Tablet Intermediate Grid Overhaul (2 Columns) */
    .projects-grid,
    .services-grid,
    .blog-grid,
    .about-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }
    .about-img-area {
        max-width: 450px;
        margin: 0 auto;
    }
    .skills-container {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
}

@media (max-width: 768px) {
    #hero {
        padding-top: 13rem !important; /* Extra vertical spacing on mobile screens */
    }
    .hero-title {
        font-size: 2.5rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .hero-rotating-text {
        font-size: 1.5rem;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
    .hero-desc {
        font-size: 0.95rem;
    }
    .hero-ctas {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 2.5rem;
    }
    .hero-ctas .btn-neon,
    .hero-ctas .btn-outline {
        width: 100%;
        justify-content: center;
    }

    /* About Section Spacing & Badge Right-Overflow Bug Fix */
    .about-experience-badge {
        right: 10px !important;
        bottom: 10px !important;
        padding: 1rem 1.25rem;
    }

    /* Testimonial mobile adjustment */
    .testimonial-body-card {
        padding: 2rem 1.25rem !important;
        gap: 1.5rem !important;
    }
    .testimonial-review {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    /* Gallery on Tablet */
    .gallery-masonry {
        columns: 3 !important;
        column-gap: 1rem !important;
    }
    .gallery-item-wrap {
        margin-bottom: 1rem !important;
    }
    .gallery-filter-tabs {
        gap: 0.5rem;
    }
    .gallery-filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    /* legacy */
    .gallery-grid {
        columns: 2 !important;
        column-gap: 1rem !important;
    }

    /* Timeline Styling */
    .timeline-item {
        width: 100%;
        padding-left: 2rem;
        padding-right: 0;
        text-align: left !important;
        margin-bottom: 2.5rem;
    }
    .timeline-item::before {
        left: 0;
    }
    .timeline-container::before {
        left: 20px;
    }
    .timeline-item:nth-child(even) {
        left: 0;
    }
    .timeline-dot {
        left: 12px !important;
        right: auto !important;
    }
    
    /* Contact Section Form Overhaul */
    .contact-form-card {
        padding: 1.75rem;
    }
    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .contact-form-grid .form-group:nth-child(3),
    .contact-form-grid .form-group:nth-child(4) {
        grid-column: span 1;
    }

    /* Footer Newsletter & Bottom Layout Fix */
    footer {
        padding: 4rem 0 2rem !important;
    }
    .footer-grid,
    .footer-brand,
    .footer-links-col,
    .footer-newsletter,
    .footer-bottom {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .footer-brand .hero-socials {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .newsletter-form {
        flex-direction: column;
        gap: 0.75rem;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .newsletter-form input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .newsletter-form button {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-items: center;
        padding-top: 1.5rem;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .section {
        padding: 5rem 0;
    }
    .container {
        padding: 0 1.5rem;
    }
    .section-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 600px) {
    /* Collapse intermediate tablet grids to single columns on small mobile screens */
    .projects-grid,
    .services-grid,
    .blog-grid,
    .about-stats {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

@media (max-width: 480px) {
    #hero {
        padding-top: 14rem !important; /* Safe padding for narrow screens */
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    .section-title {
        font-size: 2rem;
    }
    .hero-title {
        font-size: 2rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .hero-rotating-text {
        font-size: 1.25rem;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
    .hero-desc {
        font-size: 0.9rem;
        padding: 0;
    }
}

/* Additional premium layout adjustments and mobile refinements */

/* Detail Pages Title Enhancements */
.project-details-title, .blog-details-title {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    font-weight: 800;
}
@media (max-width: 768px) {
    .project-details-title, .blog-details-title {
        font-size: 2rem;
        margin-bottom: 1.25rem;
    }
}

/* Blog Search Form Styles */
.blog-search-wrapper {
    max-width: 500px;
    margin: 3rem auto 0;
}
.blog-search-form {
    display: flex;
    gap: 0.5rem;
}
.blog-search-input-field {
    position: relative;
    flex-grow: 1;
}
.blog-search-input {
    width: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.85rem 1.15rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}
.blog-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.04);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.1);
}
.blog-search-btn {
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
}
@media (max-width: 500px) {
    .blog-search-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    .blog-search-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Timeline Squishing Fix on Mobile Screens */
@media (max-width: 768px) {
    .timeline-item {
        padding-left: 2.5rem !important;
    }
    .timeline-card {
        padding: 1.25rem !important;
    }
}

/* Small Viewport (iPhone SE / narrow mobile) Layout and Logo Fixes */
@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem !important;
        max-width: 175px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }
    .logo img {
        max-height: 32px !important;
    }
    .navbar {
        padding: 0.75rem 1rem !important;
    }
    .theme-toggle-btn {
        width: 32px;
        height: 32px;
    }
    .mobile-nav-toggle {
        padding: 6px;
    }
    .mobile-nav-toggle span {
        width: 20px;
        height: 2px;
    }
    .gallery-masonry {
        columns: 1 !important;
    }
    .gallery-filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .gallery-filter-tabs::-webkit-scrollbar { display: none; }
    .gallery-filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .gallery-grid {
        columns: 1 !important;
    }
}
@media (max-width: 360px) {
    .logo {
        max-width: 130px;
    }
    .navbar {
        gap: 0.5rem;
    }
}
