: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;
}

.avatar-wrapper { position: relative; flex-shrink: 0; }
.avatar-img { width: 110px; height: 110px; border-radius: 50%; border: 4px solid var(--accent); background: var(--card-bg); object-fit: cover; }
.status-dot { 
    position: absolute; bottom: 4px; right: 4px; width: 26px; height: 26px; 
    border-radius: 50%; border: 4px solid var(--card-bg); z-index: 10; 
}
.status-dot.online { background-color: #23a55a; }
.status-dot.idle { background-color: #f0b232; }
.status-dot.dnd { background-color: #f23f43; }
.status-dot.offline { background-color: #80848e; }

.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;
}
.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; }
.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 ease-out; 
}
.skill-card i { color: var(--accent); font-size: 1.5rem; transition: 0.3s; }
.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; }

/* --- 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; text-align: left; }
.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; cursor: pointer;
}
.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: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.s-btn i { transition: transform 0.3s ease; }
.s-id { 
    font-size: 0.8rem; font-family: 'JetBrains Mono'; color: var(--text-muted); 
    transition: all 0.3s ease; pointer-events: none;
}

/* ホバー挙動 */
.s-group:hover .s-btn { 
    color: #fff; background: var(--accent); border-color: var(--accent);
    transform: rotate(-10deg) translateY(-5px); /* アイコン枠だけ斜めに */
    box-shadow: 0 10px 20px rgba(88, 101, 242, 0.3);
}
.s-group:hover .s-btn i { transform: scale(1.1); }
.s-group:hover .s-id { 
    color: var(--text-main); transform: translateX(6px); /* 文字は斜めにならず横スライド */
}

/* --- 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); } }

/* --- Others --- */
#bg-canvas { position: fixed; inset: 0; z-index: -1; }
.reveal { opacity: 0; transform: translateY(20px); transition: 0.6s ease-out; }
.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; cursor: pointer; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.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-container { gap: 12px; }
    .avatar-img { width: 85px; height: 85px; }
    .status-dot { width: 22px; height: 22px; bottom: 3px; right: 3px; }
    .activity-bubble { min-width: 200px; max-width: 280px; }
    .bubble-img { width: 38px; height: 38px; }
    .name-title { font-size: 2rem; }
    .info-row { grid-template-columns: 1fr; }
    .content-box { padding: 25px 20px; }
    .s-group:hover .s-btn { transform: none; box-shadow: none; }
    .s-group:hover .s-id { transform: none; }
}
