/* PixelMarket Design System
   Modern Bento & Card-Based Creator Economy UI
   Custom Vanilla CSS - Light Theme Native, Premium Luxury Finish
*/

:root {
  /* Color Palette - Vibrant Indigo & Radiant Violet Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-active: #3730a3;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.22);

  --secondary: #0284c7;
  --secondary-hover: #0369a1;
  --secondary-light: #f0f9ff;

  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: #f5f3ff;

  /* Marketplace Engine Signifiers */
  --engine-service: #2563eb;
  --engine-service-light: #eff6ff;
  --engine-service-border: #bfdbfe;
  
  --engine-digital: #059669;
  --engine-digital-light: #ecfdf5;
  --engine-digital-border: #a7f3d0;
  
  --engine-phygital: #d97706;
  --engine-phygital-light: #fffbeb;
  --engine-phygital-border: #fde68a;

  /* Semantic State Colors */
  --success: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #d97706;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  
  --info: #0284c7;
  --info-light: #f0f9ff;
  --info-border: #bae6fd;

  /* Neutrals (Light Mode Native Default) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;

  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #4f46e5;
  --border-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Typography Stack - High-Performance Fallbacks & Optical Sizing */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: var(--font-display);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Multi-Stop Layered Ambient Shadows (High Polish Luxury) */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.12), 0 8px 20px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 24px rgba(79, 70, 229, 0.25);

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 260ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max: 1280px;
  --header-height: 74px;
  --mobile-nav-height: 64px;
}

/* Dark Mode Overrides (Optional User Toggle) */
[data-theme="dark"] {
  --bg-page: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-subtle: #1e293b;
  --bg-hover: #1e293b;

  --border: #2d3748;
  --border-hover: #4b5563;
  --border-focus: #818cf8;
  --border-subtle: #1f2937;

  --text-main: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary-light: rgba(99, 102, 241, 0.15);
  --secondary-light: rgba(14, 165, 233, 0.15);
  --engine-service-light: rgba(59, 130, 246, 0.15);
  --engine-digital-light: rgba(16, 185, 129, 0.15);
  --engine-phygital-light: rgba(245, 158, 11, 0.15);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px 0 rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px 0 rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px 0 rgba(0, 0, 0, 0.6);
}

/* Base Styles & Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Form Controls Typography Inheritance */
button, input, select, textarea, optgroup {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Tabular Numbers for Prices, Metrics, and Financial Columns */
.font-tabular,
.price-value,
.deck-card-price,
.mini-cart-item-price,
.mini-cart-total-val,
.matrix-pkg-price,
.stat-value,
.cart-summary-value,
.hero-trust-ticker strong,
.ticker-text strong {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.35rem; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: 1.85rem; letter-spacing: -0.02em; font-weight: 700; }
h3 { font-size: 1.45rem; letter-spacing: -0.015em; font-weight: 700; }
h4 { font-size: 1.2rem; font-weight: 600; }
h5 { font-size: 1.05rem; font-weight: 600; }
h6 { font-size: 0.95rem; font-weight: 600; }

p {
  color: var(--text-body);
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Container with Fluid Device Padding */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (max-width: 768px) {
  .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }
}

/* Utility Flex & Grid */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

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

@media (max-width: 640px) {
  .grid-cols-4 { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: 1fr; }
}

/* iOS Safe Input Sizing (Prevents Auto-Zoom on Focus) */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.bento-col-3 { grid-column: span 3; }
.bento-col-4 { grid-column: span 4; }
.bento-col-6 { grid-column: span 6; }
.bento-col-8 { grid-column: span 8; }
.bento-col-12 { grid-column: span 12; }

@media (max-width: 1200px) {
  .bento-col-3,
  .bento-col-4 {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .bento-grid {
    gap: 1rem;
  }
  .bento-col-3,
  .bento-col-4,
  .bento-col-6,
  .bento-col-8 {
    grid-column: span 12 !important;
  }
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
