/* パーティクル背景 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* タイピングアニメーション */
.typing-text {
    border-right: 3px solid #ff6b6b;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {
    0%, 50% { border-color: #ff6b6b; }
    51%, 100% { border-color: transparent; }
}

/* フェードイン・スライドイン */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* パルスアニメーション */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* グリッチエフェクト */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch-effect {
    position: relative;
    animation: glitch 0.3s infinite;
}

.glitch-effect::before,
.glitch-effect::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-effect::before {
    left: 2px;
    text-shadow: -2px 0 #ff6b6b;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-effect::after {
    left: -2px;
    text-shadow: -2px 0 #8B0000;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 20px, 0); }
    20% { clip: rect(30px, 9999px, 40px, 0); }
    40% { clip: rect(50px, 9999px, 60px, 0); }
    60% { clip: rect(70px, 9999px, 80px, 0); }
    80% { clip: rect(90px, 9999px, 100px, 0); }
    100% { clip: rect(110px, 9999px, 120px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(20px, 9999px, 30px, 0); }
    20% { clip: rect(40px, 9999px, 50px, 0); }
    40% { clip: rect(60px, 9999px, 70px, 0); }
    60% { clip: rect(80px, 9999px, 90px, 0); }
    80% { clip: rect(100px, 9999px, 110px, 0); }
    100% { clip: rect(120px, 9999px, 130px, 0); }
}

/* グラデーションアニメーション */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: linear-gradient(-45deg, #8B0000, #ff0000, #ff6b6b, #1a0000, #8B0000);
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 3D回転アニメーション */
@keyframes rotate3d {
    0% {
        transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    }
    25% {
        transform: perspective(1000px) rotateY(90deg) rotateX(10deg);
    }
    50% {
        transform: perspective(1000px) rotateY(180deg) rotateX(0deg);
    }
    75% {
        transform: perspective(1000px) rotateY(270deg) rotateX(-10deg);
    }
    100% {
        transform: perspective(1000px) rotateY(360deg) rotateX(0deg);
    }
}

.rotate-3d {
    animation: rotate3d 10s linear infinite;
    transform-style: preserve-3d;
}

/* バッジアニメーション */
@keyframes badge-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.1);
    }
}

.badge {
    animation: badge-bounce 3s ease-in-out infinite;
    transition: all 0.3s;
}

.badge:nth-child(1) { animation-delay: 0s; }
.badge:nth-child(2) { animation-delay: 0.2s; }
.badge:nth-child(3) { animation-delay: 0.4s; }
.badge:nth-child(4) { animation-delay: 0.6s; }
.badge:nth-child(5) { animation-delay: 0.8s; }

.badge:hover {
    transform: scale(1.2) rotate(5deg);
    animation-play-state: paused;
}

/* カードフローティング */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(1deg);
    }
    66% {
        transform: translateY(-10px) rotate(-1deg);
    }
}

.card {
    animation: float 6s ease-in-out infinite;
}

.card:nth-child(odd) {
    animation-delay: 0s;
}

.card:nth-child(even) {
    animation-delay: 1s;
    animation-direction: reverse;
}

/* テキストシャイン */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shine-text {
    background: linear-gradient(90deg, #ffffff 0%, #ff6b6b 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 3s linear infinite;
}

/* マウス追従エフェクト */
.mouse-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff6b6b, transparent);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s;
}

/* ナビゲーションアニメーション */
@keyframes nav-slide {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

nav ul li {
    animation: nav-slide 0.5s ease-out forwards;
    opacity: 0;
}

nav ul li:nth-child(1) { animation-delay: 0.1s; }
nav ul li:nth-child(2) { animation-delay: 0.2s; }
nav ul li:nth-child(3) { animation-delay: 0.3s; }
nav ul li:nth-child(4) { animation-delay: 0.4s; }

/* セクションアニメーション */
@keyframes section-enter {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

section {
    animation: section-enter 0.8s ease-out forwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }

/* タイムラインアニメーション */
@keyframes timeline-draw {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

.timeline {
    animation: timeline-draw 2s ease-out forwards;
}

@keyframes timeline-dot {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.timeline-item::before {
    animation: timeline-dot 0.5s ease-out forwards;
}

.timeline-item:nth-child(1)::before { animation-delay: 0.3s; }
.timeline-item:nth-child(2)::before { animation-delay: 0.6s; }
.timeline-item:nth-child(3)::before { animation-delay: 0.9s; }

/* リンクホバーアニメーション */
@keyframes link-glow {
    0%, 100% {
        text-shadow: 0 0 5px #ff6b6b, 0 0 10px #ff6b6b, 0 0 15px #ff6b6b;
    }
    50% {
        text-shadow: 0 0 10px #ff6b6b, 0 0 20px #ff6b6b, 0 0 30px #ff6b6b, 0 0 40px #ff6b6b;
    }
}

.link-list a:hover {
    animation: link-glow 1s ease-in-out infinite;
}

/* ヘッダーアニメーション */
@keyframes header-enter {
    0% {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

header {
    animation: header-enter 1s ease-out;
}

@keyframes title-glow {
    0%, 100% {
        text-shadow: 3px 3px 6px #000000, 0 0 20px #8B0000, 0 0 30px #8B0000;
    }
    50% {
        text-shadow: 3px 3px 6px #000000, 0 0 30px #ff6b6b, 0 0 50px #ff6b6b, 0 0 70px #ff6b6b;
    }
}

header h1 {
    animation: title-glow 3s ease-in-out infinite;
}

/* フッターアニメーション */
@keyframes footer-enter {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    animation: footer-enter 1s ease-out 0.5s forwards;
    opacity: 0;
}

/* スクロールバーアニメーション */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8B0000, #ff0000, #ff6b6b);
    border-radius: 6px;
    animation: scrollbar-glow 2s ease-in-out infinite;
}

@keyframes scrollbar-glow {
    0%, 100% {
        box-shadow: 0 0 5px #ff6b6b;
    }
    50% {
        box-shadow: 0 0 20px #ff6b6b, 0 0 30px #ff6b6b;
    }
}

/* ローディングアニメーション */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader {
    border: 4px solid #000000;
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

/* リップルエフェクト */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.5);
    animation: ripple 1s ease-out;
    pointer-events: none;
}
