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

:root {
    --bg-color: #000000;
    --fg-color: #ffffff;
    --muted: #666666;
    --accent: #222222;
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% 50%, #0c0c0c 0%, #000000 100%);
    background-attachment: fixed;
    color: var(--fg-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Typography */
h1 {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

h3 {
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: 700;
}

p {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    color: var(--muted);
    font-weight: 300;
}

.label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Layout Grid / Section */
section {
    padding: 5rem 5vw;
    width: 100%;
    position: relative;
}

@media (min-width: 1024px) {
    section {
        padding: 6rem 10vw;
    }
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

@media (min-width: 1024px) {
    nav {
        padding: 2rem 10vw;
    }
}

.logo {
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    color: var(--fg-color);
    display: inline-block;
}

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

.nav-links a {
    color: var(--fg-color);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: opacity var(--transition-fast), padding var(--transition-fast);
}

.nav-links a:hover, .nav-links a.active {
    opacity: 1;
}

.nav-links a.active {
    border-bottom: 2px solid var(--fg-color);
    padding-bottom: 4px;
}

.menu-btn {
    display: none;
}

@media(max-width: 768px) {
    .nav-links {
        display: none;
    }

    .menu-btn {
        display: block;
        color: var(--fg-color);
        background: none;
        border: none;
        padding: 0;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        cursor: pointer;
    }

    nav {
        padding: 1.5rem 5vw;
    }

    .logo {
        font-size: 1rem;
    }
}

/* Mobile Menu */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    z-index: 99;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    transition: transform var(--transition-slow);
}

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

.mobile-nav a {
    font-size: 2rem;
    color: var(--fg-color);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
}

/* Hero */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-image: radial-gradient(circle at 50% 0%, #151515 0%, transparent 70%);
}

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

.hero-content {
    position: relative;
    z-index: 1;
    mix-blend-mode: difference;
}

.hero-subtitle {
    margin-top: 1.5rem;
    color: white;
}

/* Stats / Trust Signals */
.stats-section {
    padding-top: 0;
    padding-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    padding: 3rem 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .stat-item {
        text-align: left;
    }
}

.stat-number {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* Featured Projects */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.view-all {
    color: var(--fg-color);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--fg-color);
    padding-bottom: 0.2rem;
    transition: opacity var(--transition-fast);
}

.view-all:hover {
    opacity: 0.5;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

.project-wrap {
    display: block;
    position: relative;
    cursor: pointer;
    z-index: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.project-wrap:hover, .project-wrap.touch-active {
    z-index: 100;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.project-base {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    /* Under the overlay */
}

@media(min-width: 768px) {
    .project-base {
        grid-template-columns: 1fr 1fr;
        /* Cut image size in half */
        align-items: center;
        /* Center the pitch alongside the image */
        gap: 2.5rem;
    }
}

.project-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--accent);
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.project-wrap:hover .project-thumbnail img, .project-wrap.touch-active .project-thumbnail img {
    transform: scale(1.03);
}

.project-meta-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meta-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-header .p-domain {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.meta-header h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--fg-color);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.pitch-desc {
    font-size: 1rem;
    color: #a0a0a0;
    line-height: 1.6;
}

.pitch-meta {
    margin-top: 0.5rem;
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg-color);
}

.pitch-meta strong {
    color: var(--muted);
    margin-right: 0.25rem;
}

/* Hover Expanded Overlay */
.project-expanded-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 110%;
    min-width: 320px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Ignore mouse until fully visible */

    /* 100ms transition delay on opening to prevent flickering */
    transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s, visibility 0s linear 0.1s;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.project-wrap:hover .project-expanded-overlay, .project-wrap.touch-active .project-expanded-overlay {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;

    /* Faster delay on opening */
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, visibility 0s linear 0.1s;
}

/* Close exactly when hover stops with no delay */
.project-wrap:not(:hover):not(.touch-active) .project-expanded-overlay {
    transition: opacity 0.15s ease 0s, transform 0.15s ease 0s, visibility 0s linear 0.15s;
}

.expanded-content {
    display: flex;
    flex-direction: column;
}

.expanded-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.expanded-details {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expanded-details .p-domain {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.expanded-details .p-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--fg-color);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.expanded-details .p-desc {
    font-size: 1.05rem;
    color: #a0a0a0;
    line-height: 1.6;
}

.expanded-details .tech-stack-wrap {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.expanded-details .tech-stack-wrap span {
    color: var(--fg-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.5rem;
}

.view-btn {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--fg-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.5rem;
    width: fit-content;
    transition: gap var(--transition-fast);
}

.project-expanded-overlay:hover .view-btn {
    gap: 1rem;
    border-bottom-color: var(--fg-color);
}

/* Grid specific to projects.html */
.page-hero {
    min-height: 50vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 4rem;
}

.all-projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media(min-width: 768px) {
    .all-projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4rem;
    }
}

@media(min-width: 1200px) {
    .all-projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media(min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4rem;
    }
}

.service-card {
    border-top: 1px solid var(--accent);
    padding-top: 2rem;
}

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

/* Process / Timeline */
.process-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.process-step {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    border-top: 1px solid var(--accent);
    padding-top: 2.5rem;
}

@media(min-width: 768px) {
    .process-step {
        grid-template-columns: 100px 1fr;
        gap: 4rem;
    }
}

.step-number {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--muted);
}

.step-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

/* About */
.about-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media(min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
    }
}

.about-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--fg-color);
    margin-top: 1rem;
}

.about-lead {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    color: var(--fg-color);
    line-height: 1.4;
    margin-bottom: 2rem;
    font-weight: 500;
}

.about-sub {
    font-size: 1.1rem;
    color: #a0a0a0;
    line-height: 1.6;
    max-width: 500px;
}

/* Marquee / Echo Chamber */
.marquee-section {
    padding: 4rem 0;
    background: var(--fg-color);
    color: var(--bg-color);
    overflow: hidden;
}

.marquee-container {
    display: flex;
    white-space: nowrap;
    position: relative;
    width: 100vw;
}

.marquee-content {
    display: flex;
    animation: marquee 25s linear infinite;
}

.marquee-item {
    font-size: clamp(2rem, 5vw, 5rem);
    font-weight: 900;
    text-transform: uppercase;
    padding: 0 4rem;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- THE CTA SECTION --- */
.cta-section {
    position: relative;
    width: 100%;
    padding: 10rem 5vw;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: radial-gradient(circle at 50% 50%, #0a0a0a 0%, #000000 80%);
    overflow: hidden;
}

/* Subtle background grid to match the tech theme */
.cta-grid {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
}

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

.cta-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cta-label::before, .cta-label::after {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: var(--muted);
}

.cta-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: transparent;
    -webkit-text-stroke: 1px var(--fg-color);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

/* Fills in with solid white when hovering over the section */
.cta-section:hover .cta-title {
    color: var(--fg-color);
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

.cta-subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto 4rem auto;
    line-height: 1.6;
}

/* --- THE MAGNETIC BUTTON --- */
.btn-wrapper {
    display: inline-block;
    padding: 2rem; /* Creates a large invisible hit area for the magnetic effect */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.magnetic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 3rem;
    background: transparent;
    color: var(--fg-color);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    text-decoration: none;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    /* Will-change optimizes the continuous transform animations */
    will-change: transform; 
}

.magnetic-btn::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--fg-color);
    border-radius: 50%;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

.btn-wrapper:hover .magnetic-btn {
    border-color: var(--fg-color);
    color: var(--bg-color);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

.btn-wrapper:hover .magnetic-btn::before {
    transform: translateY(-100%) scale(2);
    border-radius: 0;
}

/* Status indicator blinking dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00ff66;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 10px #00ff66;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

/* Navbar Minimal Contact Link */
.nav-contact-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fg-color) !important;
    font-weight: 600;
}

.status-dot-small {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00ff66;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff66;
    animation: pulse 2s infinite;
}

/* Footer */
footer {
    padding: 4rem 5vw;
    border-top: 1px solid var(--accent);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 1024px) {
    footer {
        padding: 4rem 10vw;
    }
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--fg-color);
}

@media (max-width: 768px) {
    section {
        padding: 3.5rem 5vw;
    }

    h1 {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    h2 {
        font-size: clamp(2rem, 10vw, 3rem);
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-top: 1rem;
    }

    .stats-grid {
        padding: 2rem 0;
        gap: 1.5rem;
    }

    .projects-header {
        margin-bottom: 2.5rem;
    }

    .services-grid, .process-list {
        gap: 2rem;
    }

    .marquee-section {
        padding: 2.5rem 0;
    }

    .marquee-item {
        padding: 0 1.5rem;
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .cta-section {
        padding: 5rem 5vw;
    }

    .cta-title {
        margin-bottom: 2rem;
    }

    footer {
        padding: 3rem 5vw;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-links {
        justify-content: center;
    }
    
    /* Disable hover popups and scale animations on mobile */
    .project-expanded-overlay {
        display: none !important;
    }
    
    .project-wrap:hover, .project-wrap.touch-active {
        z-index: 1;
    }
    
    .project-wrap:hover .project-thumbnail img, .project-wrap.touch-active .project-thumbnail img {
        transform: scale(1);
    }
}