/* ========================================= */
/* ===== Цифровой дизайн ===== */
/* ========================================= */

/* ===== ОСНОВНЫЕ СТИЛИ С ОПТИМИЗАЦИЕЙ ===== */
.aetherion-skills-showcase {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    contain: layout style paint;
    padding-bottom: 4rem;
}

/* Заголовок */
.aetherion-skills-header {
    text-align: left;
    margin-bottom: 60px;
    width: 100%;
    max-width: 75rem;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.aetherion-skills-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 4vw + 1rem, 2.8rem);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-align: left;
    text-shadow: var(--shadow-sm);
    will-change: transform;
}

.title-line {
    display: block;
    margin-bottom: 0.5rem;
}

.word-wrapper {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}

.title-word {
    display: inline-block;
    transform: translateY(100%);
    animation: wordReveal 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.title-line:nth-child(1) .word-wrapper:nth-child(1) .title-word { animation-delay: 0.1s; }
.title-line:nth-child(1) .word-wrapper:nth-child(2) .title-word { animation-delay: 0.3s; }
.title-line:nth-child(2) .word-wrapper:nth-child(1) .title-word { animation-delay: 0.5s; }
.title-line:nth-child(2) .word-wrapper:nth-child(2) .title-word { animation-delay: 0.7s; }

@keyframes wordReveal {
    from {
        transform: translateY(100%) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotateX(0);
        opacity: 1;
    }
}

.accent-word {
    background: var(--color-secondary);
    -webkit-background-clip: text;
    background-clip: text;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: transparent;
}

.accent-word:hover {
    color: var(--color-secondary);
}

/* Вращающиеся слова */
.rotating-words {
    position: relative;
    display: inline-block;
}

.rotating-word {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: var(--color-secondary);
    -webkit-background-clip: text;
    background-clip: text;
    color: var(--color-secondary);
}

.rotating-word.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
}

/* Подзаголовок */
.aetherion-skills-subtitle {
    font-family: var(--font-primary);
    font-size: clamp(0.9375rem, 1.2vw + 0.5rem, 1.0625rem);
    color: var(--color-text);
    line-height: 1.6;
    max-width: 600px;
    margin: 0;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) 1s forwards;
    text-align: left;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== СЕТКА КАРТОЧЕК С ОПТИМИЗАЦИЕЙ ===== */
.aetherion-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 20px;
    align-items: start;
    padding: 0 5px;
    width: 100%;
    box-sizing: border-box;
}

.aetherion-skill-card {
    position: relative;
    background: color-mix(in srgb, var(--color-surface) 90%, transparent);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: transform var(--transition-slow), 
                box-shadow var(--transition-slow);
    box-shadow: 
        var(--shadow-md),
        inset 0 1px 0 color-mix(in srgb, var(--color-text) 5%, transparent);
    height: 450px;
    will-change: transform;
    opacity: 0;
    transform: translateY(30px);
    animation: cardAppear 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    touch-action: pan-y;
    width: 100%;
    box-sizing: border-box;
    contain: layout style paint;
    border-radius: 30px;
    border: 1px solid var(--color-border);
}

.aetherion-skill-card[data-card-index="0"] { animation-delay: 1.2s; }
.aetherion-skill-card[data-card-index="1"] { animation-delay: 1.3s; }
.aetherion-skill-card[data-card-index="2"] { animation-delay: 1.4s; }
.aetherion-skill-card[data-card-index="3"] { animation-delay: 1.5s; }
.aetherion-skill-card[data-card-index="4"] { animation-delay: 1.6s; }
.aetherion-skill-card[data-card-index="5"] { animation-delay: 1.7s; }
.aetherion-skill-card[data-card-index="6"] { animation-delay: 1.8s; }
.aetherion-skill-card[data-card-index="7"] { animation-delay: 1.9s; }

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aetherion-skill-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--color-secondary) 20%, transparent);
    box-shadow: 
        var(--shadow-lg),
        inset 0 1px 0 color-mix(in srgb, var(--color-text) 10%, transparent);
}

.aetherion-skill-media {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-surface-light) 0%, var(--color-surface) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    contain: layout style paint;
}

.aetherion-skill-icon {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 2;
    color: color-mix(in srgb, var(--color-text) 90%, transparent);
    font-size: 1.8rem;
    transition: all var(--transition-standard);
    will-change: transform;
}

.aetherion-skill-card:hover .aetherion-skill-icon {
    transform: scale(1.1);
    color: var(--color-secondary);
}

.aetherion-skill-image,
.aetherion-skill-video {
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-standard), filter var(--transition-standard);
    filter: brightness(0.90);
    will-change: transform, filter;
}

.aetherion-skill-card:hover .aetherion-skill-image,
.aetherion-skill-card:hover .aetherion-skill-video {
    transform: scale(1.05);
    filter: brightness(0.25);
}

.elementor img {height: 100%;}

/* Бейджи */
.aetherion-telegram-badge,
.aetherion-shorts-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--color-text);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border-medium);
    will-change: transform;
}

.aetherion-telegram-badge {
    background: linear-gradient(135deg, #0088cc, #00aced);
}

.aetherion-shorts-badge {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
}

/* Оверлей с оптимизацией */
.aetherion-skill-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 35px 25px 25px;
    opacity: 0;
    transition: opacity var(--transition-standard);
    z-index: 2;
    pointer-events: none;
}

.aetherion-skill-card:hover .aetherion-skill-overlay,
.aetherion-skill-card.active .aetherion-skill-overlay {
    opacity: 1;
}

.aetherion-content-background {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: color-mix(in srgb, var(--color-bg) 80%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform-origin: bottom;
    transform: scaleY(0);
    transition: all var(--transition-standard);
    border-top: 1px solid color-mix(in srgb, var(--color-secondary) 15%, transparent);
    z-index: 1;
    border-radius: 8px;
    clip-path: polygon(0% 10%, 100% 0%, 100% 100%, 0% 100%);
    will-change: transform;
}

.aetherion-skill-card:hover .aetherion-content-background,
.aetherion-skill-card.active .aetherion-content-background {
    height: 50%;
    transform: scaleY(1);
}

.aetherion-skill-content {
    position: relative;
    z-index: 3;
    transform: translateY(20px);
    transition: transform var(--transition-standard) 0.1s, opacity var(--transition-standard) 0.1s;
    width: 100%;
    opacity: 0;
    pointer-events: auto;
    will-change: transform, opacity;
}

.aetherion-skill-card:hover .aetherion-skill-content,
.aetherion-skill-card.active .aetherion-skill-content {
    transform: translateY(0);
    opacity: 1;
}

.aetherion-skill-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
    font-family: var(--font-primary);
    line-height: 1.3;
}

.aetherion-skill-desc {
    color: color-mix(in srgb, var(--color-text) 95%, transparent);
    margin-bottom: 0px;
    line-height: 1.5;
    font-size: 0.9rem;
    font-weight: 400;
}

/* Список фич */
.aetherion-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0 20px;
}

.aetherion-feature {
    background: color-mix(in srgb, var(--color-secondary) 16%, transparent);
    backdrop-filter: blur(20px);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--color-secondary) 43%, transparent);
    color: color-mix(in srgb, var(--color-text) 95%, transparent);
    font-weight: 500;
    transition: all var(--transition-standard);
    will-change: transform;
}

.aetherion-feature:hover {
    background: color-mix(in srgb, var(--color-secondary) 30%, transparent);
    border-color: color-mix(in srgb, var(--color-secondary) 20%, transparent);
    transform: translateY(-1px);
}

/* Ссылка */
.aetherion-skill-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-standard);
    font-size: 0.9rem;
    padding: 8px 0;
    position: relative;
    will-change: transform;
}

.aetherion-skill-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width var(--transition-standard);
}

.aetherion-skill-link:hover::after {
    width: 100%;
}

.aetherion-skill-link:hover {
    color: var(--color-secondary);
    transform: translateX(5px);
}

/* ===== АДАПТИВНОСТЬ С ОПТИМИЗАЦИЕЙ ===== */
@media (max-width: 1200px) {
    .aetherion-portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .aetherion-skills-showcase {
        padding: 45px 10px;
    }
   
    .aetherion-skills-header {
        margin-bottom: 30px;
    }
   
    .aetherion-skills-title {
        font-size: clamp(1.8rem, 6vw + 1rem, 2.8rem);
        margin-bottom: 1rem;
    }
   
    .aetherion-skills-subtitle {
        font-size: clamp(0.875rem, 3vw + 0.5rem, 1rem);
        max-width: 100%;
    }
   
    .aetherion-portfolio-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
   
    .aetherion-skill-card {
        height: 350px;
        animation-duration: 0.4s;
        animation-delay: 0s !important;
    }
   
    /* Оптимизированные стили для мобильных */
    .aetherion-skill-overlay {
        padding: 25px 20px 20px;
        opacity: 0;
    }
   
    .aetherion-content-background {
        height: 0 !important;
        transform: scaleY(0) !important;
        background: color-mix(in srgb, var(--color-bg) 98%, transparent);
        clip-path: polygon(0% 5%, 100% 0%, 100% 100%, 0% 100%);
    }
   
    .aetherion-skill-content {
        transform: translateY(20px);
        opacity: 0;
    }
   
    /* Активное состояние для мобильных */
    .aetherion-skill-card.active .aetherion-skill-overlay {
        opacity: 1;
    }
   
    .aetherion-skill-card.active .aetherion-content-background {
        height: 55% !important;
        transform: scaleY(1) !important;
    }
   
    .aetherion-skill-card.active .aetherion-skill-content {
        transform: translateY(0);
        opacity: 1;
    }
   
    /* Отключаем hover-эффекты на мобильных */
    .aetherion-skill-card:hover {
        transform: none;
    }
   
    .aetherion-skill-card:hover .aetherion-skill-image,
    .aetherion-skill-card:hover .aetherion-skill-video {
        transform: none;
    }
   
    .aetherion-skill-card:hover .aetherion-skill-overlay,
    .aetherion-skill-card:hover .aetherion-content-background,
    .aetherion-skill-card:hover .aetherion-skill-content {
        opacity: 0;
        transform: translateY(20px);
        height: 0;
    }
}

@media (max-width: 480px) {
    .aetherion-skill-card {
        height: 320px;
    }
   
    .aetherion-skill-overlay {
        padding: 20px 15px 15px;
    }
   
    .aetherion-skill-card.active .aetherion-content-background {
        height: 60% !important;
    }
   
    .aetherion-skill-icon {
        top: 15px;
        left: 15px;
        font-size: 1.5rem;
    }
   
    .aetherion-telegram-badge,
    .aetherion-shorts-badge {
        top: 15px;
        right: 15px;
        font-size: 0.7rem;
        padding: 5px 10px;
    }
   
    .aetherion-skill-title {
        font-size: 1.2rem;
    }
   
    .aetherion-skill-desc {
        font-size: 0.8rem;
    }
   
    .aetherion-features-list {
        gap: 5px;
    }
   
    .aetherion-feature {
        font-size: 0.65rem;
    }
}

/* Дополнительные оптимизации */
html, body {
    overflow-x: hidden;
}

.aetherion-skills-showcase * {
    box-sizing: border-box;
}

/* Отключаем анимации для пользователей, которые их предпочитают не использовать */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== ОПТИМИЗИРОВАННЫЕ АНИМАЦИИ ДЛЯ ПОЯВЛЕНИЯ ===== */
.aetherion-skill-card {
    position: relative;
    background: color-mix(in srgb, var(--color-surface) 90%, transparent);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: transform var(--transition-slow), 
                box-shadow var(--transition-slow);
    box-shadow: 
        var(--shadow-md),
        inset 0 1px 0 color-mix(in srgb, var(--color-text) 5%, transparent);
    height: 450px;
    will-change: transform, opacity;
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    touch-action: pan-y;
    width: 100%;
    box-sizing: border-box;
    contain: layout style paint;
}

/* Убираем статические animation-delay, теперь они будут через JS */
.aetherion-skill-card.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Ступенчатая анимация через CSS переменные */
.aetherion-skill-card.revealed:nth-child(1) { transition-delay: 0.1s; }
.aetherion-skill-card.revealed:nth-child(2) { transition-delay: 0.2s; }
.aetherion-skill-card.revealed:nth-child(3) { transition-delay: 0.3s; }
.aetherion-skill-card.revealed:nth-child(4) { transition-delay: 0.4s; }
.aetherion-skill-card.revealed:nth-child(5) { transition-delay: 0.5s; }
.aetherion-skill-card.revealed:nth-child(6) { transition-delay: 0.6s; }
.aetherion-skill-card.revealed:nth-child(7) { transition-delay: 0.7s; }
.aetherion-skill-card.revealed:nth-child(8) { transition-delay: 0.8s; }

/* Улучшенный ховер-эффект */
.aetherion-skill-card.revealed:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: color-mix(in srgb, var(--color-secondary) 20%, transparent);
    box-shadow: 
        var(--shadow-lg),
        inset 0 1px 0 color-mix(in srgb, var(--color-text) 10%, transparent);
}

/* ===== УЛУЧШЕНИЯ ПЛАВНОСТИ АНИМАЦИЙ ===== */
.aetherion-skills-showcase {
    transform: translateZ(0); /* Аппаратное ускорение */
}

.aetherion-portfolio-grid {
    transform: translateZ(0);
}

/* Плавный скролл для всей страницы */
html {
    scroll-behavior: smooth;
}

/* Оптимизация для быстрых анимаций */
@media (prefers-reduced-motion: no-preference) {
    .aetherion-skill-card {
        transition: all var(--transition-slow);
    }
}

/* Для пользователей, которые предпочитают уменьшенное движение */
@media (prefers-reduced-motion: reduce) {
    .aetherion-skill-card {
        transition: opacity var(--transition-standard);
        transform: none !important;
    }
    
    .aetherion-skill-card.revealed {
        opacity: 1;
    }
}