/* ═══════════════════════════════════════════════════
   Healing.Moscow — Design System / Theme
   Спокойная, тёмная, healing-эстетика.
   ═══════════════════════════════════════════════════ */

:root {
    /* ── Core palette ──────────────────────────── */
    --bg:             #0a0a14;
    --bg-alt:         #0d0d1f;
    --surface:        #12122a;
    --surface-hover:  #1a1a3a;
    --surface-active: #1e1e42;
    --border:         rgba(167, 139, 250, 0.12);
    --border-hover:   rgba(167, 139, 250, 0.30);
    --border-active:  rgba(167, 139, 250, 0.50);

    /* ── Text ──────────────────────────────────── */
    --text:           #e0e0f0;
    --text-secondary: #b0b0d0;
    --text-muted:     #6b7280;
    --text-inverse:   #0a0a14;

    /* ── Accent colours ────────────────────────── */
    --accent:         #a78bfa;   /* purple-400 */
    --accent-light:   #c4b5fd;   /* purple-300 */
    --accent-dark:    #8b5cf6;   /* purple-500 */
    --accent2:        #60a5fa;   /* blue-400   */
    --accent2-light:  #93c5fd;   /* blue-300   */
    --pink:           #f472b6;   /* rose-400   */

    /* ── Gradients ─────────────────────────────── */
    --gradient-primary:  linear-gradient(135deg, var(--accent), var(--accent2));
    --gradient-hero:     linear-gradient(135deg, var(--accent), var(--accent2), var(--pink));
    --gradient-breath:   radial-gradient(circle, var(--accent-light), var(--accent), var(--accent-dark));
    --gradient-card:     linear-gradient(180deg, var(--surface), var(--bg));

    /* ── Shadows ───────────────────────────────── */
    --shadow-sm:      0 1px  3px  rgba(0, 0, 0, 0.4);
    --shadow-md:      0 4px  12px rgba(0, 0, 0, 0.5);
    --shadow-lg:      0 8px  32px rgba(0, 0, 0, 0.6);
    --shadow-glow:    0 0   24px rgba(167, 139, 250, 0.15);
    --shadow-glow-lg: 0 0   48px rgba(167, 139, 250, 0.25);

    /* ── Typography ────────────────────────────── */
    --font-sans:  'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   1.25rem;    /* 20px */
    --text-2xl:  1.5rem;     /* 24px */
    --text-3xl:  1.875rem;   /* 30px */
    --text-4xl:  2.25rem;    /* 36px */
    --text-5xl:  3rem;       /* 48px */
    --text-6xl:  3.75rem;    /* 60px */

    /* ── Spacing (4px grid) ────────────────────── */
    --space-1:  0.25rem;  /*  4px */
    --space-2:  0.5rem;   /*  8px */
    --space-3:  0.75rem;  /* 12px */
    --space-4:  1rem;     /* 16px */
    --space-5:  1.25rem;  /* 20px */
    --space-6:  1.5rem;   /* 24px */
    --space-8:  2rem;     /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */

    /* ── Border radius ─────────────────────────── */
    --radius-sm:  6px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* ── Transitions ───────────────────────────── */
    --transition-fast:   150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow:   400ms ease;
    --transition-breath: 1s cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Z-index scale ─────────────────────────── */
    --z-base:    1;
    --z-dropdown: 50;
    --z-sticky:  100;
    --z-modal:   500;
    --z-toast:   1000;
}

/* ═══════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--accent-light); }

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ═══════════════════════════════════════════════════
   Typography utilities
   ═══════════════════════════════════════════════════ */

.text-gradient {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }

/* ═══════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ═══════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════ */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(12px);
}

.site-header .logo {
    font-size: var(--text-2xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.site-header nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: var(--space-2) 0;
}

.site-header nav a:hover,
.site-header nav a.active {
    color: var(--text);
}

.site-header nav a.active {
    border-bottom: 2px solid var(--accent);
}

/* ═══════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: border-color var(--transition-normal),
                box-shadow var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.card--interactive {
    cursor: pointer;
}

.card--interactive:active {
    border-color: var(--border-active);
    background: var(--surface-active);
}

/* ═══════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    opacity: 0.92;
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.btn-ghost {
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: var(--text);
    background: var(--surface);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
    font-size: var(--text-xl);
}

/* ═══════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════ */

.site-footer {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
    font-size: var(--text-xs);
    border-top: 1px solid var(--border);
    margin-top: var(--space-16);
}

/* ═══════════════════════════════════════════════════
   Utility: sr-only (screen-reader only)
   ═══════════════════════════════════════════════════ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Light theme override ── */
[data-theme="light"] {
    --bg:             #f9fafb;
    --bg-alt:         #f3f4f6;
    --surface:        #ffffff;
    --surface-hover:  #f9fafb;
    --surface-active: #eff6ff;
    --border:         #e5e7eb;
    --border-hover:   #2563eb;
    --border-active:  #1d4ed8;
    --text:           #111827;
    --text-secondary: #374151;
    --text-muted:     #6b7280;
}

/* ── Theme toggle button ── */
.theme-toggle {
    position: fixed; bottom: 20px; right: 20px; z-index: 999;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    cursor: pointer; font-size: 20px; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    transition: transform .2s;
}
.theme-toggle:hover { transform: scale(1.1); }
