:root {
    --bg: #0e0f12;
    --text: #eaeaea;
    --accent: #00c6ff;
    --card-bg: #16181d;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 0 25px rgba(0,198,255,0.05);
    --transition: 0.3s ease;
    --card: rgba(255,255,255,0.03);
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

body.light {
    --bg: #f9fafb;
    --text: #111;
    --accent: #0072ff;
    --card-bg: #ffffff;
    --border: rgba(0,0,0,0.1);
    --shadow: 0 0 25px rgba(0,0,0,0.05);
    --card: #fff;
}

/* === Контейнер и структура === */
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem;
}

/* === Герой === */
.hero {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.avatar-wrapper {
    display: inline-block;
    padding: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(0,198,255,0.25), rgba(138,43,226,0.25));
    animation: avatarPulse 4s ease-in-out infinite;
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 15px rgba(0,198,255,0.4), 0 0 40px rgba(138,43,226,0.2);
    transition: transform .5s ease, box-shadow .5s ease;
}

.avatar-wrapper:hover .avatar {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 0 25px rgba(0,198,255,0.6), 0 0 60px rgba(138,43,226,0.4);
}

h1 {
    font-size: 2rem;
    margin-top: 1rem;
}

.subtitle {
    color: #999;
    margin-top: 0.3rem;
}

.typing {
    display: inline-block;
    white-space: nowrap;
    min-height: 26px;;
    max-width: 100%;
    margin-top: 0.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--accent);
    opacity: 0.9;
    line-height: 26px;
}

.links {
    margin-top: 1rem;
}

.links a {
    color: var(--accent);
    margin: 0 10px;
    font-size: 1.3rem;
    transition: var(--transition);
}

.links a:hover {
    color: #fff;
    transform: translateY(-2px);
}

/* === Секции === */
section,
.certificates,
.github,
.footer {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem 1.7rem;
    margin: 2rem 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .8s ease, transform .8s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

ul {
    list-style: none;
    padding-left: 0;
}

ul li {
    padding: 0.3rem 0;
}

/* === Проекты === */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.projects-list li {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 1rem 1.2rem;
    transition: var(--transition);
}

.projects-list li:hover {
    background: rgba(0,198,255,0.08);
    transform: translateY(-2px);
}

.projects-list a {
    color: var(--accent);
    font-weight: 500;
}

.tech {
    display: block;
    color: #aaa;
    font-size: 0.8rem;
    font-family: monospace;
    margin-bottom: 0.3rem;
}

/* === Анимированный фон === */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
            radial-gradient(ellipse at top, rgba(0,198,255,0.25), transparent 70%),
            radial-gradient(ellipse at bottom, rgba(138,43,226,0.2), transparent 70%);
    background-size: 100% 100%;
    animation: gradientShift 20s ease-in-out infinite alternate;
    filter: blur(40px);
    opacity: 0.4;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.05) translateY(-20px); }
}

@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 25px rgba(0,198,255,0.2), 0 0 50px rgba(138,43,226,0.2); }
    50% { box-shadow: 0 0 35px rgba(0,198,255,0.4), 0 0 60px rgba(138,43,226,0.3); }
}

/* === Тема === */
.theme-btn {
    position: static;

    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--accent);
    cursor: pointer;
    transition: transform .3s;
    z-index: 10;
}
.nav-right {
    order: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-btn:hover {
    transform: rotate(15deg);
}

/* === Футер === */
.footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover {
    color: #fff;
}

.contact-links {
    margin-bottom: 1.8rem;
}

.contact-links h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text);
    opacity: 0.9;
}

.contact-links ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    max-width: 700px;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: 0.95rem;
    padding: .6rem 1.2rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: var(--text);
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.contact-links a i {
    font-size: 1.1rem;
    color: var(--accent);
}

.contact-links a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(0,198,255,0.3);
    transform: translateY(-2px);
}

.contact-links a:hover i {
    color: #fff;
}

.contact-links a.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.footer .copyright {
    font-size: 0.9rem;
    color: #888;
    margin-top: 1rem;
}

/* === Сертификаты === */
.certificates {
    text-align: center;
    padding: 1.8rem;
}
.certificates-subtitle{
    text-align: start;
    margin-bottom: 1rem;
}
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.cert-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.cert-item .cert-title {
    margin-top: 10px;
    font-weight: 500;
}

.cert-item .cert-date {
    font-size: 13px;
    opacity: .7;
}

.cert-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 25px rgba(0,198,255,0.2);
}

.cert-thumb {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: opacity 0.2s;
}

.cert-item:hover .cert-thumb {
    opacity: 0.9;
}

.cert-item p {
    margin: 0.8rem 0 0.3rem;
    color: var(--text);
    font-weight: 500;
}

.cert-date {
    font-size: 0.85rem;
    color: #999;
}
/* ────────────────────────────────────────
   Фильтр сертификатов (мобильный скролл + тень)
   ──────────────────────────────────────── */
.cert-filter {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;               /* горизонтальная строка */
    justify-content: flex-start;
    overflow-x: auto;                /* скролл */
    overflow-y: visible;             /* тень может выходить вверх/вниз */
    padding: 0.6rem 0.4rem;          /* ← отступы, где живёт тень */
    scrollbar-width: none;           /* Firefox */
}
.cert-filter::-webkit-scrollbar { display: none; }   /* Chrome/Safari */

.cert-filter button {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .25s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* hover */
.cert-filter button:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,198,255,.15);
}

/* active */
.cert-filter button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(0,198,255,.35);
    transform: translateY(-2px);
    font-weight: 600;
}

/* небольшой «шлейф» у активной кнопки */
.cert-filter button.active::before {
    content:"";
    position:absolute;
    inset:0;
    border-radius:10px;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);
    animation:shimmer 2s infinite;
    pointer-events:none;
}
@keyframes shimmer{
    0%{transform:translateX(-100%);}
    100%{transform:translateX(100%);}
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


@media (max-width: 480px) {
    .cert-filter {
        overflow-x: auto;
        overflow-y: visible;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.6rem;
    }
    .cert-filter button {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .cert-filter::-webkit-scrollbar { display: none; }
}

/* === Модальное окно === */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.modal.active {
    display: flex;
}

@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    .modal {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 198, 255, 0.3);
    background: var(--card-bg);
    animation: modalZoom 0.25s ease;
}

.modal-content img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1) rotate(90deg);
}
.modal-text{
    padding: 8px;
    text-align: center;
}
.modal-text-title {
    margin-top: 10px;
    font-weight: 500;
}

.modal-text-date {
    font-size: 13px;
    opacity: .7;
}
.modal-close svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

@keyframes modalZoom {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* === GitHub репозитории === */
.github {
    text-align: center;
    padding: 2rem;
}

.repo-grid.pretty {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.repo-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.3rem 1.4rem;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.repo-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(0,198,255,0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.repo-card:hover::before {
    opacity: 1;
}

.repo-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(0,198,255,0.15);
}

.repo-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.repo-card h3 a {
    color: var(--accent);
    text-decoration: none;
}

.repo-card h3 a:hover {
    text-decoration: underline;
}

.repo-card p {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
}

.tech {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tech span {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: rgba(255,255,255,0.05);
    color: var(--accent);
    transition: background 0.2s ease;
}

.tech span:hover {
    background: var(--accent);
    color: #fff;
}

/* === Cookie Modal === */
.cookie-modal {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 0 25px rgba(0,198,255,0.15);
    border-radius: 10px;
    max-width: 480px;
    width: 90%;
    padding: 1.2rem 1.5rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.5s ease;
}

.cookie-modal.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-content a {
    color: var(--accent);
    text-decoration: underline;
}

.cookie-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cookie-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s;
}

.cookie-btn:hover {
    background: #008cff;
    transform: translateY(-2px);
}

.cookie-btn.secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.cookie-btn.secondary:hover {
    background: var(--accent);
    color: #fff;
}

/* === Share Widget === */
.share-widget {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 9999;
}

.share-btn {
    width: 50px;
    height: 50px;
    background: #0e0f12;
    border: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    color: #fff;
    transition: .25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.share-btn:hover {
    opacity: 0.85;
}

.share-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: #1a1b1f;
    padding: 10px 12px;
    border-radius: 14px;
    display: flex;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: .25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.share-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.share-panel .sh {
    font-size: 22px;
    cursor: pointer;
    transition: .2s;
}

.share-panel .sh:hover {
    transform: scale(1.18);
}

.share-panel .vk { color: #4c75a3; }
.share-panel .tg { color: #2aabee; }
.share-panel .wa { color: #25d366; }
.share-panel .fb { color: #1877f2; }
.share-panel .tw { color: #fff; }
.share-panel .em { color: #f1c40f; }

/* === Анимации === */
.wave {
    display: inline-block;
    transform-origin: 70% 70%;
    margin-right: 4px;
    animation: waveBounce 1.8s cubic-bezier(.22, .61, .36, 1) infinite;
}

.hello-title {
    opacity: 0;
    transform: translateY(6px);
    animation: fadeHello 0.8s ease forwards;
}

@keyframes fadeHello {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes waveBounce {
    0%   { transform: rotate(0deg); }
    10%  { transform: rotate(18deg); }
    22%  { transform: rotate(-12deg); }
    34%  { transform: rotate(14deg); }
    46%  { transform: rotate(-8deg); }
    58%  { transform: rotate(10deg); }
    70%  { transform: rotate(-4deg); }
    82%  { transform: rotate(4deg); }
    100% { transform: rotate(0deg); }
}

/* === Навигация === */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(14,15,18,0.65);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
    .navbar {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.nav-logo img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: .25s ease;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.06);
    color: var(--accent);
}

.nav-links a.active {
    background: var(--accent);
    color: #fff !important;
    box-shadow: 0 3px 15px rgba(0,198,255,0.35);
}






/* === Контакты === */
.contact-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-top: 1rem;
}

.contact-card {
    background: rgba(255,255,255,0.03);
    padding: 1.2rem 1.4rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 0 15px rgba(0,198,255,0.08);
    transition: 0.25s ease;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0,198,255,0.15);
}

.label {
    color: #9ea7b3;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: 0.25s ease;
}

.contact-link:hover {
    color: #fff;
    text-decoration: underline;
}
@media (min-width: 720px) {
    .nav-toggle{
        display: none;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        width: 0;
        height: 0;
        padding: 0;
        margin: 0;
    }
}
@media (max-width: 720px) {
    .nav-toggle {
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 60;
    }
    .burger .line {
        stroke: var(--accent, #00c6ff);
        stroke-width: 2.4;
        stroke-linecap: round;
        transition: transform .35s ease, opacity .25s ease, stroke .25s ease;
        transform-origin: center;
        filter: drop-shadow(0 0 4px #00c6ff77);
    }
    .burger .line {
        transform-origin: center;
    }

    /* Анимация крестика */
    .nav-toggle.open .top {
        transform: translate(-5px, 5px) rotate(45deg);
    }

    .nav-toggle.open .middle {
        opacity: 0;
    }

    .nav-toggle.open .bottom {
        transform: translate(-5px, -2px) rotate(-45deg);
    }

    .nav-toggle { display: block; }
    .nav-links {
        position: absolute;
        right: 0;
        top: 100%;
        background: rgba(14,15,18,0.9);
        backdrop-filter: blur(12px);
        width: 100%;
        flex-direction: column;
        padding: 1rem 0;
        display: none;
    }
    .nav-links.open { display: flex; padding: 1rem; border-bottom-left-radius: 0.8rem;border-bottom-right-radius: 0.8rem; }
    .nav-links a { padding: 12px 20px; font-size: 1rem; }

}

@media (max-width: 640px) {
    .container { padding: 1.2rem; }
    .avatar { width: 100px; height: 100px; }
    h1 { font-size: 1.5rem; }
    section, .certificates, .github { padding: 1rem 1.2rem; }
    .contact-links ul { gap: .6rem; }
    .contact-links a { justify-content: center; font-size: 0.9rem; padding: .5rem .9rem; }
    .contact-links a span { display: none; }
    .repo-card { padding: 1.1rem; }
    .repo-card p { font-size: 0.85rem; }
}

@media (min-width: 700px) {
    .contact-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === Политика конфиденциальности === */
.policy h1, .policy h2 {
    color: var(--accent);
}

.policy h1 { margin-bottom: 1.5rem; }
.policy h2 { margin: 1.8rem 0 .8rem; }
.policy p, .policy li {
    color: var(--text);
    line-height: 1.6;
}