/* =========================================================
   HomePortal — Design System
   ========================================================= */

:root {
    /* Цвета */
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-surface-soft: #eef1f5;

    --color-text: #17202a;
    --color-text-secondary: #667085;
    --color-text-muted: #98a2b3;

    --color-border: rgba(16, 24, 40, 0.08);

    --color-primary: #5b5ce2;
    --color-primary-hover: #4b4cc7;
    --color-primary-soft: rgba(91, 92, 226, 0.12);

    --color-success: #12b76a;
    --color-warning: #f79009;
    --color-danger: #f04438;

    /* Типографика */
    --font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;

    /* Отступы */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Скругления */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 999px;

    /* Тени */
    --shadow-sm:
        0 1px 2px rgba(16, 24, 40, 0.05);

    --shadow-md:
        0 4px 12px rgba(16, 24, 40, 0.08);

    --shadow-lg:
        0 12px 30px rgba(16, 24, 40, 0.12);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --player-height: 72px;

    /* Анимации */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* =========================================================
   Dark Theme
   ========================================================= */

[data-theme="dark"] {
    --color-bg: #101214;
    --color-surface: #181b1f;
    --color-surface-soft: #22262b;

    --color-text: #f2f4f7;
    --color-text-secondary: #aab2bf;
    --color-text-muted: #707987;

    --color-border: rgba(255, 255, 255, 0.08);

    --color-primary: #7778ff;
    --color-primary-hover: #8889ff;
    --color-primary-soft: rgba(119, 120, 255, 0.16);

    --shadow-sm:
        0 1px 2px rgba(0, 0, 0, 0.2);

    --shadow-md:
        0 4px 12px rgba(0, 0, 0, 0.3);

    --shadow-lg:
        0 12px 30px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   Base
   ========================================================= */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;

    min-width: 320px;
    min-height: 100vh;

    font-family: var(--font-family);
    font-size: var(--font-size-md);
    line-height: 1.5;

    color: var(--color-text);
    background: var(--color-bg);

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    transition:
        background-color var(--transition-normal),
        color var(--transition-normal);
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   Fluid Typography
   ========================================================= */

h1 {
    font-size: clamp(1.75rem, 2vw + 1rem, 3rem);
}

h2 {
    font-size: clamp(1.4rem, 1vw + 1rem, 2.25rem);
}

h3 {
    font-size: clamp(1.15rem, 0.5vw + 1rem, 1.5rem);
}

/* =========================================================
   Fluid Container
   ========================================================= */

.container {
    width: min(
        calc(100% - 2 * clamp(1rem, 3vw, 3rem)),
        1800px
    );

    margin-inline: auto;
}

/* =========================================================
   Responsive Grid
   ========================================================= */

.auto-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                min(100%, 240px),
                1fr
            )
        );

    gap: clamp(
        0.75rem,
        1.5vw,
        1.5rem
    );
}

/* =========================================================
   Surface
   ========================================================= */

.surface {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);

    transition:
        background-color var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    min-height: 40px;
    padding-inline: 1rem;

    border: 0;
    border-radius: var(--radius-md);

    color: var(--color-text);

    background: var(--color-surface-soft);

    transition:
        transform var(--transition-fast),
        background-color var(--transition-fast),
        color var(--transition-fast);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    color: #ffffff;
    background: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

/* =========================================================
   Utility
   ========================================================= */

.hidden {
    display: none !important;
}

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

.no-select {
    user-select: none;
}


/* =========================================================
   SVG-иконки (app/icons.php): цвет — как у текста, размер — 1em
   ========================================================= */

.i {
    display: inline-block;
    flex-shrink: 0;

    width: 1em;
    height: 1em;

    vertical-align: -0.14em;

    fill: none;
    stroke: none;
}
