:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-purple: #9F2BFF;
    --accent-purple-dark: #581096;
    --accent-glow: rgba(159, 43, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(20, 20, 20, 0.4);
    
    --transition-speed: 0.6s;
    --transition-curve: cubic-bezier(0.77, 0, 0.175, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden; /* Important for single-page zoom effect without scrollbars during transition */
    min-height: 100vh;
}

/* Background Effects */
#noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    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");
    opacity: 0.03;
    pointer-events: none;
    z-index: 100;
}

.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 40vw; height: 40vw;
    background: var(--accent-purple-dark);
    top: -10vw; right: -10vw;
}

.blob-2 {
    width: 30vw; height: 30vw;
    background: #3a0ca3;
    bottom: -10vw; left: -10vw;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 50px) scale(1.1); }
}

/* Header & Nav */
header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(5,5,5,0.95) 0%, rgba(5,5,5,0) 100%);
    backdrop-filter: blur(5px);
}

.logo-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    pointer-events: auto;
}

.main-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
    transition: transform 0.3s ease;
}

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

nav {
    display: grid;
    grid-template-columns: repeat(5, 180px); /* Fixed equal widths for perfect symmetry */
    align-items: center;
    justify-items: center;
    justify-content: center; /* Center the whole grid */
    width: 100%;
    z-index: 50;
    position: relative;
    pointer-events: none;
}

nav > * {
    pointer-events: auto;
}

.nav-spacer {
    width: 100%;
    height: 1px; /* Purely for grid slotting */
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.05rem; /* Balanced size */
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    padding: 0.6rem 0;
    transition: color 0.3s ease;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

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

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

.nav-link.active:not(.btn-primary)::after {
    width: 100%;
}

/* App Container and Pages */
#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    perspective: 1200px;
}

.page {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 100px 5% 50px 5%;
    
    /* Routing Animation Initial State (Hidden) */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateZ(-100px);
    transition: opacity var(--transition-speed) var(--transition-curve),
                transform var(--transition-speed) var(--transition-curve),
                visibility 0s linear var(--transition-speed);
}

.page::-webkit-scrollbar {
    width: 8px;
}
.page::-webkit-scrollbar-track {
    background: transparent;
}
.page::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Active Page State */
.page.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateZ(0);
    transition: opacity var(--transition-speed) var(--transition-curve),
                transform var(--transition-speed) var(--transition-curve),
                visibility 0s linear 0s;
    z-index: 10;
}

/* Page Transition States */
.page.zoom-out {
    opacity: 0;
    transform: scale(1.1) translateZ(100px);
    z-index: 5;
}

.page.zoom-in-prepared {
    opacity: 0;
    transform: scale(0.9) translateZ(-100px);
}


/* Layout & Typography */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.highlight {
    color: var(--accent-purple);
    position: relative;
}

.section-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-align: center;
}

/* Hero Section */
.hero-section {
    align-items: center;
    text-align: center;
}

.hero-section h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 900px;
}

.hero-section .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

/* UI Elements */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--accent-purple);
    color: white;
    border: none;
    box-shadow: 0 0 20px rgba(159, 43, 255, 0.3);
}

.btn-primary:hover {
    background: #b14dff;
    box-shadow: 0 0 30px rgba(159, 43, 255, 0.6);
    transform: translateY(-2px) scale(1.05); /* Added scale zoom */
}

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

.btn-outline:hover {
    background: rgba(159, 43, 255, 0.1);
    transform: translateY(-2px) scale(1.05); /* Added scale zoom */
}

.cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Services Page */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(159, 43, 255, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(159, 43, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

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

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

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

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem 2rem;
    width: 100%;
}

.portfolio-item {
    cursor: pointer;
}

.folder-card {
    flex: 0 1 300px; /* Keep them neat and side-by-side, max 300px */
    width: 100%;
    transition: transform 0.3s ease;
}

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

.logo-wrapper {
    background: transparent !important;
    border: none !important; /* Remove box border */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.folder-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.folder-card:hover .folder-logo {
    transform: scale(1.1);
}

.image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
    background: #111;
    border: 1px solid var(--border-color);
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 9/16; /* Portrait ratio for TikTok/Reels */
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
    background: #000;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.folder-videos {
    justify-content: center; /* Relying on flex centering */
    display: flex; /* Make sure it's active so mobile overrides work cleanly */
    flex-wrap: wrap; /* Let videos wrap naturally if there's no space */
    gap: 3rem 2rem;
}

.folder-videos .portfolio-item {
    flex: 0 0 280px; /* Force exactly 280px width for all videos inside */
    width: 280px;
}

.abstract-placeholder, .portfolio-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.purple-grad { background: linear-gradient(135deg, #2a0845 0%, #6441A5 100%); }
.dark-grad { background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%); filter: hue-rotate(240deg); }
.neon-grad { background: linear-gradient(135deg, #1A2980 0%, #26D0CE 100%); filter: saturate(1.5) hue-rotate(45deg); }


.portfolio-item:hover .abstract-placeholder, .portfolio-item:hover .portfolio-video {
    transform: scale(1.05);
}

/* Gallery Controls */
.gallery-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.gallery-title {
    font-size: 2rem;
    margin-bottom: 0;
}

.contact-cta {
    text-align: center;
    margin-top: 5rem;
    padding: 3rem;
    background: linear-gradient(180deg, rgba(20,20,20,0) 0%, rgba(159,43,255,0.05) 100%);
    border-radius: 20px;
    border: 1px solid rgba(159,43,255,0.1);
}

.contact-cta .mt-4 {
    margin-top: 2.5rem; /* Pushed the button further down from the text */
}

/* Contact Page Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Responsive Design */

/* Large Screens & TVs */
@media (min-width: 1600px) {
    html { font-size: 18px; }
    .content-wrapper { max-width: 1400px; }
}

/* Tablets & Small Laptops */
@media (max-width: 1024px) {
    header { padding: 1.5rem 5%; }
    .main-logo { height: 100px; }
    .hero-section h1 { font-size: 4rem; }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .section-title { font-size: 2.5rem; }
    header { 
        padding: 1.2rem 1%; 
        background: linear-gradient(to bottom, rgba(5,5,5,0.98) 0%, rgba(5,5,5,0) 100%);
    }
    .main-logo { height: 50px; }
    nav { 
        grid-template-columns: repeat(5, 1fr);
        max-width: 100%;
    }
    .nav-spacer { min-width: 30px; }
    .nav-link { 
        font-size: 0.75rem; 
        min-width: auto;
        padding: 0.4rem 2px;
    }
    .nav-link.btn-primary { 
        padding: 0.4rem 0.5rem !important; 
        font-size: 0.7rem;
    }
    .page { padding-top: 110px; }
    
    .folder-videos {
        flex-direction: column;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    .portfolio-grid {
        justify-content: center;
    }
}

/* Very Small Phones */
@media (max-width: 480px) {
    .section-title { font-size: 2rem; }
    .hero-section h1 { font-size: 2.5rem; }
    header { padding: 0.8rem 0; }
    .main-logo { height: 40px; }
    .nav-link { font-size: 0.65rem; }
    .nav-link.btn-primary { font-size: 0.65rem; padding: 0.3rem 0.4rem !important; }
    .page { padding-top: 100px; }
}
