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

@font-face {
    font-family: 'Onder Font';
    src: url('./fonts/OnderFont.woff2') format('woff2'),
         url('./fonts/OnderFont.woff') format('woff'),
         url('./fonts/OnderFont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background-color: #0a0a0a;
    overflow-x: hidden;
}

/* Контейнер для частиц */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

/* Шапка */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: relative;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    color: #000000;
    font-family: 'Onder Font', sans-serif;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #000000;
    font-weight: 500;
    transition: color 0.3s;
    font-family: 'Onder Font', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
}

.nav-links a:hover,
.mobile-nav-links a:hover {
    color: #007bff;
}

/* Гамбургер-меню */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #000000;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1100;
    padding: 80px 2rem 2rem;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transform: translateX(100%);   /* спрятано справа */
  opacity: 0;
  pointer-events: none;

  /* плавность */
  transition: transform .35s ease, opacity .2s ease;
}

.mobile-menu.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-links a {
    text-decoration: none;
    color: #000000;
    font-weight: 500;
    font-size: 1.1rem;
    font-family: 'Onder Font', sans-serif;
    transition: color 0.3s;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    letter-spacing: 0.5px;
}

.mobile-nav-links a:hover {
    color: #007bff;
}

.mobile-nav-links a:last-child {
    border-bottom: none;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.hero {
    height: 100vh;
    height: 100dvh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding-top: 80px;
}

.hero-video video {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100% - var(--header-height));
    object-fit: cover;
    z-index: -2;
}

.hero-video::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.hero-content {
    z-index: 2;
    padding: 0 1rem;
}

.hero-title {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #ffffff;
    font-family: 'Onder Font', sans-serif;
    letter-spacing: 1px;
    line-height: 1.5;
}

.hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
    font-weight: 300;
    color: #cccccc;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

.cta-button {
    padding: 1rem 2rem;
    font-size: 0.7rem;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.cta-button:hover {
    background: white;
    color: #0a0a0a;
}

.section-about-skills {
    padding: 1rem 1rem;;
}

section {
    padding: 5rem 2rem;
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #ffffff;
    font-family: 'Onder Font', sans-serif;
    letter-spacing: 1px;
}

.section-title-what {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #ffffff;
    font-family: 'Onder Font', sans-serif;
    letter-spacing: 1px;
}

.portfolio-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.portfolio-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    aspect-ratio: 16 / 9;
    transition: transform 0.3s, box-shadow 0.3s;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.2);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.portfolio-overlay h3 {
    font-family: 'Onder Font', sans-serif;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.portfolio-overlay p {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #cccccc;
    line-height: 1.5;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.about {
    background: #1a1a1a;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #cccccc;
}

.about-content p {
    margin-bottom: 2rem;
    font-family: 'Inter', sans-serif;
}

.contacts-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-info {
    margin-bottom: 2rem;
}

.email {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #cccccc;
    font-family: 'Inter', sans-serif;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    padding: 1rem 2rem;
    border: 1px solid #333;
    border-radius: 8px;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s;
    background: #1a1a1a;
    min-width: 120px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.telegram:hover {
    background: #0088cc;
    border-color: #0088cc;
}

.vk:hover {
    background: #0077FF;
    border-color: #0077FF;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: auto;
    aspect-ratio: 16 / 9;
}

.close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 8px;
}

/* Стили для частиц в модальном окне */
.modal #particles-js-modal {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

.about-skills { --bar-h: 10px; --radius: 999px; --bg: #f1f1f3; --fill: #6b4dff; --glow: #a995ff; --padding: 16px 0;}
.skills { display: grid; gap: 14px; list-style: none; padding: 0; margin: 12px 0 0; }
.skill { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; position: relative; }
.skill__name { font-weight: 600; }
.skill__tag { font-variant-numeric: tabular-nums; opacity: .75; }

.skill__bar {
  grid-column: 1 / -1;
  height: var(--bar-h);
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.skill__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fill), #8f73ff);
  border-radius: var(--radius);
  transition: width .6s ease;
  position: relative;
}

/* свечение для >100% (6/5) */
.skill.is-over .skill__fill {
  box-shadow:
    0 0 0 2px color-mix(in oklab, var(--glow) 30%, transparent),
    0 0 18px 4px color-mix(in oklab, var(--glow) 65%, transparent),
    0 0 42px 10px color-mix(in oklab, var(--glow) 50%, transparent);
}

/* лёгкий “маркер” на конце заполнения */
.skill__fill::after {
  content: "";
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 14px;
  filter: blur(6px);
  background: white;
  opacity: .35;
}

/* приглушаем строки 4/5 */
.skill.is-low { opacity: .65; }

/* уважаем reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skill__fill { transition: none; }
}

@supports not (aspect-ratio: 16 / 9) {
    .portfolio-item::before {
        content: '';
        display: block;
        padding-top: 56.25%;
    }

    .portfolio-item img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .portfolio-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .modal-content::before {
        content: '';
        display: block;
        padding-top: 56.25%;
    }

    .video-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Мобильные устройства (менее 768px) */
@media (max-width: 767px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
    }

    .nav {
        padding: 0 1rem;
    }

    .header {
        padding: 0.8rem 0;
    }

    .portfolio-grid {
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .logo a {
        font-size: 1.3rem;
    }

    .hero {
        padding-top: 70px;
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px);
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
        padding: 0 0.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .portfolio-overlay h3 {
        font-size: 0.5rem;
    }

    .portfolio-overlay p {
        font-size: 0.7rem;
    }

    .portfolio-item {
        aspect-ratio: 16 / 9;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .social-link {
        width: 200px;
    }

    section {
        padding: 3rem 0.5rem;
    }

    .modal {
        padding: 1rem;
    }

    .modal.active {
        align-items: flex-start;
        padding-top: 2rem;
    }

    .modal-content {
        max-width: 100%;
    }

    .close {
        top: -45px;
        right: 10px;
        font-size: 2rem;
        width: 35px;
        height: 35px;
    }

    /* Уменьшаем плотность частиц на мобильных */
    #particles-js {
        opacity: 0.7;
    }

    /* Улучшаем отображение мобильного меню */
    .mobile-menu {
        width: 85%;
        padding: 90px 1.5rem 2rem;
    }

    .mobile-nav-links a {
        font-size: 1rem;
        padding: 0.8rem 0;
    }
}

/* Десктопы (768px и больше) */
@media (min-width: 768px) {
    .hamburger {
        display: none;
    }

    .nav-links {
        display: flex;
    }

    .mobile-menu {
        display: none;
    }

    .overlay {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu { transition: none; }
  .overlay { transition: none; }
}

/* Планшеты (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.2rem;
    }
}

/* Большие экраны (1200px и больше) - 4 колонки */
@media (min-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Маленькие мобильные устройства */
@media (max-width: 480px) {
    .nav {
        padding: 0 0.8rem;
    }

    .header {
        padding: 0.6rem 0;
    }

    .logo a {
        font-size: 1.2rem;
    }

    .hamburger {
        width: 28px;
        height: 20px;
    }

    .hero {
        padding-top: 60px;
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px);
    }

    .hero-title {
        font-size: 1.3rem;
        margin-bottom: 0.6rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1.2rem;
    }

    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.65rem;
    }

    .modal {
        padding: 0.5rem;
    }

    .modal.active {
        padding-top: 1.5rem;
    }

    .close {
        top: -40px;
        font-size: 1.8rem;
        width: 30px;
        height: 30px;
    }

    .mobile-menu {
        width: 90%;
        padding: 80px 1rem 2rem;
    }

    .mobile-nav-links {
        gap: 1rem;
    }

    .mobile-nav-links a {
        font-size: 0.95rem;
        padding: 0.7rem 0;
    }

    section {
        padding: 2rem 0.5rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.1rem;
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }

    .mobile-menu {
        width: 95%;
    }
}

/* Анимация для плавного появления */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Предотвращение скролла при открытом меню */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Улучшение для Safari на iOS */
@supports (-webkit-touch-callout: none) {
    .hero {
        height: -webkit-fill-available;
    }

    .mobile-menu {
        height: -webkit-fill-available;
    }
}

:root {
  --header-height: 0px;
}

.hero {
  padding-top: var(--header-height);
}

.about-me {
  --gap: 12px;             /* компактно: маленькие отступы и бары */
  --bar-h: 6px;            /* уменьшенная высота прогресса */
  --bar-radius: 999px;
  --c-bg: rgba(255,255,255,.08);
  --c-fill: #7c3aed;       /* фиолетовый акцент (можно заменить) */
  --c-ghost: rgba(255,255,255,.5); /* текстовый вторичный */
}

.about-me h3 { margin: 0 0 12px; }

.skills-row {
  display: grid;
  gap: var(--gap);
  margin-bottom: 10px;
}

/* пирамидка: 2 / 3 / 4 колонки, центрируем ряд */
.skills-row--top    { grid-template-columns: repeat(2, minmax(180px, 1fr)); justify-items: center; }
.skills-row--mid    { grid-template-columns: repeat(3, minmax(160px, 1fr)); justify-items: center; }
.skills-row--bottom { grid-template-columns: repeat(4, minmax(140px, 1fr)); justify-items: center; }

/* Сетка 3×3 в блоке ОБО МНЕ */
.skills{
  display:grid;
  grid-template-columns:repeat(3,minmax(220px,1fr));
  gap:16px;
  max-width:960px;
  margin:16px auto 0;
  list-style:none;
  padding:0;
}

/* Карточка-плитка */
.skill{
  background:rgba(255,255,255,.08);
  border:1px solid #2a2a2a;
  border-radius:14px;
  padding:12px 14px;
  backdrop-filter:blur(6px);
  box-shadow:0 1px 6px rgba(0,0,0,.12);
  transition:transform .2s ease;
}
.skill:hover{ transform:translateY(-2px); }

/* Заголовок + рейтинг */
.skill__name{ font-size:12px; letter-spacing:.2px; }
.skill__tag{ font-size:11px; opacity:.6; float:right; }

/* Прогресс-бар компактный */
.skill__bar{
  height:6px;
  background:rgba(255,255,255,.14);
  border-radius:999px;
  overflow:hidden;
  margin-top:8px;
}
.skill__fill{
  display:block; height:100%; width:0%;
  background:linear-gradient(90deg,#6b4dff,#8f73ff);
  border-radius:999px;
  transition:width .5s ease;
}

/* Свечение для 6/5 и лёгкое приглушение 4/5 */
.skill[data-score="6"]{
  box-shadow:
    0 0 0 1px rgba(124,58,237,.25),
    0 0 18px rgba(124,58,237,.35),
    0 8px 24px rgba(124,58,237,.25);
}
.skill[data-score="6"] .skill__fill{ filter:drop-shadow(0 0 8px rgba(124,58,237,.7)); }
.skill[data-score="4"]{ opacity:.75; }

/* Мобильная адаптация: аккуратно сужаем сетку */
@media (max-width:700px){
  .skills{ grid-template-columns:repeat(2,minmax(160px,1fr)); }
}
@media (max-width:420px){
  .skills{ grid-template-columns:1fr; }
}
