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

:root {
    --primary: #00f2ff;
    --secondary: #7000ff;
    --accent: #ff00e5;
    
    /* Layout Dimensions */
    --header-height: 5rem;
    --footer-height: 4rem;
    --content-height: calc(100vh - var(--header-height) - var(--footer-height));
    
    /* Light Mode Defaults */
    --bg-color: #f8f9fa;
    --text-color: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --selection-bg: rgba(0, 242, 255, 0.3);
    --glow-opacity: 0.08;
    --text-muted: rgba(0, 0, 0, 0.6);
    --text-subtle: rgba(0, 0, 0, 0.4);
}

.dark {
    --bg-color: #050505;
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 15, 15, 0.7);
    --selection-bg: rgba(0, 242, 255, 0.3);
    --glow-opacity: 0.15;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-subtle: rgba(255, 255, 255, 0.4);
}

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

/* Custom Cursor - Only on devices with hover capability */
@media (hover: hover) and (pointer: fine) {
    * {
        cursor: none !important;
    }
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    transition: background-color 0.5s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.5s ease, color 0.5s ease;
}

::selection {
    background-color: var(--selection-bg);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #222;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- Layout Structure --- */
.app-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Fixed Header Area */
.layout-header {
    position: relative;
    height: var(--header-height);
    flex-shrink: 0;
    z-index: 100;
    background: transparent;
    transition: all 0.5s ease;
}

.layout-header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Content Area */
.layout-content {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Fixed Footer Area */
.layout-footer {
    position: relative;
    height: var(--footer-height);
    flex-shrink: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    /* Ensure footer stays above content */
    background: var(--bg-color);
}

/* Ensure footer content doesn't overflow on mobile */
.layout-footer .container {
    width: 100%;
    max-width: 100%;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    .layout-footer {
        padding: 0.5rem;
        min-height: var(--footer-height);
    }
    
    .layout-footer .container {
        padding: 0 0.5rem;
    }
    
    /* Simplify footer on mobile */
    .layout-footer .flex-col {
        gap: 0.5rem;
    }
    
    /* Make footer pill smaller on mobile */
    .layout-footer .py-4 {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .layout-footer .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .layout-footer {
        min-height: auto;
        height: auto;
        padding: 0.5rem;
    }
    
    /* Hide some footer elements on very small screens */
    .layout-footer .hidden.md\\:flex {
        display: none !important;
    }
}

/* Mobile and Tablet Responsive Layout */
@media (max-width: 1024px) {
    :root {
        --header-height: 4.5rem;
        --footer-height: 3.5rem;
    }
    
    /* Allow app container to handle mobile browsers with dynamic viewport */
    .app-container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
    }
    
    /* Content area needs to accommodate dynamic content */
    .layout-content {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 4rem;
        --footer-height: 3rem;
    }
    
    /* Ensure proper mobile layout */
    .app-container {
        height: 100vh;
        height: 100dvh;
    }
    
    .layout-header {
        min-height: var(--header-height);
    }
    
    .layout-footer {
        min-height: var(--footer-height);
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 3.5rem;
        --footer-height: 2.5rem;
    }
}

/* --- Background Patterns --- */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    pointer-events: none;
    z-index: -2;
    opacity: var(--glow-opacity);
    transition: opacity 0.5s ease;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -200px;
    animation: float 20s infinite alternate;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -100px;
    right: -100px;
    animation: float 25s infinite alternate-reverse;
}

/* --- Typography --- */
.text-gradient {
    background: linear-gradient(to right, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--primary);
    display: inline-block;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 7rem);
    line-height: 0.95;
}

/* Mobile Hero Adjustments */
@media (max-width: 1024px) {
    .hero-title {
        font-size: clamp(2rem, 7vw, 5rem);
        line-height: 1;
    }
    
    .hero-visual {
        max-width: 100%;
        margin-top: 1.5rem;
    }
    
    .hero-visual .aspect-square {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(1.75rem, 6vw, 3rem);
        line-height: 1.05;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-btns {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .hero-btns button {
        width: 100%;
        text-align: center;
        padding: 0.875rem 1.5rem;
    }
    
    .hero-visual {
        display: none; /* Hide visual on mobile to save space */
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.5rem, 5.5vw, 2.5rem);
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
    }
}

.perspective-1000 {
    perspective: 1000px;
}

/* --- Components --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dark .glass-card {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.nav-link {
    position: relative;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Animations --- */
@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-20px) translateX(20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-gradient-shift {
    background-size: 200% auto;
    animation: gradient-shift 5s ease infinite;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--primary);
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 242, 255, 0.3);
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle .icon-sun {
    transform: scale(0) rotate(90deg);
    opacity: 0;
}

.theme-toggle .icon-moon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.dark .theme-toggle .icon-sun {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.dark .theme-toggle .icon-moon {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
}

/* --- Studio Card Hover Effects --- */
.studio-card {
    transition: box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.5s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform, opacity;
}

.studio-card:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.1);
}

.dark .studio-card:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), 0 18px 36px -18px rgba(0, 0, 0, 0.5);
}

/* Section Glows */
.section-glow-primary {
    background: radial-gradient(circle at 50% 50%, rgba(0, 242, 255, 0.03) 0%, transparent 70%);
}

.section-glow-secondary {
    background: radial-gradient(circle at 50% 50%, rgba(112, 0, 255, 0.03) 0%, transparent 70%);
}

.section-glow-accent {
    background: radial-gradient(circle at 50% 50%, rgba(255, 0, 229, 0.03) 0%, transparent 70%);
}

/* --- Ripple Cursor Styles --- */
/* Legacy cursor elements - hide them */
.cursor-dot,
.cursor-ring,
.cursor-spotlight {
    display: none !important;
}

/* Cursor Container */
.cursor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

/* Ripple Element */
.cursor-ripple {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform, opacity;
}

/* Primary Ripple Ring */
.cursor-ripple-ring {
    border: 1px solid currentColor;
    background: transparent;
    animation: ripple-expand 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Secondary Ripple Ring */
.cursor-ripple-ring-secondary {
    border: 1px solid currentColor;
    background: transparent;
    opacity: 0.5;
    animation: ripple-expand 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
}

/* Core Glow */
.cursor-core {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: currentColor;
    box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform 0.15s ease-out, opacity 0.3s ease;
}

/* Audio Wave Ripple */
.cursor-wave-ripple {
    border: 1.5px solid currentColor;
    background: transparent;
    animation: wave-ripple 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Click Burst Ripple */
.cursor-burst {
    border: 2px solid currentColor;
    background: radial-gradient(circle, currentColor 0%, transparent 70%);
    animation: burst-expand 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Ripple Animations */
@keyframes ripple-expand {
    0% {
        width: 20px;
        height: 20px;
        opacity: 0.8;
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
    }
}

@keyframes wave-ripple {
    0% {
        width: 30px;
        height: 30px;
        opacity: 0.6;
        border-width: 2px;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
        border-width: 0.5px;
    }
}

@keyframes burst-expand {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
    }
    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}

/* Canvas for particles */
.cursor-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
}

/* Interactive element hover state */
.cursor-hover-active .cursor-core {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.8;
}

/* Audio playing state */
.cursor-audio-active .cursor-core {
    animation: core-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes core-pulse {
    from {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
    }
    to {
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
    }
}

/* Hero Section Theme Adaptations */
.hero-subtitle {
    color: var(--text-muted);
}

/* Button Theme Adaptations */
.btn-primary {
    background-color: var(--primary);
    color: #000;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(0, 242, 255, 0.4);
}

.btn-secondary {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Card Theme Adaptations */
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(0, 242, 255, 0.1);
}

/* Text Muted */
.text-muted {
    color: var(--text-muted);
}

.text-subtle {
    color: var(--text-subtle);
}

/* Form Elements Theme */
input, textarea, select {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-subtle);
}

/* Spectrum Bars Theme */
.spectrum-bar {
    background: linear-gradient(to top, var(--primary), var(--secondary));
}

/* Progress Bar Theme */
.progress-bar {
    background-color: var(--border-color);
}

.progress-bar-fill {
    background-color: var(--primary);
}

/* Mobile Menu Theme */
.mobile-menu {
    background-color: var(--bg-color);
    border-bottom-color: var(--border-color);
}

/* Waveform Overrides */
.waveform-container {
    background: var(--card-bg) !important;
}

/* Loading States */
.loading-spinner {
    border-color: var(--border-color);
    border-top-color: var(--primary);
}

/* Smooth theme transition for all elements */
*, *::before, *::after {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.3s;
}

/* Disable transition for specific elements that need instant updates */
.no-transition {
    transition: none !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    :root {
        --header-height: 4rem;
        --footer-height: 3.5rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
    
    /* Hide cursor effects on mobile */
    .cursor-container,
    .cursor-canvas {
        display: none !important;
    }
    
    /* Restore default cursor on mobile */
    * {
        cursor: auto !important;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 3.5rem;
        --footer-height: 3rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cursor-container,
    .cursor-canvas {
        display: none !important;
    }
    
    * {
        cursor: auto !important;
    }
}

/* --- Mobile Content Visibility Fixes --- */
/* Ensure content is never cut off on small screens */
@media (max-width: 1024px) {
    /* Force content to be visible and scrollable */
    .stacked-section-content {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ensure vertical center doesn't cut off content */
    .section-vertical-center {
        min-height: 100%;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
    
    /* Hero section specific fixes */
    #hero .section-vertical-center {
        justify-content: flex-start;
        padding-top: 1.5rem;
    }
    
    /* Ensure containers have proper padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    /* Mobile-specific content adjustments */
    .section-vertical-center {
        justify-content: flex-start;
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }
    
    /* Hero adjustments for mobile */
    #hero .section-vertical-center {
        padding-top: 1rem;
    }
    
    /* Ensure hero content flows naturally */
    #hero .flex-col {
        gap: 1rem;
    }
    
    /* Adjust hero visual for mobile */
    .hero-visual {
        max-width: 100%;
        margin-top: 0.5rem !important;
    }
    
    .hero-visual .aspect-square {
        max-height: 250px;
    }
    
    /* Fix button container on mobile */
    .hero-btns {
        width: 100%;
        padding: 0 0.5rem;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 896px) and (orientation: landscape) {
    .section-vertical-center {
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    #hero .lg\\:w-3\\/5 {
        width: 100%;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .app-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .layout-header {
        padding-top: env(safe-area-inset-top);
    }
    
    .layout-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
