/* =========================================
   DESIGN SYSTEM & VARIABLES
========================================= */
:root {
    /* Color Palette */
    --bg-main: #0a0a0c;
    --bg-secondary: #131316;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;

    /* Vibrant Accents */
    --accent-primary: #8b5cf6;
    --accent-secondary: #3b82f6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 8rem;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   RESET & BASE STYLES
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor */
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================
   CUSTOM CURSOR (Interaction & Polish)
========================================= */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    transition: width var(--transition-fast), height var(--transition-fast), background-color var(--transition-fast);
}

.cursor-hover .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-primary);
}

/* =========================================
   BACKGROUND EFFECTS
========================================= */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.gradient-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.1), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.05), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* =========================================
   LAYOUT & COMPONENTS
========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 100px;
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-main);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* =========================================
   NAVIGATION
========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-md) 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    background: var(--glass-bg);
    padding: 0.5rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

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

/* =========================================
   HERO SECTION
========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--space-xl);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-text-wrapper {
    max-width: 800px;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: var(--space-sm);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
}

.hero-description {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: var(--space-lg);
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
}

/* =========================================
   ANIMATIONS (Intersection Observer)
========================================= */
.reveal {
    opacity: 0;
    transition: all var(--transition-slow);
}

.reveal.active {
    opacity: 1;
}

.fade-up {
    transform: translateY(40px);
}

.fade-up.active {
    transform: translateY(0);
}

/* =========================================
   MEDIA QUERIES
========================================= */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Mobile menu implementation later if needed */
    }

    .hero-cta {
        flex-direction: column;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
        /* Disable custom cursor on touch devices */
    }

    * {
        cursor: auto !important;
    }

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

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

/* =========================================
   CASE STUDIES SECTION
========================================= */
.work {
    padding: var(--space-2xl) 0;
}

.section-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: var(--glass-blur);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(139, 92, 246, 0.3);
    /* Subtle purple glow on hover */
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-image {
    transform: scale(1.05);
    /* Slight zoom on hover */
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 12, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-content {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-primary);
    border-radius: 100px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.project-tag:nth-child(2) {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-secondary);
    border-color: rgba(59, 130, 246, 0.2);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.project-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* =========================================
   ABOUT SECTION
========================================= */
.about {
    padding: var(--space-2xl) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
}

.about-visual {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.1));
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-visual::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.abstract-shape {
    width: 60%;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    filter: blur(20px);
    opacity: 0.6;
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {

    0%,
    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }
}

/* =========================================
   FOOTER / CONTACT
========================================= */
.contact {
    padding: var(--space-2xl) 0 var(--space-lg);
    text-align: center;
}

.contact-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--space-md);
}

.contact-text {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto var(--space-lg);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.social-icon:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: var(--space-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   CASE STUDY DETAIL PAGES
========================================= */

/* Hero Image Specific */
.cs-hero {
    padding-top: calc(var(--space-2xl) + 60px);
    padding-bottom: var(--space-xl);
    text-align: center;
}

.cs-hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: var(--space-md);
    line-height: 1.1;
}

.cs-meta {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    color: var(--text-muted);
}

.cs-meta-item {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.cs-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.cs-meta-value {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

.cs-hero-image-wrapper {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: var(--space-2xl);
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.cs-hero-image-wrapper img {
    width: 100%;
    display: block;
    height: auto;
}

/* Prose Typography Layout */
.prose {
    max-width: 800px;
    margin: 0 auto;
}

.prose h2 {
    font-size: 2rem;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
    color: var(--text-main);
}

.prose h3 {
    font-size: 1.5rem;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

.prose p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.prose ul,
.prose ol {
    margin-bottom: var(--space-md);
    padding-left: 1.5rem;
    color: var(--text-muted);
    font-size: 1.125rem;
    line-height: 1.8;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose strong {
    color: var(--text-main);
}

/* Specific UI Elements within Prose */
.cs-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.cs-metric-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: var(--space-lg);
    border-radius: 16px;
    text-align: center;
    backdrop-filter: var(--glass-blur);
}

.cs-metric-card h4 {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cs-metric-card p {
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: 500;
}

.cs-callout {
    background: rgba(139, 92, 246, 0.05);
    border-left: 4px solid var(--accent-primary);
    padding: var(--space-lg);
    border-radius: 0 16px 16px 0;
    margin: var(--space-xl) 0;
}

.cs-callout p {
    margin-bottom: 0;
    font-style: italic;
    color: var(--text-main);
}

.cs-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.cs-inline-image {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.cs-full-width-image {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: var(--bg-secondary);
    padding: var(--space-xl) 0;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.cs-full-width-image img {
    max-width: 1200px;
    width: 90%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.next-project {
    text-align: center;
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--glass-border);
    margin-top: var(--space-2xl);
}