:root {
    --container: 1120px;

    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.88);
    --surface-card: rgba(255, 255, 255, 0.96);

    --text: #0f172a;
    --text-muted: #475569;
    --text-soft: #64748b;

    --accent: #38bdf8;
    --accent-2: #67e8f9;
    --accent-3: #8b5cf6;

    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --blue-bg: #eff6ff;

    --border: #cbd8e8;
    --border-soft: rgba(37, 99, 235, 0.22);

    --radius-card: 24px;
    --radius-pill: 999px;

    --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 12px 24px rgba(37, 99, 235, 0.10);

    --section-title-size: 40px;
    --section-title-line: 1;
    --section-title-track: -0.04em;
}

:root[data-theme="dark"] {
    --bg: #06111d;
    --surface: #0d1b2e;
    --surface-soft: rgba(13, 27, 46, 0.86);
    --surface-card: rgba(15, 27, 45, 0.94);

    --text: #f8fafc;
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;

    --accent: #22d3ee;
    --accent-2: #67e8f9;
    --accent-3: #a78bfa;

    --blue: #60a5fa;
    --blue-soft: rgba(59, 130, 246, 0.18);
    --blue-bg: rgba(96, 165, 250, 0.16);

    --border: rgba(148, 163, 184, 0.24);
    --border-soft: rgba(148, 163, 184, 0.18);

    --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.20);
    --shadow-hover: 0 14px 30px rgba(34, 211, 238, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

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

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

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition:
            transform 0.18s ease,
            border-color 0.18s ease,
            background 0.18s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
    background: #f8fbff;
}

.theme-toggle:focus-visible {
    outline: none;
    box-shadow:
            0 0 0 3px rgba(103, 232, 249, 0.34),
            0 8px 18px rgba(15, 23, 42, 0.16);
}

.theme-toggle-icon {
    position: absolute;
    width: 19px;
    height: 19px;
    color: #0f172a;
    transition:
            opacity 0.16s ease,
            transform 0.2s ease,
            color 0.16s ease;
}

:root[data-theme="dark"] .theme-toggle {
    border-color: rgba(148, 163, 184, 0.22);
    background: #071321;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .theme-toggle:hover {
    border-color: rgba(103, 232, 249, 0.34);
    background: #0b1b2e;
}

:root[data-theme="dark"] .theme-toggle-icon {
    color: #e2e8f0;
}

.theme-toggle-moon,
:root[data-theme="dark"] .theme-toggle-sun {
    opacity: 0;
    transform: scale(0.72) rotate(-18deg);
}

:root[data-theme="dark"] .theme-toggle-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.scroll-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--blue);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    appearance: none;
    -webkit-appearance: none;
    transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            border-color 0.18s ease,
            background 0.18s ease,
            color 0.18s ease;
}

.scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top:hover {
    border-color: rgba(37, 99, 235, 0.28);
    background: #ffffff;
    color: #1d4ed8;
    transform: translateY(-2px);
}

.scroll-top:focus-visible {
    outline: none;
    box-shadow:
            0 0 0 3px rgba(103, 232, 249, 0.34),
            0 12px 26px rgba(15, 23, 42, 0.18);
}

.scroll-top-icon {
    width: 22px;
    height: 22px;
}

:root[data-theme="dark"] .scroll-top {
    border-color: rgba(96, 165, 250, 0.22);
    background: rgba(7, 19, 33, 0.94);
    color: #bfdbfe;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .scroll-top:hover {
    border-color: rgba(103, 232, 249, 0.34);
    background: #0b1b2e;
    color: #e0f2fe;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.projects,
.notes,
.experience,
.contacts,
.projects-list-container,
.notes-list-container,
.note-single-container,
.project-single-container {
    max-width: var(--container);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

@media (max-width: 720px) {
    .theme-toggle {
        top: 14px;
        right: 14px;
    }

    .scroll-top {
        right: 14px;
        bottom: 14px;
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    :root {
        --section-title-size: 34px;
    }
}

@media (max-width: 720px) {
    .projects,
    .notes,
    .experience,
    .contacts,
    .projects-list-container,
    .notes-list-container,
    .note-single-container,
    .project-single-container {
        padding-left: 18px;
        padding-right: 18px;
    }
}
