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

/* ─── CSS Variables ────────────────────────────────────────── */
:root {
  /* Colors */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2F6;
  --primary-rgb: 79, 70, 229;

  --secondary: #6B7280;
  --secondary-hover: #4B5563;

  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  --background: #f3f4f6;
  --surface: #FFFFFF;
  --surface-2:  #f3f4f6;
  --surface-3: #E5E7EB;

  --text: #111827;
  --text-muted: #4B5563;
  --text-light: #9CA3AF;
  --text-inverse: #FFFFFF;

  --border: #E5E7EB;
  --border-dark: #D1D5DB;

  /* Fallbacks for multi-tenant studio override */
  --studio-brand: var(--primary);
  --studio-brand-hover: var(--primary-hover);
  --studio-brand-rgb: var(--primary-rgb);

  /* Layout and Styling */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s ease;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --container-max: 1200px;
}

/* Dark mode overrides (Automatic and Manual) */
@media (prefers-color-scheme: dark) {
  :root:not(.light-theme) {
    --background: #0B0F19;
    --surface: #1F2937;
    --surface-2: #374151;
    --surface-3: #4B5563;
    --text: #F9FAFB;
    --text-muted: #D1D5DB;
    --text-light: #9CA3AF;
    --border: #374151;
    --border-dark: #4B5563;
  }
}

:root.dark-theme {
  --background: #0B0F19;
  --surface: #1F2937;
  --surface-2: #374151;
  --surface-3: #4B5563;
  --text: #F9FAFB;
  --text-muted: #D1D5DB;
  --text-light: #9CA3AF;
  --border: #374151;
  --border-dark: #4B5563;
}

/* ─── CSS Reset ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
  background-color: transparent !important;
}

body {
  font-family: var(--font);
  background-color: transparent !important;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Typography scale */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.875rem;
}

p,
ul,
ol {
  margin-bottom: 1rem;
}

a {
  color: var(--studio-brand);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--studio-brand-hover);
  text-decoration: underline;
}

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

/* ─── Layout & Grid Utilities ─────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

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

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

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

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

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

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

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

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

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

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

.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;
}

.flex-1 {
  flex: 1 1 0%;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

/* ─── Spacing scale ────────────────────────────────────────── */
.m-0 {
  margin: 0;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mt-12 {
  margin-top: 3rem;
}

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

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

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

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

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

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

.p-2 {
  padding: 0.5rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

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

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

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

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

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

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ─── Color Utilities ──────────────────────────────────────── */
.text-muted {
  color: var(--text-muted);
}

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

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

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

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

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

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

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

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

.border-bottom {
  border-bottom: 1px solid var(--border);
}

.border-all {
  border: 1px solid var(--border);
}

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

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

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-muted);
}

.small {
  font-size: 0.875rem;
  color: var(--text-muted);
}