:root {
    /* Core Palette */
    --p-dark: #0f172a;
    --p-slate: #1e293b;
    --p-cyan: #06b6d4;
    --p-cyan-hover: #0891b2;
    --p-white: #ffffff;
    --p-gray: #f8fafc;

    /* Semantic Theme Variables (Default: Light) */
    --bg-body: #ffffff;
    --bg-card: #f8fafc;
    --hero-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --navbar-bg: rgba(255, 255, 255, 0.95);

    --text-main: #1e293b;
    --text-muted: #64748b;
    --heading-color: #0f172a;

    --primary-color: #0f172a;
    --secondary-color: #1e293b;
    /* Restored for compatibility */
    --accent-color: #06b6d4;
    --accent-hover: #0891b2;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    /* Spacing & Layout */
    --container-width: 1200px;
    --section-padding: 5rem 1rem;
    --border-radius: 12px;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-body: #0b1120;
    /* Deep Dark Blue */
    --bg-card: #1e293b;
    /* Slate Card */
    --hero-bg: linear-gradient(135deg, #0b1120 0%, #0f172a 100%);
    --navbar-bg: rgba(15, 23, 42, 0.95);

    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --heading-color: #ffffff;

    --primary-color: #ffffff;
    /* Adjust for badges/text in dark mode */
    --secondary-color: #cbd5e1;

    --border-color: #334155;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

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

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

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

ul {
    list-style: none;
}

/* Container Utility */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Button Component */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(6, 182, 212, 0.4);
}

.btn-outline {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Section Styling */
.section {
    padding: var(--section-padding);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Navbar Styling */
.navbar {
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading-color);
}

.logo .highlight {
    color: var(--accent-color);
}

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

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* Hero Module */
.hero {
    min-height: calc(100vh - 80px);
    /* Adjust for navbar */
    display: flex;
    align-items: center;
    background: var(--hero-bg);
    overflow: hidden;
    position: relative;
    transition: background 0.3s ease;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-text .highlight {
    color: var(--accent-color);
}

.hero-text p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

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

.tech-orb {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), transparent 60%),
        radial-gradient(circle at 70% 70%, var(--secondary-color), transparent 60%);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    margin: 0 auto;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0);
    }
}

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

.about-image {
    position: relative;
    height: 400px;
}

.image-card {
    width: 100%;
    height: 100%;
    background-color: #cbd5e1;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.image-card::after {
    content: 'Team Photo Area';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--primary-color);
    color: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.experience-badge .years {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.experience-badge .text {
    font-size: 0.875rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Services Module */
.services {
    background-color: var(--bg-light);
}

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

.service-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    border-color: var(--accent-color);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

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

/* Portfolio Module */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.portfolio-img {
    width: 100%;
    height: 100%;
    background-color: #cbd5e1;
    transition: transform 0.5s ease;
    background-size: cover;
    background-position: center;
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h3 {
    color: #fff;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.portfolio-overlay p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.2s;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p,
.portfolio-item:hover .portfolio-overlay ul {
    transform: translateY(0);
}

.portfolio-overlay ul {
    text-align: left;
    margin-bottom: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.3s;
    font-size: 0.85rem;
    color: #cbd5e1;
    list-style-type: none;
    /* Custom bullets look better */
}

.portfolio-overlay ul li {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portfolio-overlay ul li::before {
    content: '✓';
    color: var(--accent-color);
    font-weight: bold;
}

/* Contact Module */
.contact {
    background: var(--bg-light);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    background: var(--bg-card);
    padding: 4rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.contact-info-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-info-item h4 {
    margin-bottom: 0.25rem;
}

.contact-info-item p {
    color: var(--text-muted);
}

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

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    transition: var(--transition);
    background-color: var(--bg-body);
    color: var(--text-main);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Footer Styling */
.footer {
    background-color: var(--primary-color);
    color: #fff;
    padding-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    max-width: 300px;
}

.social-links a {
    display: inline-flex;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    margin-right: 0.8rem;
    color: #fff;
}

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

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul li a {
    color: #94a3b8;
}

.footer-col ul li a:hover {
    color: #fff;
    padding-left: 5px;
}

.contact-list li {
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    padding: 1.5rem 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Animations Logic */
.fade-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.fade-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

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

    .contact-container {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

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

    .section-title h2 {
        font-size: 2rem;
    }

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

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        /* Smaller padding on mobile */
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-body);
        /* Adapt to theme */
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        text-align: center;
    }

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

    .nav-links li {
        width: 100%;
    }

    .nav-links .btn {
        width: 100%;
        display: block;
        margin-top: 1rem;
    }

    .hero {
        padding-top: 2rem;
        min-height: auto;
        padding-bottom: 4rem;
        text-align: center;
        /* Ensure center alignment */
    }

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

    .hero-text h1 {
        font-size: 1.75rem;
        /* Further reduced from 2rem */
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        /* Constrain width */
        margin: 0 auto;
        gap: 1rem;
    }

    .hero-btns .btn {
        width: 100%;
        text-align: center;
        margin: 0;
        /* Remove potential conflicting margins */
    }

    .tech-orb {
        width: 250px;
        height: 250px;
        margin: 2rem auto 0;
    }

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

    .section-title h2 {
        font-size: 1.75rem;
    }
}

/* Project Detail Redesign */
.project-header {
    margin-bottom: 3rem;
}

.project-category {
    display: inline-block;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.project-image-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: var(--card-shadow);
}

.project-description h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--heading-color);
}

.project-description p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Sidebar Styling */
.project-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.feature-list li i {
    color: var(--accent-color);
    margin-top: 4px;
}

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

.tech-tag {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

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

    .project-sidebar {
        position: static;
    }
}