/* ===== CSS Variables - Premium Design System ===== */
:root {
    --primary-color: #0078D4;
    /* Azure Blue */
    --secondary-gradient: linear-gradient(135deg, #7c3aed, #9333ea);
    /* Purple Gradient */
    --accent-purple: #7c3aed;
    --bg-dark: #0a0a0f;
    --bg-navy: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.03);
    /* Typography Scale */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    /* Type Scale - Desktop */
    --h1-size: 3.25rem;
    /* ~52px */
    --h1-height: 1.15;

    --h2-size: 2.25rem;
    /* ~36px */
    --h2-height: 1.2;

    --h3-size: 1.75rem;
    /* ~28px */
    --h3-height: 1.3;

    --subhead-size: 1.25rem;
    /* ~20px */
    --subhead-height: 1.6;

    --body-size: 1.125rem;
    /* ~18px */
    --body-height: 1.7;

    --small-size: 0.875rem;
    /* ~14px */

    /* Colors - Enhanced Contrast */
    --text-main: #f8fafc;
    /* Slate 50 - High Brightness */
    --text-secondary: #e2e8f0;
    /* Slate 200 - Better readbility than 300 */
    --text-muted: #94a3b8;
    /* Slate 400 - Meta info */

    /* Missing Variables Fix */
    --white: #ffffff;
    --text-light: #cbd5e1;
    /* Slate 300 */
    --text-mobile: #f8fafc;
    /* Same as text-main */
    --text-dark: #0f172a;
    /* Slate 900 */

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: var(--body-height);
    color: var(--text-mobile);
    /* Default, overridden by styles */
    background: var(--bg-dark);
    overflow-x: hidden;
    font-size: var(--body-size);
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Standardized Hero Typography */
.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.gradient-text {
    background: linear-gradient(135deg, #a78bfa, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* UK Brand Symbol */
.nav-logo-uk {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    color: #ffffff !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    flex-shrink: 0 !important;
    user-select: none !important;
    transition: all 0.3s ease !important;
}

.nav-logo-uk:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5) !important;
}

h1,
h2,
h3,

h1 {
    font-size: var(--h1-size);
    line-height: var(--h1-height);
}

h2 {
    font-size: var(--h2-size);
    line-height: var(--h2-height);
    margin-top: 2rem;
}

h3 {
    font-size: var(--h3-size);
    line-height: var(--h3-height);
    font-weight: 600;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    max-width: 75ch;
}

/* Readability Max Width */

/* Mobile Type Scale */
@media (max-width: 768px) {
    :root {
        --h1-size: 2.25rem;
        /* ~36px */
        --h2-size: 1.75rem;
        /* ~28px */
        --h3-size: 1.375rem;
        /* ~22px */
        --subhead-size: 1.125rem;
        /* 18px */
        --body-size: 1rem;
        /* 16px */
    }
}

section {
    padding: 100px 0;
    background: var(--bg-dark) !important;
    /* Force consistency across all sections */
}

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
}

/* Grid Background Pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

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

/* ===== Navigation - Dark Theme ===== */
/* ===== Navigation - Dark Theme ===== */
.navbar {
    background: rgba(2, 6, 23, 0.3);
    /* Navy transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease;
}

/* Scroll state styling could be added via JS, but this is a good default */

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}


.nav-brand h2 {
    color: var(--white);
    font-size: 1.5rem;
    font-family: var(--font-primary);
    font-weight: 700;
}

.nav-tagline {
    color: var(--text-light);
    font-size: 0.85rem;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--white);
}

.nav-resume-btn {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.nav-resume-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1002;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: #ffffff;
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Accessibility Skip Link */
.skip-to-content {
    position: absolute;
    top: -200px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    z-index: 10001;
    transition: top 0.3s;
    border-radius: 0 0 10px 0;
    text-decoration: none;
    font-weight: bold;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== Hero Section ===== */
.hero {
    background: var(--bg-dark);
    color: var(--white);
    padding: 140px 0 80px;
    /* Increased top padding to account for fixed navbar */
    margin-top: 0;
    /* REMOVED margin so background goes to top */
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Subtle glow effect */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.15), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

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

/* Hero Grid Layout */
.hero-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 992px) {
    .hero-content-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    /* order overrides removed to keep text first */
    .hero-content {
        order: 1 !important;
    }

    .hero-image-wrapper {
        order: 2 !important;
        margin: 2rem auto 0;
    }

    .hero-buttons {
        justify-content: center;
    }
}

/* Profile Photo Section */
.hero-image-wrapper {
    position: relative;
    width: 380px;
    height: 380px;
    margin: 0 auto;
}

.hero-image-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.3), transparent 70%);
    filter: blur(40px);
    z-index: 0;
}

.hero-image {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* Floating Glassmorphism Badges */
.floating-badge {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white);
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

.floating-badge i {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* Badge Positions */
.badge-1 {
    top: -10px;
    right: -20px;
    animation-delay: 0s;
}

.badge-2 {
    bottom: 40px;
    right: -30px;
    animation-delay: 0.5s;
}

.badge-3 {
    top: 80px;
    left: -40px;
    animation-delay: 1s;
}

.badge-4 {
    bottom: -10px;
    left: -30px;
    animation-delay: 1.5s;
}

.hero {
    padding: 180px 0 100px;
    /* Increased top padding to clear fixed navbar overlap */
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    text-align: center;
    position: relative;
    /* Ensure z-index works if needed */
    z-index: 10;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
    background: linear-gradient(135deg, #ffffff, var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat p {
    font-size: 1rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .stat h3 {
        font-size: 2rem;
    }
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--secondary-gradient);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
}

/* Unified Section Styling */
.about,
.leadership-section,
.projects,
.expertise,
.certifications,
.contact {
    background: var(--bg-dark) !important;
}

.section-title {
    text-align: center;
    font-size: 3.5rem;
    /* Slightly larger for Google-level impact */
    font-weight: 800;
    margin-bottom: 4rem;
    color: var(--text-main);
    position: relative;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--secondary-gradient);
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

/* ===== About Section ===== */
.about {
    background: var(--light-bg);
}

.about-text {
    max-width: 900px;
    margin: 0 auto;
}

.lead {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 2;
    font-family: 'Inter', sans-serif;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.highlight {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.highlight:hover {
    transform: translateY(-5px);
}

.highlight i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.highlight h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* ===== Projects Section ===== */
.project-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.project-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.project-details h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.project-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.project-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.metric-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.tech-tag {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.project-highlights {
    margin: 2rem 0;
}

.project-highlights h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.project-highlights ul {
    list-style: none;
}

.project-highlights li {
    padding: 0.5rem 0;
    color: var(--text-light);
}

.project-highlights i {
    color: var(--success);
    margin-right: 0.5rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ===== Expertise Section ===== */
.expertise-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.expertise-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.expertise-category:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.3);
}

.expertise-category h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.expertise-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.expertise-items span {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.expertise-items span:hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--white);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

/* ===== Skills Section ===== */
.skills {
    background: var(--light-bg);
}

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

.skill-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.skill-category i {
    margin-right: 0.5rem;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* ===== Contact Section ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-methods {
    margin-top: 2rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    /* Glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: #cbd5e1;
    /* Light slate text for visibility */
    transition: all 0.3s;
}

.contact-method:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateX(5px);
}

.contact-method i {
    font-size: 1.5rem;
}

.contact-form {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Form Input Styles */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    /* Slightly transparent white for dark mode */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* Modern rounded corners */
    font-size: 1rem;
    font-family: inherit;
    color: var(--white);
    /* Ensure text is white */
    transition: var(--transition);
}

.form-group select option {
    background: var(--bg-navy);
    /* Ensure dropdown options have dark background */
    color: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

/* ===== Footer ===== */
.footer {
    background: var(--dark-bg);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0 1rem;
    transition: color 0.3s;
}

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

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        z-index: 1002;
        /* Enhanced visibility on mobile */
        background: rgba(124, 58, 237, 0.2);
        border-color: rgba(124, 58, 237, 0.4);
    }

    .hamburger:active {
        transform: scale(0.95);
    }

    .nav-menu {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateY(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        padding: 0;
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu a {
        font-size: 1.5rem;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.3s, transform 0.3s;
    }

    .nav-menu.active a {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.2s;
    }

    .nav-menu.active a:nth-child(2) {
        transition-delay: 0.3s;
    }

    .nav-menu.active a:nth-child(3) {
        transition-delay: 0.4s;
    }

    .nav-menu.active a:nth-child(4) {
        transition-delay: 0.5s;
    }

    .nav-menu.active a:nth-child(5) {
        transition-delay: 0.6s;
    }

    .nav-menu.active a:nth-child(6) {
        transition-delay: 0.7s;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2.25rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }

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

    .project-featured {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

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

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

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

/* ===== Scroll to Top Button ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

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

.scroll-to-top:hover {
    background: var(--secondary-color);
    /* Uses existing gradient or secondary color if defined, falling back */
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 120, 212, 0.6);
}

/* ===== Optimized Form Layout ===== */
.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}