/* CSS Variables for Light/Dark Theme */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --accent-primary: #00bcd4;
    --accent-secondary: #0097a7;
    --border-color: #e9ecef;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-primary: #00bcd4;
    --accent-secondary: #0097a7;
    --border-color: #30363d;
    --shadow: rgba(0, 0, 0, 0.4);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: var(--transition);
}

/* Navigation */
.nav-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1rem;
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    box-shadow: 0 4px 12px var(--shadow);
    border: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: var(--transition);
    font-weight: 500;
    display: block;
    min-width: fit-content;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    transform: translateY(-2px);
}

/* Main Container */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Scroll content for visitor counter */
.scroll-content {
    min-height: 150vh;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.content-spacer {
    height: 100vh;
}


.hero-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    animation: slideUpFade 1s ease-out;
}

.profile-icon {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-primary);
    box-shadow: 0 10px 30px var(--shadow);
    transition: var(--transition);
    animation: bounceIn 1.2s ease-out 0.3s both;
}

.profile-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px var(--shadow);
}

.text-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    animation: slideInRight 1s ease-out 0.5s both;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0;
    animation: slideInRight 1s ease-out 0.7s both;
    font-weight: 400;
}

/* Animations */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
/* タブレットサイズでも左下に配置 */
@media (max-width: 1024px) and (min-width: 769px) {
    .theme-toggle {
        position: fixed;
        bottom: 20px;
        left: 20px;
        top: auto;
        width: 50px;
        height: 50px;
        z-index: 1000;
    }
}

@media (max-width: 768px) {
    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .profile-icon {
        width: 150px;
        height: 150px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* スマホでダークモード切り替えボタンを左下に配置 */
    .theme-toggle {
        position: fixed;
        bottom: 20px;
        left: 20px;
        top: auto;
        width: 50px;
        height: 50px;
        z-index: 1000;
    }
    
    .theme-toggle i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .profile-icon {
        width: 120px;
        height: 120px;
    }
    
    .nav-container {
        top: 10px;
        right: 10px;
    }
    
    /* 小さなスマホでもダークモード切り替えボタンを左下に配置 */
    .theme-toggle {
        position: fixed;
        bottom: 15px;
        left: 15px;
        top: auto;
        width: 45px;
        height: 45px;
        z-index: 1000;
    }
    
    .theme-toggle i {
        font-size: 1rem;
    }
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Visitor counter styles */
.visitor-counter {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
}

.visitor-counter.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
    pointer-events: auto;
}

.visitor-counter .counter-image {
    max-width: 500px;
    height: auto;
    border-radius: 20px;
    transition: var(--transition);
    filter: drop-shadow(0 12px 32px var(--shadow));
    animation: glow 3s ease-in-out infinite alternate;
}

.visitor-counter .counter-image:hover {
    transform: scale(1.1);
}

@keyframes glow {
    0% {
        filter: drop-shadow(0 8px 24px var(--shadow));
    }
    100% {
        filter: drop-shadow(0 8px 24px var(--shadow)) drop-shadow(0 0 20px var(--accent-primary));
    }
}