:root {
    /* Colors - Navis Light Theme */
    --color-bg: #FFFFFF;
    --color-surface: #F8F9FB;
    /* Very light gray/blue tint for sections */
    --color-text-main: #111827;
    /* Near Black */
    --color-text-muted: #6B7280;
    /* Cool Gray */
    --color-accent: #0066FF;
    /* Vivid Blue */
    --color-accent-hover: #0052CC;
    --color-border: #E5E7EB;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* UI Tokens */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 32px;
    --radius-pill: 50px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);

    /* Animation Tokens */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --anim-duration: 0.9s;
    --anim-delay-base: 0.1s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-sm);
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-lg);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* Icons */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

.bg-surface {
    background-color: var(--color-surface);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-accent {
    color: var(--color-accent);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent);
}

/* Buttons - Simplified & Clear */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-heading);
    cursor: pointer;
    gap: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    border-color: var(--color-text-main);
    background-color: transparent;
}

.btn-small {
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
}

/* Navbar - Floating Pill Style */
.navbar {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 2rem;
    left: 0;
    right: 0;
    z-index: 1000;
    border-radius: var(--radius-pill);
    /* Stronger shadow for better lift */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    /* Subtle light gray border for distinct edge */
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* 
 * Mobile CTA (Hidden on desktop, visible on mobile)
 * Integrated into the list for cleaner mobile layout
 */
.mobile-cta {
    display: none;
    margin-top: 1rem;
    width: 100%;
}

.mobile-cta .btn {
    width: 100%;
    justify-content: center;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: var(--spacing-xl) 0 var(--spacing-md) 0;
    /* Increased top padding */
    overflow: hidden;
    margin-top: 2rem;
    /* Extra space for the fixed nav */
}

.hero-grid {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.hero-text {
    flex: 1;
}

.hero-title {
    font-size: 5rem;
    /* Increased size */
    font-weight: 800;
    /* Extra bold */
    margin-bottom: var(--spacing-sm);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    max-width: 520px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;

    /* Animation: Liquid Shape */
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: liquid-shape 10s ease-in-out infinite;
    will-change: border-radius;
}

@keyframes liquid-shape {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    33% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    66% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }

    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

/* Stats Row */
.stats-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-lg) 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Services Grid (Bento Style) - Replaces List */
.services-grid-home {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-card {
    background-color: var(--color-surface);
    padding: 3rem;
    border-radius: 32px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    /* Important for <a> wrapper */
    color: inherit;
}

.grid-card:hover {
    background-color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
    border-color: var(--color-surface);
}

.grid-card .icon-wrapper {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    color: var(--color-accent);
    transition: background 0.3s ease, color 0.3s ease;
}

.grid-card:hover .icon-wrapper {
    background: var(--color-accent);
    color: white;
}

.grid-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.grid-card p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.grid-card .arrow-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-top: 2rem;
    color: var(--color-accent);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.grid-card:hover .arrow-link {
    opacity: 1;
    transform: translateX(0);
}

/* Response Home Grid */
@media (max-width: 900px) {
    .services-grid-home {
        grid-template-columns: 1fr;
    }
}

/* Portfolio Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.project-card {
    border-radius: var(--radius-lg);
    background: white;
    overflow: hidden;
}

.project-img-wrapper {
    height: 300px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: var(--radius-lg);
}

.project-card:hover .project-img-wrapper img {
    transform: scale(1.05);
}

/* Footer */
.footer {
    padding: var(--spacing-xl) 0 var(--spacing-lg) 0;
    border-top: 1px solid var(--color-border);
}

/* Responsive */

/* 
   ---------------------------
   Premium Scroll Animations 
   ---------------------------
*/

/* Base reveal state */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    filter: blur(4px);
    will-change: opacity, transform, filter;
    transition:
        opacity var(--anim-duration) var(--ease-out-expo),
        transform var(--anim-duration) var(--ease-out-expo),
        filter var(--anim-duration) var(--ease-out-expo);
}

/* Active state (triggered by JS) */
.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Staggered Animations for Groups */
.reveal-group>* {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(2px);
    transition:
        opacity 0.8s var(--ease-out-quart),
        transform 0.8s var(--ease-out-quart),
        filter 0.8s var(--ease-out-quart);
}

.reveal-group.active>* {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Stagger delays (up to 10 items) */
.reveal-group.active>*:nth-child(1) {
    transition-delay: calc(var(--anim-delay-base) * 1);
}

.reveal-group.active>*:nth-child(2) {
    transition-delay: calc(var(--anim-delay-base) * 2);
}

.reveal-group.active>*:nth-child(3) {
    transition-delay: calc(var(--anim-delay-base) * 3);
}

.reveal-group.active>*:nth-child(4) {
    transition-delay: calc(var(--anim-delay-base) * 4);
}

.reveal-group.active>*:nth-child(5) {
    transition-delay: calc(var(--anim-delay-base) * 5);
}

.reveal-group.active>*:nth-child(6) {
    transition-delay: calc(var(--anim-delay-base) * 6);
}

.reveal-group.active>*:nth-child(7) {
    transition-delay: calc(var(--anim-delay-base) * 7);
}

.reveal-group.active>*:nth-child(8) {
    transition-delay: calc(var(--anim-delay-base) * 8);
}

.reveal-group.active>*:nth-child(9) {
    transition-delay: calc(var(--anim-delay-base) * 9);
}

.reveal-group.active>*:nth-child(10) {
    transition-delay: calc(var(--anim-delay-base) * 10);
}

/* 
   ---------------------------
   Responsive Design System
   ---------------------------
*/

/* Tablet Breakpoint (max-width: 1024px) */
/* Tablet Breakpoint (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        width: 85%;
        /* Slightly more buffer on sides */
    }

    /* Navbar Adjustments - Fixed Spacing from Edges */
    .navbar {
        width: auto;
        left: 1rem;
        right: 1rem;
        margin: 0;
        padding: 1.5rem 1.5rem;
        /* Equal vertical and horizontal padding */
        max-width: none;
    }

    .nav-container {
        width: 100% !important;
        /* Force fill to respect navbar padding */
    }

    /* Navigation: Activate Hamburger */
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 15px);
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        padding: 3rem 2rem;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        border-radius: 24px;
        backdrop-filter: blur(15px);
        gap: 1.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .nav-links a {
        font-size: 1.4rem;
        /* Larger font size */
        font-weight: 600;
        display: block;
        padding: 0.5rem 0;
    }

    /* Fix for mobile button color & spacing */
    .nav-links .btn {
        width: 100%;
        margin-top: 1rem;
        color: white !important;
        /* Force white text */
    }

    .nav-links .btn:hover {
        color: white !important;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 4.5rem;
        /* Much larger icon */
        cursor: pointer;
        color: var(--color-text-main);
        line-height: 1;
        transition: color 0.3s ease;
        padding: 0.3rem;
        /* Add some padding around the icon */
        margin: -0.3rem;
        /* Negative margin to compensate for padding */
    }

    .menu-toggle:hover {
        color: var(--color-accent);
    }

    /* Hide Desktop CTA button */
    .nav-actions {
        display: none;
    }

    /* Show Mobile CTA in menu */
    .mobile-cta {
        display: block;
    }

    /* Hero Spacing Fix */
    .hero {
        padding-top: 12rem;
        /* Much more breathing room */
        padding-bottom: var(--spacing-lg);
        text-align: center;
    }

    .hero-grid {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .hero-text {
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-title {
        font-size: 4rem;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-image img {
        max-height: 400px;
    }

    /* Stats: wrap to 2x2 */
    .stats-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 3rem;
    }

    .stat-item {
        flex: 1 1 40%;
    }

    /* Grids: Explicitly 2 columns for tablet */
    .projects-grid,
    .services-grid-home {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile Breakpoint (max-width: 768px) */
@media (max-width: 768px) {

    /* Typography Scaling */
    .hero-title {
        font-size: 2.8rem;
    }

    /* Force 1 Column on all grids */
    .projects-grid,
    .services-grid-home,
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Stack Stats */
    .stats-row {
        flex-direction: column;
        gap: 2rem;
    }

    .stat-item {
        flex: 1 1 100%;
    }

    /* Adjust Padding */
    .section-padding {
        padding: 4rem 0;
    }

    .navbar {
        padding: 0.8rem 1.2rem;
        top: 1rem;
        width: 92%;
    }

    /* Mobile Menu Adjustments */
    .nav-links {
        width: 92%;
        left: 4%;
        /* Center aligned relative to screen */
    }

    /* Footer Stacking */
    .footer .container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer .logo {
        justify-content: center;
    }

    .footer div[style*="max-width: 300px"] {
        max-width: 100% !important;
    }

    .footer ul {
        align-items: center;
    }
}