/* ===== CSS VARIABLES ===== */
:root {
    --accent: #4f6ef7;
    --accent-glow: rgba(79, 110, 247, 0.35);
    --accent-soft: rgba(79, 110, 247, 0.12);
    --accent-border: rgba(79, 110, 247, 0.3);
    --bg: #07090d;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --text-muted: #8a8f9e;
    --text-secondary: #c8ccd8;
    --radius-lg: 30px;
    --radius-xl: 35px;
    --shadow-glow: 0 0 60px rgba(79, 110, 247, 0.15);
}

/* ===== БАЗА ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: white;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== BACKGROUND IMAGE ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../image/задний фон омельчук.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    z-index: -4;
}

/* ===== GRID BG ===== */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -3;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 55px 55px;
    opacity: 0.5;
}

/* ===== ANIMATED BG ORBS ===== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 600px 400px at 80% 10%, rgba(79, 110, 247, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 10% 80%, rgba(100, 60, 220, 0.07) 0%, transparent 70%);
    pointer-events: none;
    animation: orbFloat 12s ease-in-out infinite alternate;
}

@keyframes orbFloat {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(20px, -15px) scale(1.04); }
    100% { transform: translate(-10px, 10px) scale(0.97); }
}

/* ===== CURSOR GLOW ===== */
.cursor-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 110, 247, 0.07), transparent 70%);
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-radius: 28px;
    background: rgba(7, 9, 13, 0.5);
    border: 1px solid var(--border);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 1000;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.navbar.scrolled {
    top: 10px;
    padding: 12px 32px;
    background: rgba(7, 9, 13, 0.88);
    border-color: rgba(79, 110, 247, 0.2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(79, 110, 247, 0.08);
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: white;
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-btn {
    display: none;
    font-size: 22px;
    cursor: pointer;
    color: white;
}

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    width: 90%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    padding-top: 40px;
}

.hero-left {
    flex: 1;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(79, 110, 247, 0.08);
    border: 1px solid rgba(79, 110, 247, 0.25);
    padding: 10px 20px;
    border-radius: 999px;
    margin-bottom: 24px;
    animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { border-color: rgba(79, 110, 247, 0.2); box-shadow: none; }
    50% { border-color: rgba(79, 110, 247, 0.5); box-shadow: 0 0 20px rgba(79, 110, 247, 0.15); }
}

.status-badge span {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.status-badge p {
    font-size: 13px;
    font-weight: 600;
    color: #a8b4f8;
    letter-spacing: 0.5px;
}

.mini-title {
    color: var(--accent);
    letter-spacing: 4px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
}

.hero h1 {
    font-size: 100px;
    line-height: 0.95;
    margin-bottom: 28px;
    font-weight: 900;
    letter-spacing: -4px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    color: var(--text-muted);
    line-height: 1.85;
    font-size: 17px;
    max-width: 560px;
    margin-bottom: 38px;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn {
    text-decoration: none;
    border-radius: 20px;
    padding: 16px 30px;
    font-weight: 600;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-main {
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(79, 110, 247, 0.35);
}

.btn-main:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 50px rgba(79, 110, 247, 0.5);
}

.btn-secondary {
    color: white;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    transform: translateY(-4px);
    background: rgba(79, 110, 247, 0.12);
    border-color: rgba(79, 110, 247, 0.4);
    box-shadow: 0 8px 30px rgba(79, 110, 247, 0.15);
}

.hero-stats {
    display: flex;
    gap: 16px;
}

.stat-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 24px 20px;
    border-radius: 24px;
    backdrop-filter: blur(30px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-6px);
    background: var(--accent-soft);
    border-color: var(--accent-border);
    box-shadow: 0 16px 50px rgba(79, 110, 247, 0.12);
}

.stat-card h3 {
    font-size: 36px;
    margin-bottom: 6px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a8b4f8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.hero-right {
    flex: 1;
    display: flex;
    justify-content: center;
}

.avatar-wrapper {
    position: relative;
    transition: transform 0.6s ease;
    will-change: transform;
}

.avatar {
    width: 420px;
    height: 530px;
    object-fit: cover;
    border-radius: 32px;
    border: 1px solid rgba(79, 110, 247, 0.2);
    position: relative;
    z-index: 2;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.avatar-glow {
    position: absolute;
    inset: -30px;
    background: radial-gradient(circle, rgba(79, 110, 247, 0.18), transparent 70%);
    filter: blur(50px);
    z-index: 1;
    animation: avatarPulse 4s ease-in-out infinite alternate;
}

@keyframes avatarPulse {
    0%   { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.08); }
}

/* ===== SECTION ===== */
.section {
    width: 90%;
    max-width: 1200px;
    margin: 70px auto;
}

.section-header {
    margin-bottom: 32px;
}

.section-header p {
    color: var(--accent);
    letter-spacing: 4px;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.85;
}

.section-header h2 {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #ffffff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.05;
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 50px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
    border-color: rgba(79, 110, 247, 0.2);
    box-shadow: 0 0 50px rgba(79, 110, 247, 0.06);
}

.about-card p {
    color: var(--text-secondary);
    line-height: 2;
    font-size: 17px;
}

.about-card strong {
    color: white;
}

/* ===== SKILLS ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.skill-card {
    text-align: center;
    padding: 36px 18px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
}

.skill-card:hover {
    transform: translateY(-10px);
    background: var(--accent-soft);
    border-color: var(--accent-border);
    box-shadow: 0 20px 50px rgba(79, 110, 247, 0.12);
}

.skill-card i {
    font-size: 44px;
    margin-bottom: 14px;
    color: #8a8f9e;
    transition: color 0.3s, transform 0.3s;
    display: block;
}

.skill-card:hover i {
    transform: scale(1.15);
}

.skill-card span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Colored icons on hover */
.skill-card:hover .fa-html5   { color: #e34f26; }
.skill-card:hover .fa-css3-alt { color: #264de4; }
.skill-card:hover .fa-js       { color: #f7df1e; }
.skill-card:hover .fa-php      { color: #8892be; }
.skill-card:hover .fa-python   { color: #3572a5; }
.skill-card:hover .fa-database { color: #00c7c7; }
.skill-card:hover .fa-shield-alt { color: #22c55e; }
.skill-card:hover .fa-rocket   { color: #ff6b35; }

/* ===== SWITCH BUTTONS ===== */
.switch-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 36px;
}

.switch-btn {
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 14px 26px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: all 0.35s;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}

.switch-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: white;
}

.switch-btn.active {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 24px rgba(79, 110, 247, 0.4);
}

/* ===== PORTFOLIO & CERTIFICATES GRIDS ===== */
.portfolio-grid,
.certificates-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-grid.active-grid,
.certificates-grid.active-grid {
    display: grid;
    opacity: 1;
    transform: translateY(0);
}

.portfolio-grid.active-grid .project-card,
.certificates-grid.active-grid .cert-card {
    animation: cardWave 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.portfolio-grid.active-grid .project-card:nth-child(1),
.certificates-grid.active-grid .cert-card:nth-child(1) { animation-delay: 0.05s; }
.portfolio-grid.active-grid .project-card:nth-child(2),
.certificates-grid.active-grid .cert-card:nth-child(2) { animation-delay: 0.1s; }
.portfolio-grid.active-grid .project-card:nth-child(3),
.certificates-grid.active-grid .cert-card:nth-child(3) { animation-delay: 0.15s; }
.portfolio-grid.active-grid .project-card:nth-child(4),
.certificates-grid.active-grid .cert-card:nth-child(4) { animation-delay: 0.2s; }
.portfolio-grid.active-grid .project-card:nth-child(5),
.certificates-grid.active-grid .cert-card:nth-child(5) { animation-delay: 0.25s; }
.portfolio-grid.active-grid .project-card:nth-child(6),
.certificates-grid.active-grid .cert-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardWave {
    0%   { opacity: 0; transform: translateY(30px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.portfolio-grid:not(.active-grid),
.certificates-grid:not(.active-grid) {
    opacity: 0;
    transform: translateY(15px);
}

/* ===== CARD THUMB HOVER-VIDEO ===== */

.card-thumb-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: #0a0c12;
}

.card-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.6s ease;
    z-index: 2;
}

.card-thumb-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    z-index: 2;
    transition: opacity 0.4s ease, transform 0.6s ease;
}

.project-card:hover .card-thumb-canvas {
    transform: scale(1.05);
}

.card-thumb-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 3;
}

/* Видео без картинки — само является превью */
.card-thumb-video--solo {
    opacity: 1;
}

.project-card:hover .card-thumb-img {
    transform: scale(1.05);
}

.card-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: opacity 0.3s;
}

.card-play-icon i {
    font-size: 40px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(79, 110, 247, 0.3);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    border: 2px solid rgba(79, 110, 247, 0.5);
    transition: all 0.3s;
    padding-left: 4px;
}

.project-card:hover .card-play-icon i {
    transform: scale(1.12);
    background: rgba(79, 110, 247, 0.5);
    box-shadow: 0 0 30px rgba(79, 110, 247, 0.4);
}

/* ===== PROCESS SECTION ===== */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 0;
}

.process-step {
    position: relative;
    padding: 32px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.process-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    opacity: 0;
    transition: opacity 0.4s;
}

.process-step:hover::before {
    opacity: 1;
}

.process-step:hover {
    transform: translateY(-6px);
    border-color: var(--accent-border);
    background: var(--accent-soft);
    box-shadow: 0 20px 50px rgba(79, 110, 247, 0.1);
}

.process-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 16px;
    display: block;
}

.process-step i {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: 16px;
    display: block;
    transition: transform 0.3s;
}

.process-step:hover i {
    transform: scale(1.15) rotate(-5deg);
}

.process-step h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.process-step p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== PROJECT CARDS (UPGRADED) ===== */
.project-card,
.cert-card {
    overflow: hidden;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 110, 247, 0.05), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
    pointer-events: none;
}

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

.project-card:hover,
.cert-card:hover {
    transform: translateY(-10px);
    border-color: rgba(79, 110, 247, 0.3);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(79, 110, 247, 0.1);
}

.project-card img,
.cert-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.project-card:hover img,
.cert-card:hover img {
    transform: scale(1.05);
}

.project-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    position: relative;
    z-index: 2;
}

.project-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.project-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Tech tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.project-tag {
    padding: 4px 10px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #a8b4f8;
    letter-spacing: 0.3px;
}

/* View button on card */
.project-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    transition: all 0.3s;
    align-self: flex-start;
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.3);
}

.project-card:hover .project-view-btn {
    transform: translateX(3px);
    box-shadow: 0 6px 24px rgba(79, 110, 247, 0.5);
}

/* ===== REVIEWS ===== */
.review-card {
    padding: 50px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(79, 110, 247, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(79, 110, 247, 0.15);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.review-card:hover {
    border-color: rgba(79, 110, 247, 0.3);
    box-shadow: 0 0 60px rgba(79, 110, 247, 0.08);
}

.review-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    align-items: flex-start;
}

.review-mini {
    color: var(--accent);
    letter-spacing: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.review-card h2 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(135deg, white, #a8b4f8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.review-number {
    font-size: 52px;
    font-weight: 800;
    background: linear-gradient(135deg, #f7df1e, #ffa94d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.review-text {
    color: var(--text-muted);
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.7;
}

/* ===== FOOTER ===== */
footer {
    margin-top: 70px;
    padding: 60px 8% 40px;
    border-top: 1px solid var(--border);
    background: rgba(7, 9, 13, 0.6);
    backdrop-filter: blur(20px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

footer h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.footer-links p {
    margin-bottom: 10px;
    color: #888;
    font-size: 14px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: #0e1118;
    border-radius: 32px;
    padding: 25px;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.5s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(79, 110, 247, 0.2);
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-media-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.modal-media-container img,
.modal-media-container video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 20px;
    display: block;
    margin: 0 auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    font-size: 28px;
    z-index: 10;
    color: white;
    background: rgba(255, 255, 255, 0.07);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    background: rgba(79, 110, 247, 0.3);
    transform: rotate(90deg);
}

.modal-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.modal-controls button {
    border: none;
    cursor: pointer;
    padding: 11px 26px;
    border-radius: 30px;
    background: rgba(79, 110, 247, 0.1);
    border: 1px solid rgba(79, 110, 247, 0.2);
    color: white;
    font-size: 18px;
    transition: all 0.3s;
}

.modal-controls button:hover {
    background: rgba(79, 110, 247, 0.3);
    border-color: rgba(79, 110, 247, 0.5);
    transform: scale(1.07);
}

/* ===== REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(45px);
    transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ===== LOADER ===== */
#loader {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    overflow: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loader::before {
    content: '';
    position: absolute;
    inset: -10%;
    background-image: url('image/загрузка.jpg');
    background-size: cover;
    background-position: center;
    animation: loaderKenBurns 6s ease-in-out infinite alternate;
    z-index: 0;
}

#loader::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(7,9,13,0.55) 0%, rgba(3,5,7,0.88) 100%);
    z-index: 1;
}

@keyframes loaderKenBurns {
    0%   { transform: scale(1)    translateX(0)     translateY(0); }
    33%  { transform: scale(1.08) translateX(-1%)   translateY(-1%); }
    66%  { transform: scale(1.05) translateX(1%)    translateY(1%); }
    100% { transform: scale(1.1)  translateX(-0.5%) translateY(0.5%); }
}

/* Синие блики поверх загрузчика */
#loader .loader-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    animation: orbDrift 5s ease-in-out infinite alternate;
}

#loader .loader-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79,110,247,0.22), transparent 70%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

#loader .loader-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.18), transparent 70%);
    bottom: -80px;
    left: -80px;
    animation-delay: -2.5s;
}

@keyframes orbDrift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.1); }
}

.loader-content {
    text-align: center;
    animation: loaderFloat 0.6s ease-out;
    position: relative;
    z-index: 2;
}

@keyframes loaderFloat {
    0%   { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.loader-logo {
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -3px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent) 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: textShine 1.2s ease infinite;
    margin-bottom: 30px;
    position: relative;
}

@keyframes textShine {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.loader-logo span {
    background: linear-gradient(135deg, #7b7b7b, #3a3a3a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.loader-logo::before,
.loader-logo::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    top: 50%;
    transform: translateY(-50%);
    animation: orbPulse 1.2s infinite ease-in-out;
}

.loader-logo::before { left: -25px; animation-delay: 0s; }
.loader-logo::after  { right: -25px; animation-delay: 0.6s; }

@keyframes orbPulse {
    0%, 100% { opacity: 0.2; transform: translateY(-50%) scale(0.8); }
    50%       { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

.loader-line {
    width: 280px;
    height: 3px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 auto 18px auto;
}

.loader-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, #8b5cf6 50%, var(--accent) 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: loaderAnimation 2.5s cubic-bezier(0.65, 0, 0.35, 1) forwards, shimmer 0.8s linear infinite;
}

@keyframes loaderAnimation {
    0%   { width: 0%; }
    100% { width: 100%; }
}

@keyframes shimmer {
    0%   { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.loader-text {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

.loader-hide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* ===== LANGUAGE SWITCH ===== */
.lang-switch-bottom {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: rgba(79, 110, 247, 0.1);
    border: 1px solid rgba(79, 110, 247, 0.25);
    backdrop-filter: blur(25px);
    padding: 11px 18px;
    border-radius: 50px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 600;
    color: #a8b4f8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lang-switch-bottom:hover {
    transform: translateY(-3px);
    background: rgba(79, 110, 247, 0.2);
    border-color: rgba(79, 110, 247, 0.4);
    box-shadow: 0 8px 30px rgba(79, 110, 247, 0.2);
}

/* ===== PWA NAV BTN ===== */
#pwaNavBtn {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(79, 110, 247, 0.1);
    border: 1px solid rgba(79, 110, 247, 0.25);
    color: #a8b4f8;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    white-space: nowrap;
}

#pwaNavBtn:hover {
    background: rgba(79, 110, 247, 0.2);
    border-color: rgba(79, 110, 247, 0.45);
    color: white;
    transform: translateY(-2px);
}

/* ===== PWA MODAL STEPS ===== */
.pwa-steps { display: flex; flex-direction: column; gap: 12px; }
.pwa-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
}
.pwa-num {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
}
.pwa-step p { margin: 0; color: #d0d0d0; font-size: 14px; line-height: 1.5; }
.pwa-step strong { color: white; }
.pwa-tab.active {
    background: rgba(79, 110, 247, 0.15) !important;
    color: white !important;
    border-color: rgba(79, 110, 247, 0.4) !important;
}
#pwaInstallDirect:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.1);
}

/* ===== PWA BANNER ANIMATIONS ===== */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(120%); }
}
@keyframes pwaModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== CERT CARD WRAPPER ===== */
.cert-image-wrapper {
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}
.cert-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}
.cert-card:hover .cert-image { transform: scale(1.05); }

/* ===== MEDIA QUERIES ===== */
@media (max-width: 1000px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 130px;
        gap: 48px;
    }
    .hero h1 { font-size: 60px; letter-spacing: -2.5px; }
    .hero-buttons { justify-content: center; }
    .hero-stats {
        flex-direction: row;
        justify-content: center;
        max-width: 440px;
        margin: 0 auto;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 76px;
        left: 0;
        width: 100%;
        background: rgba(7, 9, 13, 0.97);
        backdrop-filter: blur(30px);
        padding: 28px 32px;
        border-radius: 24px;
        gap: 18px;
        text-align: center;
        border: 1px solid var(--border);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }
    .nav-links.show { display: flex; }
    .menu-btn { display: block; }
    .avatar { width: 310px; height: 400px; }
    .review-top { flex-direction: column; gap: 16px; }
    .footer-content { flex-direction: column; }
    .section-header h2 { font-size: 40px; }
    .modal-content { width: 95%; padding: 15px; }
    .modal-media-container img,
    .modal-media-container video { max-height: 50vh; }
    .modal-controls button { padding: 10px 20px; font-size: 15px; }
    .close-modal { top: 10px; right: 14px; width: 34px; height: 34px; font-size: 22px; }
    .skills-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .portfolio-grid, .certificates-grid { grid-template-columns: 1fr 1fr; }
    .glass-card { padding: 28px 22px; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 44px; letter-spacing: -2px; }
    .hero-description { font-size: 15px; }
    .hero-stats { flex-direction: column; max-width: 300px; }
    .stat-card h3 { font-size: 30px; }
    .section { margin: 45px auto; }
    .section-header { margin-bottom: 24px; }
    .section-header h2 { font-size: 32px; }
    .switch-buttons { flex-direction: column; align-items: stretch; }
    .review-card { padding: 28px 22px; }
    .review-card h2 { font-size: 36px; }
    .review-number { font-size: 40px; }
    .portfolio-grid, .certificates-grid { grid-template-columns: 1fr; }
    .lang-switch-bottom { padding: 10px 16px; font-size: 12px; bottom: 18px; right: 18px; }
    .avatar { width: 260px; height: 340px; }
    .glass-card { padding: 22px 18px; }
    .hero-buttons { flex-direction: column; align-items: stretch; }
    .hero-buttons .btn { justify-content: center; }
    .navbar { width: 94%; padding: 13px 20px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 36px; letter-spacing: -1.5px; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .section-header h2 { font-size: 26px; }
}