/* ==========================================================================
   Voice-Over Portfolio - Main Stylesheet
   ==========================================================================
   
   Table of Contents:
   ------------------
   1. Component Imports (must be first!)
   2. CSS Variables (Design Tokens)
   3. Base Styles & Reset
   4. Typography
   5. Layout Utilities
   6. Buttons
   7. Loading States & Animations
   8. Grid Layouts
   9. Utility Classes
   
   ========================================================================== */

/* ==========================================================================
   1. Component Imports (MUST be at the top of the file)
   ==========================================================================
   Each component file handles styles for a specific UI section.
   Note: @import rules must precede all other CSS rules.
   ========================================================================== */

@import url('components/header.css');
@import url('components/footer.css');
@import url('components/hero.css');
@import url('components/featured-demo.css');
@import url('components/demo-card.css');
@import url('components/performance-card.css');
@import url('components/section-tabs.css');
@import url('components/about-section.css');
@import url('components/credits-section.css');
@import url('components/contact-form.css');
@import url('components/scroll-animations.css');
@import url('components/error-page.css');

/* ==========================================================================
   2. CSS Variables (Design Tokens)
   ==========================================================================
   Centralized design system values for consistent styling.
   Change these to update the entire site's appearance.
   ========================================================================== */

:root {
  /* --- Colors --- */
  /* Primary brand color (blue) - used for CTAs, links, accents */
  --color-primary: #3B82F6;
  --color-primary-hover: #2563eb;
  --color-primary-light: rgba(59, 130, 246, 0.18);
  
  /* Secondary brand color (purple) - used for gradients, accents */
  --color-secondary: #8B5CF6;
  --color-secondary-light: rgba(139, 92, 246, 0.18);
  
  /* Accent color (green) - used for success states */
  --color-accent: #10B981;
  
  /* Text colors */
  --color-text: #e8eaf0;
  --color-text-secondary: #b8bdcc;
  --color-text-muted: #8b91a5;
  --color-text-light: #6b7280;
  --color-text-placeholder: #4b5563;
  
  /* Background colors */
  --color-bg: #0f1117;
  --color-bg-white: #1a1d27;
  --color-bg-alt: #252836;
  
  /* Border colors */
  --color-border: #2d3148;
  --color-border-light: #1e2235;
  
  /* Status colors */
  --color-error: #dc2626;
  --color-error-light: #fee2e2;
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;

  /* --- Typography --- */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --line-height-base: 1.6;
  --line-height-tight: 1.2;
  --line-height-relaxed: 1.75;
  
  /* --- Spacing --- */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 5rem;     /* 80px */
  
  /* --- Border Radius --- */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-full: 9999px;   /* Pill shape */
  
  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
  
  /* --- Transitions --- */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-slower: 0.4s ease;
  
  /* --- Layout --- */
  --container-max-width: 1280px;
  --header-height: 80px;
  --header-height-shrunk: 60px;
  
  /* --- Demo Card Sizing --- */
  --demo-card-width: 250px;
  --demo-card-expanded-max-width: 500px;
  --demo-card-gap: 1rem;
  --demo-card-padding: 1.5rem;
  --demo-thumbnail-size: 8rem;
  
  /* --- Z-Index Layers --- */
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-tooltip: 60;
}

/* ==========================================================================
   3. Base Styles & Reset
   ==========================================================================
   Normalize and establish baseline styles across browsers.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* ==========================================================================
   4. Typography & Sections
   ========================================================================== */

/* Container - centers content with max-width */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Section Base Styles */
section {
  scroll-margin-top: 100px;
  padding: var(--spacing-3xl) 0;
}

@media (max-width: 768px) {
  section {
    scroll-margin-top: 80px;
  }
}

/* Section Titles */
section h2 {
  font-size: 1.875rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: var(--spacing-2xl);
  color: var(--color-text);
}

@media (min-width: 768px) {
  section h2 {
    font-size: 2.25rem;
  }
}

/* Alternating Section Backgrounds */
section:nth-child(odd) {
  background-color: var(--color-bg-white);
}

section:nth-child(even) {
  background-color: var(--color-bg);
}

/* ==========================================================================
   5. Buttons
   ==========================================================================
   Shared button styles for consistent interaction design.
   ========================================================================== */

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button */
.btn-primary {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  box-shadow: var(--shadow-lg);
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

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

/* Button Icons */
.btn svg,
.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* ==========================================================================
   6. Loading States & Animations
   ==========================================================================
   Shared loading indicators and keyframe animations.
   ========================================================================== */

/* Keyframe Animations (defined once, used across components) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Spinner - Large (for containers) */
.spinner {
  border: 3px solid var(--color-bg-alt);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Loading Spinner - Medium (for inline/buttons) */
.loading-spinner,
.loading-spinner-btn {
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
}

/* Loading Progress Bar */
.loading-bar {
  width: 100%;
  max-width: 200px;
  height: 4px;
  background-color: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background-color: var(--color-primary);
  transition: width var(--transition-slow);
}

/* Loading Text */
.loading-text {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* Fade-in Animation Class */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ==========================================================================
   7. Grid Layouts
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

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

@media (min-width: 640px) {
  .grid-cols-sm-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-cols-lg-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .grid-cols-xl-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Demos Section Layout - Featured + Grid Side by Side */
.demos-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-2xl);
}

@media (min-width: 1024px) {
  .demos-layout {
    grid-template-columns: 40% 60%;
    gap: var(--spacing-xl);
    align-items: start;
  }
}

/* Featured Demo Column - Sticky on Desktop */
.demos-featured-column {
  position: sticky;
  top: 100px;
}

@media (max-width: 1023px) {
  .demos-featured-column {
    position: static;
  }
}

/* Demos Grid Column */
.demos-grid-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Demos Grid - Flexbox for centered incomplete rows */
.demos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--demo-card-gap);
  justify-content: center;
  align-items: stretch;
}

.demos-grid > * {
  flex: 0 0 var(--demo-card-width);
}

/* ==========================================================================
   8. Utility Classes
   ========================================================================== */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   9. Tailwind Replacement Utilities
   ==========================================================================
   These utility classes replace the Tailwind CDN dependency.
   Keeps the codebase lightweight while maintaining utility-first patterns.
   ========================================================================== */

/* --- Flexbox --- */
.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-items-center {
  justify-items: center;
}

/* --- Spacing --- */
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-20 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.pt-24 {
  padding-top: 6rem;
}

.mb-16 {
  margin-bottom: 4rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* --- Typography --- */
.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.text-4xl {
  font-size: 2.25rem;
  line-height: 2.5rem;
}

.font-bold {
  font-weight: 700;
}

/* --- Colors --- */
.text-gray-500 {
  color: var(--color-text-muted);
}

.text-gray-700 {
  color: var(--color-text-secondary);
}

.text-gray-900 {
  color: var(--color-text);
}

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

.bg-gray-50 {
  background-color: var(--color-bg);
}

.bg-white {
  background-color: var(--color-bg-white);
}

/* --- Sizing --- */
.w-5 {
  width: 1.25rem;
}

.h-5 {
  height: 1.25rem;
}

.w-6 {
  width: 1.5rem;
}

.h-6 {
  height: 1.5rem;
}

/* --- Grid --- */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* --- Responsive Breakpoints --- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .md\:text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  
  .md\:py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

