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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(94, 114, 190, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(94, 114, 190, 0); }
    100% { box-shadow: 0 0 0 0 rgba(94, 114, 190, 0); }
}

.container {
    animation: fadeIn 0.4s ease-out;
}

.section {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.section:nth-of-type(1) { animation-delay: 0.05s; }
.section:nth-of-type(2) { animation-delay: 0.1s; }
.section:nth-of-type(3) { animation-delay: 0.15s; }
.section:nth-of-type(4) { animation-delay: 0.2s; }
.section:nth-of-type(5) { animation-delay: 0.25s; }

a, .btn, .nav-link, .post-card, .proj-item, .skill-item, .metric-card,
.post, .shout, .crt-table tbody tr {
    transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: var(--text-accent);
    color: var(--bg);
    border-color: var(--text-accent);
}

.btn.ghost:hover {
    background: var(--control-bg);
    color: var(--text-primary);
    border-color: var(--text-accent);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--text-accent);
}

.proj-item:hover,
.skill-item:hover {
    transform: translateX(4px);
}

.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}
.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.copy-btn {
    transition: opacity 0.2s, background 0.2s, transform 0.1s, color 0.2s;
}
.copy-btn:active {
    transform: scale(0.95);
}

#random-word {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.btn-start:not(:disabled) {
    animation: pulseGlow 2s infinite;
}
.btn-start:not(:disabled):hover {
    animation: none;
    transform: scale(1.02);
}
.btn-start.running {
    animation: pulseGlow 1.5s infinite;
    background: var(--text-accent);
    color: var(--bg);
    border-color: var(--text-accent);
}

.status-progress {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}
.post:nth-child(1) { animation-delay: 0.05s; }
.post:nth-child(2) { animation-delay: 0.1s; }
.post:nth-child(3) { animation-delay: 0.15s; }
.post:nth-child(4) { animation-delay: 0.2s; }
.post:nth-child(5) { animation-delay: 0.25s; }
.post:nth-child(6) { animation-delay: 0.3s; }
.post:nth-child(7) { animation-delay: 0.35s; }
.post:nth-child(8) { animation-delay: 0.4s; }
.post:nth-child(9) { animation-delay: 0.45s; }
.post:nth-child(10) { animation-delay: 0.5s; }

.audio-player {
    transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
                transform 0.3s cubic-bezier(0.2, 0, 0, 1);
    transform-origin: top;
}

.crt-table-wrap {
    animation: fadeIn 0.3s ease-out;
}
.crt-table tbody tr {
    animation: fadeIn 0.3s ease-out;
    animation-fill-mode: both;
}
.crt-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.crt-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.crt-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.crt-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.crt-table tbody tr:nth-child(5) { animation-delay: 0.25s; }

.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.2, 0, 0, 1),
                transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}
.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.shout {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}
.shout:nth-child(1) { animation-delay: 0.05s; }
.shout:nth-child(2) { animation-delay: 0.1s; }
.shout:nth-child(3) { animation-delay: 0.15s; }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .btn-start:not(:disabled) {
        animation: none;
    }
}