/* ==========================================================================
   laacrus — сайт-визитка
   Палитра с litvyakov.ru: фон #171e25, акцент #31b1c3.
   Тёмная тема по умолчанию, светлая — по системной настройке.
   ========================================================================== */

:root {
    --bg: #171e25;
    --fg: #f1f5f8;
    --card: #1e262e;
    --page: #1a222a;          /* фон плиток и чипов внутри карточки */
    --muted: #272f38;
    --muted-fg: #9aa7b2;
    --border: #333e49;
    --primary: #31b1c3;
    --primary-strong: #45c0d1;
    --primary-soft: rgba(49, 177, 195, 0.45);
    --primary-fg: #0b1319;
    --dot: rgba(154, 167, 178, 0.16);
    --glow: rgba(49, 177, 195, 0.14);
    --shadow: 0 24px 60px rgba(2, 8, 14, 0.45);
    --hover-shadow: 0 10px 28px rgba(2, 8, 14, 0.35);
}

[data-theme="light"] {
    --bg: #f4f7fa;
    --fg: #171e25;
    --card: #ffffff;
    --page: #f7fafc;
    --muted: #eef2f6;
    --muted-fg: #55616c;
    --border: #dbe3ea;
    --primary-soft: rgba(49, 177, 195, 0.5);
    --dot: rgba(23, 30, 37, 0.1);
    --glow: rgba(49, 177, 195, 0.16);
    --shadow: 0 24px 60px rgba(23, 30, 37, 0.1);
    --hover-shadow: 0 10px 28px rgba(23, 30, 37, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100svh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--fg);
    background-color: var(--bg);
}

/* Фон: точечная сетка с мягкой маской + бирюзовое свечение сверху. */
body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
}

body::before {
    inset: 0;
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 42%, #000, transparent);
    mask-image: radial-gradient(ellipse 65% 60% at 50% 42%, #000, transparent);
}

body::after {
    top: 40px;
    left: 50%;
    width: 420px;
    height: 280px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, var(--glow), transparent);
}

::selection {
    background: rgba(49, 177, 195, 0.35);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

/* --------------------------------------------------------------------------
   Карточка
   -------------------------------------------------------------------------- */

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.card {
    position: relative;
    width: 100%;
    max-width: 672px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Переключатель темы
   -------------------------------------------------------------------------- */

.theme-toggle {
    flex: none;
    align-self: center;
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--page);
    color: var(--muted-fg);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.theme-toggle:hover {
    border-color: var(--primary-soft);
    background: var(--muted);
    color: var(--fg);
}

.theme-icon {
    width: 18px;
    height: 18px;
}

.card--slim {
    max-width: 420px;
}

@media (prefers-reduced-motion: no-preference) {
    .card {
        animation: card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Шапка: аватар, имя, статус
   -------------------------------------------------------------------------- */

.identity {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.avatar-wrap {
    position: relative;
    flex: none;
    align-self: flex-start;
}

.avatar-ring {
    position: absolute;
    inset: -6px;
    border: 1px dashed var(--border);
    border-radius: 26px;
}

.avatar {
    position: relative;
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 20px;
    object-fit: cover;
}

.avatar-dot {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card);
}

.who {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.name {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.nick {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--muted);
    color: var(--muted-fg);
}

.role {
    margin: 4px 0 0;
    font-size: 15px;
    color: var(--muted-fg);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--page);
    color: var(--muted-fg);
}

.badge svg {
    width: 14px;
    height: 14px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

/* --------------------------------------------------------------------------
   Навигация (вместо клиентских вкладок)
   -------------------------------------------------------------------------- */

.tabs {
    display: flex;
    gap: 24px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 12px 2px 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted-fg);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: var(--fg);
}

.tab.is-active {
    color: var(--fg);
    border-bottom-color: var(--primary);
}

/* --------------------------------------------------------------------------
   Содержимое страниц
   -------------------------------------------------------------------------- */

.body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

.section {
    margin: 0;
}

.bio {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted-fg);
}

.section-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-fg);
}

/* Плитки соцсетей */

.socials {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.social {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--page);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.social:hover {
    transform: translateY(-2px);
    border-color: var(--primary-soft);
    box-shadow: var(--hover-shadow);
}

.social-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--muted);
    color: var(--muted-fg);
    transition: background 0.2s, color 0.2s;
}

.social:hover .social-icon {
    background: var(--primary);
    color: var(--primary-fg);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.social-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.social-name {
    font-size: 14px;
    font-weight: 500;
}

.social-handle {
    font-size: 12px;
    color: var(--muted-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-arrow {
    flex: none;
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: var(--muted-fg);
    transition: transform 0.2s, color 0.2s;
}

.social:hover .social-arrow {
    transform: translate(2px, -2px);
    color: var(--fg);
}

/* Контакты под рукой */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--page);
    color: inherit;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.chip:hover {
    border-color: var(--primary-soft);
    background: var(--muted);
}

.chip svg {
    width: 16px;
    height: 16px;
    color: var(--muted-fg);
}

.chip--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-fg);
    font-weight: 500;
}

.chip--primary svg {
    color: inherit;
}

.chip--primary:hover {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}

/* Переключение «скопировать / готово» */

.icon--check {
    display: none;
    color: var(--primary);
}

.chip.is-copied .icon--copy {
    display: none;
}

.chip.is-copied .icon--check {
    display: block;
}

.copy-status {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted-fg);
}

.copy-status[hidden] {
    display: none;
}

/* Проекты */

.projects {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.project {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--page);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

a.project:hover {
    transform: translateY(-2px);
    border-color: var(--primary-soft);
    box-shadow: var(--hover-shadow);
}

.project--stub {
    border-style: dashed;
    background: transparent;
}

.project-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.project-desc {
    flex: 1;
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted-fg);
}

.project-arrow {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: var(--muted-fg);
    transition: transform 0.2s, color 0.2s;
}

a.project:hover .project-arrow {
    transform: translate(2px, -2px);
    color: var(--fg);
}

.tags {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--muted);
    color: var(--muted-fg);
}

/* Страница 404 */

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

.notfound-code {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 48px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
}

.notfound .chip {
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */

.card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted-fg);
}

.footer-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--fg);
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
    body {
        padding: 40px 24px;
    }

    .identity,
    .body {
        padding: 32px;
    }

    .tabs {
        padding-left: 32px;
        padding-right: 32px;
    }

    .identity {
        flex-direction: row;
        align-items: flex-start;
    }

    .avatar {
        width: 112px;
        height: 112px;
    }

    .name {
        font-size: 30px;
    }

    .bio {
        font-size: 16px;
    }

    .socials {
        grid-template-columns: 1fr 1fr;
    }

    .projects {
        grid-template-columns: 1fr 1fr;
    }

    .card-footer {
        padding-left: 32px;
        padding-right: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
