/* =============================================
   BAZA.MASTERSMETA.PRO — Основна дизайн-система
   Автор: MastersMeta Team
   Версія: 1.0
   ============================================= */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@600;700;800;900&display=swap');

/* ─── CSS Variables (Dark Theme) ─── */
:root {
    /* Основні кольори */
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --primary-glow: rgba(14, 165, 233, 0.15);
    
    /* Акценти */
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --amber: #f59e0b;
    --amber-light: #fbbf24;
    --emerald: #10b981;
    --emerald-light: #34d399;
    --rose: #f43f5e;
    
    /* Фони (Dark Mode) */
    --bg-body: #0b1120;
    --bg-surface: #111827;
    --bg-card: #1e293b;
    --bg-card-hover: #253347;
    --bg-elevated: #334155;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    
    /* Тексти */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #38bdf8;
    
    /* Бордери */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(14, 165, 233, 0.3);
    
    /* Градієнти */
    --gradient-hero: linear-gradient(135deg, #0b1120 0%, #1a1040 40%, #0b1120 100%);
    --gradient-primary: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-cool: linear-gradient(135deg, #06b6d4, #3b82f6);
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(51, 65, 85, 0.4));
    
    /* Тіні */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);
    
    /* Розміри */
    --container: 1280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Анімації */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --bg-body: #f0f4f8;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-elevated: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.9);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    
    --gradient-hero: linear-gradient(135deg, #f0f4f8 0%, #e0e7ff 40%, #f0f4f8 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(241,245,249,0.6));
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; }

/* ─── Container ─── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 800; }
h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; }
h3 { font-size: clamp(20px, 3vw, 28px); }
h4 { font-size: 20px; }

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--text-accent); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.1); }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(14, 165, 233, 0.4);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}
.btn-ghost:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.btn-lg { padding: 16px 32px; font-size: 17px; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-icon { width: 44px; height: 44px; padding: 0; }

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
    transform: translateY(-4px);
}

.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary {
    background: var(--primary-glow);
    color: var(--primary-light);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-accent {
    background: var(--accent-glow);
    color: var(--accent-light);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber-light);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ─── Grid ─── */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── Flex utilities ─── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }
.flex-wrap { flex-wrap: wrap; }

/* ─── Spacing ─── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

@media (max-width: 768px) {
    .section { padding: 48px 0; }
    .section-sm { padding: 32px 0; }
}

/* ─── Section Headers ─── */
.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 48px;
}

.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--text-secondary); font-size: 17px; }

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 12px;
}

.section-eyebrow::before,
.section-eyebrow::after {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--primary);
    opacity: 0.5;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { 
    background: var(--bg-elevated);
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Selection ─── */
::selection {
    background: rgba(14, 165, 233, 0.3);
    color: var(--text-primary);
}
