/* Main Styles for BespokeWorks.ai */

/* Font Optimization - Critical for Core Web Vitals */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var.woff2') format('woff2-variations'),
       url('/fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Backup system fonts for instant render */
@font-face {
  font-family: 'SystemFont';
  src: local('system-ui'), local('-apple-system'), local('BlinkMacSystemFont'), local('Segoe UI');
  font-display: block;
}

/* Base Reset and Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px; /* REQUIRED: Minimum 16px for mobile */
}

body {
  font-family: 'Inter', 'SystemFont', 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #e2e8f0;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent layout shifts during font loading */
  font-size: 16px;
  font-weight: 400;
}

/* Critical performance optimizations */
* {
  /* Reduce repaints and improve compositing */
  will-change: auto;
}

/* Optimize images for loading performance */
img {
  max-width: 100%;
  height: auto;
  loading: lazy;
  decoding: async;
}

/* Ensure above-the-fold images load immediately */
.hero img,
.critical img,
[data-critical] img {
  loading: eager !important;
}

/* Core Web Vitals: Prevent Cumulative Layout Shift */
.aspect-ratio-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-ratio-container img,
.aspect-ratio-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Prevent CLS from font loading */
.font-loading * {
  visibility: hidden;
}

/* Typography */
.heading {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.brand-gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.body-text {
  font-size: 1.125rem;
  line-height: 1.7;
}

/* Layout */
.max-w-4xl {
  max-width: 56rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

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

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

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

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

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

.mb-8 {
  margin-bottom: 2rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

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

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

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

/* Cards and Sections */
.section-card {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Grid System */
.grid {
  display: grid;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

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

@media (min-width: 1024px) {
  .lg\:px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

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

.flex-wrap {
  flex-wrap: wrap;
}

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

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

/* Spacing */
.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.space-y-1 > * + * {
  margin-top: 0.25rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

/* Colors */
.text-white {
  color: #ffffff;
}

.text-gray-300 {
  color: #d1d5db;
}

.text-gray-400 {
  color: #9ca3af;
}

.text-blue-400 {
  color: #60a5fa;
}

.text-purple-400 {
  color: #c084fc;
}

.text-green-400 {
  color: #4ade80;
}

.text-blue-300 {
  color: #93c5fd;
}

/* Background Colors */
.bg-blue-500\/10 {
  background-color: rgba(59, 130, 246, 0.1);
}

.bg-green-500\/10 {
  background-color: rgba(34, 197, 94, 0.1);
}

.bg-purple-500\/10 {
  background-color: rgba(168, 85, 247, 0.1);
}

/* Borders */
.border {
  border-width: 1px;
}

.border-blue-500\/20 {
  border-color: rgba(59, 130, 246, 0.2);
}

.border-green-500\/20 {
  border-color: rgba(34, 197, 94, 0.2);
}

.border-purple-500\/20 {
  border-color: rgba(168, 85, 247, 0.2);
}

.rounded-lg {
  border-radius: 0.5rem;
}

/* Padding */
.p-8 {
  padding: 2rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-4 {
  padding: 1rem;
}

/* Lists */
.list-disc {
  list-style-type: disc;
}

.list-inside {
  list-style-position: inside;
}

.ml-4 {
  margin-left: 1rem;
}

/* Font Weights */
.font-bold {
  font-weight: 700;
}

/* Font Sizes */
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Links */
a {
  transition: color 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

/* Positioning */
.relative {
  position: relative;
}

.z-10 {
  z-index: 10;
}

.overflow-hidden {
  overflow: hidden;
}

/* Prose Styles */
.prose {
  max-width: none;
}

.prose h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose h4 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1rem;
}

.prose ul {
  margin-bottom: 1rem;
}

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

/* Responsive */
@media (max-width: 768px) {
  .heading {
    font-size: 2.5rem;
  }
  
  .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .py-20 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .p-8 {
    padding: 1.5rem;
  }
}