:root {
    --bg-color: #12151c;
    --card-bg: #1a1e26;
    --card-border: #30363d;
    --text-main: #f0f6fc;
    --text-muted: #9ba3af;
    --accent: #5865f2;
    --bubble-bg: #1c2128;
}

body.light-mode {
    --bg-color: #fdfdfe;
    --card-bg: #ffffff;
    --card-border: #d0d7de;
    --text-main: #1f2328;
    --text-muted: #636c76;
    --accent: #0969da;
    --bubble-bg: #f3f4f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; transition: background-color 0.3s, border-color 0.3s, color 0.3s; scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-main); overflow-x: hidden; line-height: 1.6; }

/* --- Navigation --- */
.top-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: 70px;
    z-index: 3000; display: flex; align-items: center; transition: all 0.4s ease;
}
.top-nav.scrolled {
    height: 60px; background: rgba(18, 21, 28, 0.98); 
    backdrop-filter: blur(15px); border-bottom: 1px solid var(--card-border);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
body.light-mode .top-nav.scrolled { background: rgba(253, 253, 254, 0.98); }

.nav-container { max-width: 950px; margin: 0 auto; width: 100%; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.nav-left { display: flex; align-items: center; gap: 30px; }
.nav-logo { font-weight: 800; color: var(--accent); text-decoration: none; font-size: 1.1rem; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.8rem; font-weight: 700; transition: 0.3s; }
.nav-links a:hover { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 15px; }
.theme-toggle-btn, .mobile-menu-btn { 
    width: 38px; height: 38px; border-radius: 10px; background: var(--card-bg); 
    border: 1px solid var(--card-border); color: var(--accent); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.mobile-menu-btn { display: none; color: var(--text-main); }

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed; inset: 0; background: var(--bg-color); z-index: 2500;
    display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: 0.3s;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }
.mobile-menu-links { display: flex; flex-direction: column; gap: 30px; text-align: center; }
.mobile-link { font-size: 1.8rem; font-weight: 800; color: var(--text-main); text-decoration: none; }

/* --- Discord Status --- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 130px; }
.avatar-area { width: 100%; display: flex; justify-content: center; margin-bottom: 35px; }
.avatar-container { 
    display: flex; align-items: center; gap: 20px; 
    max-width: 100%; padding: 0 20px; flex-direction: row !important;
}

/* アイコン枠：Instagram風ゆっくりグラデーション */
.avatar-wrapper { 
    position: relative; 
    flex-shrink: 0; 
    padding: 4px; 
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    background-size: 400% 400%;
    animation: instagramGradient 8s ease infinite;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes instagramGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ホバー時に1.15倍に拡大 */
.avatar-wrapper:hover {
    transform: scale(1.15);
}

.avatar-img { 
    width: 110px; 
    height: 110px; 
    border-radius: 50%; 
    border: none;
    background: var(--card-bg); 
    object-fit: cover; 
    position: relative;
    z-index: 1;
}

/* ステータスドット：中央配置の修正 */
.status-dot { 
    position: absolute; 
    bottom: 2px; 
    right: 2px; 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    border: 4px solid var(--bg-color);
    z-index: 10; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.status-dot::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 14px;
    color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.status-dot.online { background-color: #23a55a; }
.status-dot.online::after { content: ''; }

/* 月マークの中央微調整 */
.status-dot.idle { background-color: #f0b232; }
.status-dot.idle::after { content: '\f186'; transform: rotate(-15deg) translate(-1px, -1px); font-size: 13px; }

/* 進入禁止マーク */
.status-dot.dnd { background-color: #f23f43; }
.status-dot.dnd::after { content: '\f068'; font-size: 15px; }

/* オフライン表示の対応 */
.status-dot.offline { background-color: #80848e; }
.status-dot.offline::after { content: '\f111'; font-weight: 400; font-size: 11px; }

/* Activity Bubble */
.activity-bubble {
    background: var(--bubble-bg); border: 1px solid var(--card-border); 
    border-radius: 16px; text-align: left; display: none; overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); min-width: 240px; max-width: 400px;
    opacity: 0;
    transform: scale(0.5) rotate(-5deg);
    transform-origin: left center;
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.activity-bubble.active { display: block; opacity: 1; transform: scale(1) rotate(0deg); }

.bubble-header { background: rgba(88, 101, 242, 0.08); padding: 7px 12px; font-size: 0.6rem; font-weight: 800; color: var(--accent); border-bottom: 1px solid var(--card-border); }
.bubble-item { padding: 10px 12px; display: flex; align-items: center; gap: 12px; opacity: 0; animation: itemSlideIn 0.4s forwards; }
@keyframes itemSlideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

.bubble-img { width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0; object-fit: cover; }
.bubble-info { flex: 1; min-width: 0; }
.act-label { font-size: 0.6rem; font-weight: 800; color: var(--accent); margin-bottom: 1px; }
.act-name { font-size: 0.8rem; font-weight: 800; color: var(--text-main); margin: 0; word-wrap: break-word; line-height: 1.2; }
.act-detail { font-size: 0.65rem; color: var(--text-muted); line-height: 1.2; }

/* --- Layout --- */
.main-wrapper { max-width: 950px; margin: 0 auto; padding: 0 20px 40px; }
.name-title { font-size: 2.8rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -1px; }
.job-title { color: var(--accent); font-family: 'JetBrains Mono'; font-size: 1rem; min-height: 1.5em; font-weight: 700; }
.content-grid { display: flex; flex-direction: column; gap: 30px; margin-top: 50px; }
.info-row { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.content-box { background: var(--card-bg); padding: 35px; border-radius: 24px; border: 1px solid var(--card-border); position: relative; z-index: 1; }
.section-title { margin-bottom: 25px; font-size: 1.2rem; font-weight: 800; text-align: center; }

/* --- Skills --- */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.skill-card { 
    background: var(--card-bg); border: 1px solid var(--card-border); padding: 16px 5px; 
    border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: 0.3s; 
}
.skill-card i { color: var(--accent); font-size: 1.5rem; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.skill-card span { font-size: 0.75rem; font-weight: 700; }
.skill-card:hover { transform: translateY(-4px); background: var(--accent); border-color: var(--accent); color: #fff; }
.skill-card:hover i { color: #fff; transform: scale(1.3) translateY(-5px); }

/* --- Timeline --- */
.timeline { position: relative; padding-left: 25px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: var(--card-border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::after { content: ''; position: absolute; left: -24px; top: 7px; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; border: 2.5px solid var(--card-bg); }
.time { font-family: 'JetBrains Mono'; color: var(--accent); font-weight: 800; font-size: 0.85rem; }
.timeline-item p { font-size: 0.85rem; }

/* --- Connect --- */
.social-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; }
.s-group { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.s-btn { 
    width: 48px; height: 48px; border-radius: 14px; background: var(--card-bg); 
    border: 1px solid var(--card-border); display: flex; align-items: center; justify-content: center; 
    font-size: 1.3rem; color: var(--text-muted); transition: 0.4s;
}
.s-id { font-size: 0.8rem; font-family: 'JetBrains Mono'; color: var(--text-muted); transition: 0.3s; }
.s-group:hover .s-btn { color: #fff; background: var(--accent); transform: rotate(-10deg) translateY(-5px); }
.s-group:hover .s-id { color: var(--text-main); transform: translateX(6px); }

/* --- Spotify Progress Bar --- */
.spotify-progress-container { margin-top: 8px; width: 100%; }
.spotify-bar-bg { width: 100%; height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; }
.spotify-bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width 1s linear; box-shadow: 0 0 8px var(--accent); }
.spotify-time { display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--text-muted); margin-top: 4px; font-family: 'JetBrains Mono'; }

/* --- Loader --- */
.loader-wrapper { position: fixed; inset: 0; background: #0d1117; z-index: 9999; display: flex; justify-content: center; align-items: center; }
.loader-wrapper.loaded { opacity: 0; visibility: hidden; transition: 0.8s; }
.small-dots .dot { width: 8px; height: 8px; margin: 0 5px; background-color: var(--accent); border-radius: 50%; display: inline-block; animation: bounce 1.4s infinite ease-in-out both; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); } 40% { transform: scale(1) translateY(-8px); } }

#bg-canvas { position: fixed; inset: 0; z-index: -1; }
.reveal { opacity: 0; transform: translateY(20px); transition: 0.6s; }
.reveal.active { opacity: 1; transform: translateY(0); }
.back-to-top { position: fixed; bottom: 25px; right: 25px; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; border: none; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 2000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.back-to-top.show { opacity: 1; visibility: visible; }
.main-footer { padding: 40px 0; text-align: center; border-top: 1px solid var(--card-border); margin-top: 40px; font-size: 0.8rem; color: var(--text-muted); }

/* --- Mobile --- */
@media (max-width: 850px) {
    .pc-only { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero { padding-top: 100px; }
    .avatar-img { width: 85px; height: 85px; }
    .status-dot { width: 24px; height: 24px; bottom: 1px; right: 1px; border-width: 3px; }
    .status-dot::after { font-size: 11px; }
    .info-row { grid-template-columns: 1fr; }
    .content-box { padding: 25px 20px; }
}
