/* ========================================
   カスタムCSS - ひきこまれパンダポートフォリオ
======================================== */

:root {
    --primary-blue: #3b82f6;
    --primary-purple: #a855f7;
    --primary-pink: #ec4899;
    --primary-green: #10b981;
    --bg-dark: #111827;
    --bg-gray: #1f2937;
    --text-light: #f3f4f6;
    --text-gray: #9ca3af;
    --border-gray: #374151;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   グリッドパターン背景
======================================== */
.bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ========================================
   アニメーション
======================================== */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
    }
}

.animate-fade-in {
    animation: fade-in 1s ease-out;
}

.animate-slide-up {
    animation: slide-up 0.8s ease-out;
}

.animate-slide-up.delay-200 {
    animation-delay: 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.animate-slide-up.delay-400 {
    animation-delay: 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.animate-slide-up.delay-600 {
    animation-delay: 0.6s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float.delay-1000 {
    animation-delay: 1s;
}

.animate-float.delay-2000 {
    animation-delay: 2s;
}

.animate-float.delay-3000 {
    animation-delay: 3s;
}

/* ========================================
   ナビゲーション
======================================== */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ========================================
   カード効果
======================================== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ========================================
   グラデーションテキスト
======================================== */
.gradient-text {
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple), var(--primary-pink));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ========================================
   ボタン効果
======================================== */
.btn-gradient {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

/* ========================================
   ブログカードスタイル
======================================== */
.blog-card {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-gray);
    transition: all 0.3s ease;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-blue);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

/* ========================================
   タグスタイル
======================================== */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag:hover {
    transform: scale(1.05);
}

/* ========================================
   スクロールバーカスタマイズ
======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-blue), var(--primary-purple));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-purple), var(--primary-pink));
}

/* ========================================
   レスポンシブ調整
======================================== */
@media (max-width: 768px) {
    h2 {
        font-size: 2.5rem !important;
    }
    
    h3 {
        font-size: 2rem !important;
    }
    
    .blog-card-image {
        height: 180px;
    }
}

@media (max-width: 640px) {
    h2 {
        font-size: 2rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    .blog-card-image {
        height: 160px;
    }
}

/* ========================================
   ローディングアニメーション
======================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   モーダルスタイル
======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-gray);
    border-radius: 1rem;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
    border: 1px solid var(--border-gray);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* ========================================
   キャラクター画像スタイル
======================================== */
.character-image {
    transition: all 0.3s ease;
}

.character-image:hover {
    transform: scale(1.05) rotate(2deg);
}

/* ========================================
   セクション区切り線
======================================== */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), var(--primary-purple), transparent);
    margin: 4rem 0;
}

/* ========================================
   パララックス効果
======================================== */
.parallax {
    transition: transform 0.1s ease-out;
}

/* ========================================
   SNSリンクボタン
======================================== */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid var(--primary-blue);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* ========================================
   ロゴアニメーション
======================================== */
.logo-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ========================================
   プロジェクトカードグリッド
======================================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 640px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
}
/* ========================================
   カスタムカーソル
======================================== */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 9999px;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
    mix-blend-mode: screen;
    box-shadow: 0 0 18px rgba(102, 126, 234, 0.55);
}

.custom-cursor.is-visible { opacity: 1; }

.custom-cursor.is-hovering {
    width: 42px;
    height: 42px;
    border-color: rgba(240, 147, 251, 0.95);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 26px rgba(240, 147, 251, 0.7);
}

/* ========================================
   スクロールリビール
======================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: var(--reveal-delay, 0ms);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.tab-button,
.mobile-tab-button,
.platform-link,
.link-btn {
    -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
    .custom-cursor { display: none; }
    .scroll-reveal { opacity: 1; transform: none; }
}

/* ========================================
   パネル
======================================== */
.panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

.panel.active { display: block; }

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

/* ========================================
   ブログ
======================================== */
.blog-post {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ========================================
   フォーム
======================================== */
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========================================
   ロゴドロップスプラッシュ
======================================== */
.logo-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    pointer-events: none;
}

.logo-splash.hide {
    animation: splash-fade-out 1s ease-out forwards;
    animation-delay: 2s;
}

@keyframes splash-fade-out {
    to { opacity: 0; pointer-events: none; }
}

.logo-drop-container {
    position: relative;
    width: 80vmin;
    height: 80vmin;
    max-width: 900px;
    max-height: 900px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-drop-img {
    width: 70vmin;
    max-width: 800px;
    height: auto;
    animation: logo-drop-big 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
}

@keyframes logo-drop-big {
    0%   { transform: translateY(-400px) scale(0.8); opacity: 0; }
    10%  { opacity: 1; }
    80%  { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ========================================
   砂埃パーティクル
======================================== */
.dust-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(255, 200, 100, 1) 0%, rgba(255, 200, 100, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

@keyframes particle-burst {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

/* ========================================
   スキャンライン
======================================== */
.scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.02),
        rgba(0, 0, 0, 0.02) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 9999;
}

/* ========================================
   レトロゲーム風ボタン
======================================== */
.link-btn {
    position: relative;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow:
        4px 4px 0px rgba(0, 0, 0, 0.15),
        inset -2px -2px 0px rgba(0, 0, 0, 0.05);
    transition: all 0.08s;
    transform: translateY(0);
}

.link-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        6px 6px 0px rgba(0, 0, 0, 0.15),
        inset -2px -2px 0px rgba(0, 0, 0, 0.05);
}

.link-btn:active {
    transform: translateY(-1px);
    box-shadow:
        3px 3px 0px rgba(0, 0, 0, 0.15),
        inset -1px -1px 0px rgba(0, 0, 0, 0.05);
}
