:root {
    /* Theme Tokens - Brand Identity */
    --primary: #8b0000; /* Dark Red */
    --primary-glow: rgba(139, 0, 0, 0.5);
    --secondary: #660000;
    --accent: #ff2c2c;
    
    /* Default: Dark Mode */
    --background: #000000;
    --surface: #0a0a0a;
    --surface-accent: #111111;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --border: rgba(139, 0, 0, 0.3);
    --nav-bg: rgba(0, 0, 0, 0.8);
    --card-bg: rgba(255, 255, 255, 0.03);
    --shadow: rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --accent-glow: linear-gradient(45deg, var(--primary), var(--secondary));
}

body.light-mode {
    --background: #ffffff;
    --surface: #f9f9f9;
    --surface-accent: #f0f0f0;
    --text: #1a1a1a;
    --text-muted: #555555;
    --border: rgba(139, 0, 0, 0.2);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --card-bg: rgba(0, 0, 0, 0.03);
    --shadow: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.05);
}

/* System Mouse Pointer Restore */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: auto !important; /* Force regular mouse */
}

a, button, .theme-btn, .menu-toggle, .service-card, .magnetic, [role="button"] {
    cursor: pointer !important; /* Standard link pointer */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* Link Styling Reset */
a, a:link, a:visited {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary);
}

/* Specific Footer Link Fixes */
.footer-links a, .footer-links a:visited {
    color: var(--text);
    opacity: 0.8;
}

.footer-links a:hover {
    color: var(--primary);
    opacity: 1;
}

.social-icons a {
    color: var(--text);
    opacity: 0.7;
}

.social-icons a:hover {
    color: var(--primary);
    opacity: 1;
}

/* Performance Optimization for Blurs */
.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--primary);
    filter: blur(150px);
    border-radius: 50%;
    opacity: 0.15;
    z-index: -1;
    animation: blobFloat 20s infinite alternate;
    pointer-events: none;
    will-change: transform;
}

h1, h2, h3, h4, h5, .logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
}

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

.section-padding {
    padding: 10rem 0;
}

.accent {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 1s ease, visibility 1s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-text {
    font-size: 3rem;
    color: white;
    letter-spacing: 10px;
    font-weight: 900;
    display: block;
    margin-bottom: 20px;
}

.loader-bar {
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 2s ease;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0; /* Zero padding to keep the bar as slim as possible */
    height: 90px; /* Compact bar height */
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

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

.logo {
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    height: 100%;
}

.logo-img {
    height: 180px; /* KEPT EXACTLY THE SAME AS REQUESTED */
    width: auto;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 15px rgba(139, 0, 0, 0.4));
    margin-bottom: -90px; /* Allows the logo to hang over the bottom edge of the bar */
    z-index: 1001;
    position: relative;
}

@media (max-width: 768px) {
    .navbar {
        height: 70px; /* Even more compact bar for mobile */
    }
    
    .logo-img {
        height: 100px; /* KEPT EXACTLY THE SAME AS REQUESTED */
        margin-bottom: -30px; /* Proportional overhang for mobile */
    }
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s;
}

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

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

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

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.menu-toggle.active .bar:first-child {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:last-child {
    transform: translateY(-8px) rotate(-45deg);
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.theme-btn:hover {
    transform: rotate(30deg);
}

/* Hero Section Premium Effects */
.hero-content h1 .accent {
    position: relative;
    z-index: 1;
}

.hero-content h1 .accent::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(20px);
    animation: haloPulse 4s infinite alternate;
}

@keyframes haloPulse {
    from { opacity: 0.3; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 0.6; transform: translate(-50%, -50%) scale(1.2); }
}

/* Floating Code Symbols in Hero Background */
.hero-symbols {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.symbol {
    position: absolute;
    color: var(--primary);
    opacity: 0.1;
    font-family: monospace;
    font-size: 2rem;
    animation: symbolFloat 15s linear infinite;
}

@keyframes symbolFloat {
    0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.2; }
    90% { opacity: 0.2; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

.hero-content h5 {
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: 5px;
}

.hero-content h1 {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 1.5rem;
}

.typing-text {
    font-size: 2.5rem;
    height: 3.5rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.hero-content p {
    max-width: 600px;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 30px var(--primary-glow);
}

.btn-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

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

/* Heading Accent Lines */
.section-header {
    margin-bottom: 5rem;
    position: relative;
    padding-left: 2rem;
}

.section-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background: var(--accent-glow);
    border-radius: 10px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.subtitle {
    color: var(--primary);
    letter-spacing: 5px;
    font-weight: 700;
    display: block;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--primary-glow);
}

.section-header h2 {
    font-size: 3.5rem;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.about-image-wrapper {
    position: relative;
    height: 400px;
    background: var(--card-bg);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.experience-card {
    background: var(--bg-color);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    z-index: 2;
}

.exp-number {
    display: block;
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.exp-text {
    font-weight: 700;
    text-transform: uppercase;
}

/* Services Section Upgrade */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.service-card {
    padding: 4rem 3rem;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    transition: transform 0.1s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(168, 85, 247, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.service-card:hover::after {
    opacity: 1;
}

.service-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px var(--primary-glow);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.service-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: var(--primary);
    filter: blur(30px);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.service-card:hover .service-icon {
    transform: translateZ(30px) scale(1.1);
    text-shadow: 0 0 20px var(--primary-glow);
}

.service-card:hover .service-icon::after {
    opacity: 0.4;
    animation: iconPulse 2s infinite alternate;
}

@keyframes iconPulse {
    from { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    to { transform: translate(-50%, -50%) scale(1.5); opacity: 0.5; }
}

.service-card h3 {
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.service-card p {
    position: relative;
    z-index: 2;
}

/* Glowing Border Animation Wrapper */
.card-border-glow {
    position: absolute;
    inset: -2px;
    background: conic-gradient(from var(--angle, 0deg), transparent 70%, var(--primary), var(--secondary), var(--primary));
    border-radius: 24px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    animation: rotateAngle 4s linear infinite;
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateAngle {
    to { --angle: 360deg; }
}

.service-card:hover .card-border-glow {
    opacity: 1;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 5rem;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.contact-item .icon {
    font-size: 2rem;
    color: var(--primary);
}

.contact-item .text h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contact-item .text a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Contact Section Upgrade */
.contact-form-wrapper {
    background: var(--card-bg);
    padding: 4rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    position: relative;
    z-index: 1;
}

.contact-form-wrapper::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--primary), transparent, var(--secondary));
    border-radius: 26px;
    z-index: -1;
    opacity: 0.3;
    animation: borderPulse 3s infinite alternate;
}

@keyframes borderPulse {
    from { opacity: 0.2; filter: blur(2px); }
    to { opacity: 0.5; filter: blur(5px); }
}

/* Submit Button Shimmer */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: all 0.6s;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Navbar Enhancements */
.navbar.sticky {
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-glow);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

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

/* Footer Upgrades */
.footer {
    padding: 5rem 0 2rem;
    background: #050505;
    color: white;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-glow);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

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

.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    will-change: transform, opacity;
}

.reveal-text.active {
    animation: slideUp 1s forwards;
}

/* Ensure Main Content Visibility */
main {
    position: relative;
    z-index: 10;
}

section {
    position: relative;
    z-index: 11;
}

.navbar {
    z-index: 1000;
}

.loader {
    z-index: 10000;
}

#tech-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 4px;
    height: 0%;
    background: var(--accent-glow);
    z-index: 10001;
    transition: height 0.1s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Responsive */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        cursor: pointer;
        z-index: 1001;
        position: relative;
    }

    .menu-toggle .bar {
        width: 100%;
        height: 2px;
        background-color: var(--text);
        transition: all 0.3s ease;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: var(--surface);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: right 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
        padding: 2rem;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.5s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.4s; }

    .nav-link {
        font-size: 1.5rem;
        color: var(--text);
    }

    .about-grid, .services-grid, .contact-grid, .footer-content {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }

    .about-image-wrapper {
        height: 300px;
    }

    .contact-form-wrapper {
        padding: 2rem;
    }
}

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

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .typing-text {
        font-size: 1.5rem;
        height: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

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

    .btn {
        width: 100%;
        text-align: center;
    }

    .section-padding {
        padding: 5rem 0;
    }

    .nav-actions {
        gap: 1.5rem;
    }
}
