/* ============ ПЕРЕМЕННЫЕ И ТЕМЫ ============ */
:root {
    --bg: #0b0d16;
    --bg-soft: #11142a;
    --card: rgba(255, 255, 255, 0.045);
    --card-border: rgba(255, 255, 255, 0.09);
    --text: #e8eaf2;
    --text-dim: #9aa1b5;
    --accent: #7c3aed;
    --accent-2: #06b6d4;
    --gradient: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
    --glow: rgba(124, 58, 237, 0.25);
    --font-main: 'Manrope', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 22px;
}

[data-theme="light"] {
    --bg: #f4f5fb;
    --bg-soft: #ffffff;
    --card: rgba(255, 255, 255, 0.75);
    --card-border: rgba(20, 20, 60, 0.08);
    --text: #1a1d33;
    --text-dim: #5b6178;
    --glow: rgba(124, 58, 237, 0.15);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

.mono { font-family: var(--font-mono); }

::selection { background: var(--accent); color: #fff; }

/* ============ AURORA-ФОН ============ */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.aurora__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.55;
    animation: float 18s ease-in-out infinite alternate;
}

[data-theme="light"] .aurora__blob { opacity: 0.35; }

.aurora__blob--1 {
    width: 55vmax; height: 55vmax;
    background: #7c3aed;
    top: -20vmax; left: -15vmax;
}

.aurora__blob--2 {
    width: 45vmax; height: 45vmax;
    background: #06b6d4;
    bottom: -18vmax; right: -12vmax;
    animation-delay: -6s;
    animation-duration: 22s;
}

.aurora__blob--3 {
    width: 35vmax; height: 35vmax;
    background: #db2777;
    top: 40%; left: 45%;
    animation-delay: -12s;
    animation-duration: 26s;
    opacity: 0.25;
}

@keyframes float {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(6vmax, -4vmax) scale(1.15); }
    100% { transform: translate(-5vmax, 5vmax) scale(0.95); }
}

/* Лёгкий шум поверх фона — придаёт глубину */
.noise {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ СВЕЧЕНИЕ ЗА КУРСОРОМ ============ */
.cursor-glow {
    position: fixed;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}

/* ============ ОБЩИЕ ЭЛЕМЕНТЫ ============ */
.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.btn--primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.5);
}

.btn--ghost {
    border-color: var(--card-border);
    background: transparent;
}

.btn--ghost:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

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

/* ============ ВЕРХНЯЯ ПАНЕЛЬ ============ */
.topbar {
    position: sticky;
    top: 16px;
    z-index: 10;
    max-width: 860px;
    margin: 16px auto 0;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.topbar__logo { font-weight: 600; color: var(--accent-2); }

.topbar__nav {
    display: flex;
    gap: 18px;
    margin-left: auto;
}

.topbar__nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.topbar__nav a:hover { color: var(--accent-2); }

.topbar__cta { padding: 8px 14px; font-size: 0.85rem; }


/* ============ ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ============ */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 20;
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card);
    backdrop-filter: blur(18px);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s, border-color 0.2s;
}

.theme-toggle:hover { transform: scale(1.1); border-color: var(--accent); }
.theme-toggle .icon { width: 22px; height: 22px; }
.icon--moon { display: none; }
[data-theme="light"] .icon--moon { display: block; }
[data-theme="light"] .icon--sun { display: none; }

/* ============ HERO ============ */
.hero {
    margin-top: 8px;
    padding: 56px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Деликатная градиентная подсветка сверху карточки */
.hero::before {
    content: "";
    position: absolute;
    inset: -60% 20% auto;
    height: 140%;
    background: var(--gradient);
    filter: blur(90px);
    opacity: 0.12;
    pointer-events: none;
}

.hero__badge {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent-2);
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 28px;
}

.hero__avatar-wrap { position: relative; display: inline-block; }

.hero__avatar {
    width: 132px; height: 132px;
    border-radius: 50%;
    background: var(--gradient);
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.15), 0 0 60px rgba(124, 58, 237, 0.4);
    animation: pulse 3.5s ease-in-out infinite;
    margin-bottom: 24px;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.15), 0 0 60px rgba(124, 58, 237, 0.35); }
    50%      { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0.08), 0 0 90px rgba(6, 182, 212, 0.45); }
}

.hero__status {
    position: absolute;
    bottom: 34px; right: -4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #22c55e;
    border: 4px solid var(--bg);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.hero__name {
    font-size: clamp(1.8rem, 5vw, 2.9rem);
    font-weight: 800;
    line-height: 1.15;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
}

.hero__typing {
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.hero__accent { color: var(--accent); margin: 0 6px; }

.typed { color: var(--text); }

.caret {
    display: inline-block;
    width: 9px; height: 1.1em;
    background: var(--accent-2);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

.hero__location { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 28px; }

.hero__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* ============ СЕКЦИИ ============ */
.section { scroll-margin-top: 90px; }

.section__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section__num { color: var(--accent-2); font-size: 1.1rem; }

.card--wide { padding: 32px; }

/* ---- Обо мне ---- */
.about__text {
    color: var(--text-dim);
    line-height: 1.75;
    margin-bottom: 12px;
    display: inline;
}

.about__text + .about__text::before { content: " "; }

.about__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.fact {
    text-align: center;
    padding: 18px 12px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    background: rgba(124, 58, 237, 0.05);
    transition: transform 0.2s, border-color 0.2s;
}

.fact:hover { transform: translateY(-3px); border-color: var(--accent); }

.fact__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fact__label {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ---- Проекты ---- */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.project {
    display: flex;
    flex-direction: column;
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.18);
}

.project__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.project__folder {
    color: var(--accent-2);
}

.project__folder svg { width: 26px; height: 26px; }

.project__meta { font-size: 0.75rem; color: var(--text-dim); }

.project__title { font-size: 1.12rem; font-weight: 800; margin-bottom: 10px; }

.project__desc {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-dim);
    flex-grow: 1;
    margin-bottom: 16px;
}

.project__stack { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
    font-size: 0.68rem;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    color: var(--accent-2);
    background: rgba(6, 182, 212, 0.06);
}

.projects__more { text-align: center; margin-top: 24px; }

/* ---- Аватар с фото ---- */
.hero__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ---- Навыки ---- */
.skills { display: flex; flex-direction: column; gap: 22px; }

.skill__head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 9px;
    font-size: 0.92rem;
    font-weight: 700;
}

.skill__pct { color: var(--accent-2); font-size: 0.82rem; }

.skill__bar {
    height: 9px;
    border-radius: 999px;
    background: var(--card-border);
    overflow: hidden;
}

.skill__fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--gradient);
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

/* ---- Контакты ---- */
.contact__text { color: var(--text-dim); line-height: 1.7; margin-bottom: 24px; }

.contact__links { display: flex; flex-direction: column; gap: 12px; }

.contact__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.contact__link:hover {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.06);
    transform: translateX(6px);
}

.contact__arrow { color: var(--accent-2); transition: transform 0.2s; }
.contact__link:hover .contact__arrow { transform: translateX(4px); }

/* ---- Кнопка копирования email ---- */
button.contact__link {
    width: 100%;
    font-family: var(--font-main);
    font-size: 1rem;
    cursor: pointer;
    background: transparent;   /* сброс белого фона button по умолчанию */
    text-align: left;
    color: var(--text);
}

.contact__link--copy {
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.contact__icon { color: var(--accent-2); }

.contact__hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-dim);
    opacity: 0.75;
}

.contact__link--copy .contact__arrow { font-size: 0.9rem; }

.contact__link--copy.copied {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

.contact__link--copy.copied .contact__arrow { color: #22c55e; }

@media (max-width: 640px) {
    .contact__hint { display: none; }
}

/* ============ ФУТЕР ============ */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.footer__dim { opacity: 0.6; }

/* ============ SCROLL-REVEAL ============ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ АДАПТИВНОСТЬ ============ */
@media (max-width: 640px) {
    .topbar { gap: 10px; padding: 10px 14px; }
    .topbar__nav { gap: 10px; }
    .topbar__nav a { font-size: 0.8rem; }
    .topbar__cta span { display: none; }
    .card--wide { padding: 24px 18px; }
    .hero { padding: 40px 20px; }
    .cursor-glow { display: none; }
}

/* Уважение к reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

