:root {
    --primary-color: #4682b4;
    --secondary-color: #87ceeb;
    --text-dark: #333;
    --text-light: #555;
    --text-muted: #666;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --transition-default: all 0.3s ease;
    --border-radius-default: 20px;
    --border-radius-small: 16px;
    --border-radius-card: 12px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: url('../images/background.png') center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    min-height: 100vh;
    padding: 20px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 470px 1fr;
    gap: 50px;
    min-height: calc(100vh - 40px);
}

/* 左側: 3D名刺コンテナ */
.business-card-container {
    height: calc(100vh - 40px);
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: flex-start;
}

/* 名刺回転エリア（ドラッグ有効範囲） */
.card-rotation-area {
    width: 450px; /* 名刺最大幅424px + 余白 */
    height: calc(100vh - 100px);
    max-height: 780px;
    min-height: 480px;
    position: relative;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-rotation-area:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-rotation-area:active {
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

/* 3D名刺 */
.card-3d {
    height: calc(100vh - 120px);
    max-height: 700px;
    min-height: 400px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    /* 名刺の実際の比率 91:55 に調整 */
    aspect-ratio: 55 / 91;
}


.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-front {
    transform: rotateY(0deg);
}

.card-back {
    transform: rotateY(180deg);
}


.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* 操作ヒント */
.card-hint {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    font-size: 0.85rem;
    color: #666;
}

.card-hint p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.card-hint i {
    color: #4682b4;
}


/* 右側: 自己紹介ブロック */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.about-content section {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-default);
    box-shadow: var(--glass-shadow);
    padding: 30px;
    animation: fadeInUp 0.6s ease forwards;
    will-change: transform;
}

.about-content section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.about-content section h2 i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.about-content section p {
    color: #555;
    margin-bottom: 15px;
}

/* プロフィールショーケース */
.profile-showcase {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 25px;
}

@media (max-width: 1600px) {
    .profile-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1100px) {
    .profile-showcase {
        grid-template-columns: 1fr;
    }
}

.profile-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(135, 206, 235, 0.4);
    border-color: rgba(0, 0, 0, 0.2);
}

.profile-card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: var(--border-radius-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(135, 206, 235, 0.3);
}

.profile-card-content {
    flex: 1;
}

.profile-card-content h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.profile-card-content p {
    color: #555;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* アバターカード専用スタイル */
.avatar-card {
    grid-column: 1 / -1;
}


.avatar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.avatar-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.2);
    border-radius: 20px;
    color: #4682b4;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.avatar-link:hover {
    background: rgba(135, 206, 235, 0.15);
    border-color: rgba(135, 206, 235, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.2);
}

/* SNSリンク */
.sns-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.sns-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.2);
    border-radius: 20px;
    color: #4682b4;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sns-link:hover {
    background: rgba(135, 206, 235, 0.15);
    border-color: rgba(135, 206, 235, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.2);
}

/* タイムライン */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(180deg, #87ceeb 0%, #4682b4 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #87ceeb;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.timeline-date {
    color: #4682b4;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.timeline-content h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.timeline-content p {
    color: #666;
    font-size: 0.95rem;
}

/* スキルセクション */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.skill-category h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(135, 206, 235, 0.2);
}

.skill-item {
    margin-bottom: 20px;
}

.skill-name {
    display: block;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #87ceeb 0%, #4682b4 100%);
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* プロジェクトセクション */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(135, 206, 235, 0.4);
    border-color: rgba(0, 0, 0, 0.2);
}

.project-card h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.project-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    background: rgba(135, 206, 235, 0.2);
    color: #4682b4;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* プロジェクトリンク */
.project-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.2);
    border-radius: 20px;
    color: #4682b4;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: rgba(135, 206, 235, 0.15);
    border-color: rgba(135, 206, 235, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.2);
}

/* 趣味セクション */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.interest-item {
    text-align: center;
    padding: 25px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.interest-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(135, 206, 235, 0.4);
    border-color: rgba(0, 0, 0, 0.2);
}

.interest-item i {
    font-size: 2.5rem;
    color: #4682b4;
    margin-bottom: 15px;
}

.interest-item h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.interest-item p {
    color: #666;
    font-size: 0.9rem;
}

/* コンタクトセクション */
.contact-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #87ceeb;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background: #4682b4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.3);
}

.contact-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* パフォーマンス最適化 */
.card-3d,
.about-content section,
.profile-card,
.project-card,
.interest-item {
    will-change: transform;
}

.card-3d {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* GPU加速 */
.link-button,
.avatar-link,
.sns-link,
.project-link {
    transform: translateZ(0);
    will-change: transform;
}

.about-content section:nth-child(1) { animation-delay: 0.1s; }
.about-content section:nth-child(2) { animation-delay: 0.2s; }
.about-content section:nth-child(3) { animation-delay: 0.3s; }
.about-content section:nth-child(4) { animation-delay: 0.4s; }
.about-content section:nth-child(5) { animation-delay: 0.5s; }
.about-content section:nth-child(6) { animation-delay: 0.6s; }

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 100%;
    }
    
    .business-card-container {
        position: static;
        order: 1;
        height: auto;
        margin-bottom: 20px;
    }
    
    .about-content {
        order: 2;
    }
    
    .card-rotation-area {
        width: 320px; /* 名刺幅に合わせて調整 */
        height: 500px; /* 固定高さに変更 */
        max-height: 500px;
        min-height: 400px;
    }
    
    .card-3d {
        height: 400px; /* 固定高さに変更 */
        max-height: 400px;
        min-height: 300px;
        /* 91:55の比率を維持 */
        aspect-ratio: 55 / 91;
    }
    
    
    .about-content section {
        padding: 20px;
    }
    
    .about-content section h2 {
        font-size: 1.3rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .interests-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .contact-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 0;
        gap: 15px;
    }
    
    .business-card-container {
        margin: 0 5px;
    }
    
    .card-rotation-area {
        width: 240px; /* 名刺最大幅212px + 余白 */
        height: calc(100vh - 160px);
        max-height: 420px;
        min-height: 280px;
    }
    
    .card-3d {
        height: calc(100vh - 180px);
        max-height: 350px;
        min-height: 200px;
        /* 91:55の比率を維持 */
        aspect-ratio: 55 / 91;
    }
    
    
    .about-content section {
        margin: 0 5px;
        border-radius: 15px;
        padding: 15px;
    }
    
    .timeline {
        padding-left: 25px;
    }
    
    .timeline-item::before {
        left: -18px;
        width: 10px;
        height: 10px;
    }
}