:root {
    --bg-deep: #050508;
    --bg-accent: #0f172a;
    --text-main: #f0f9ff;
    --text-sub: #94a3b8;
    --accent-cyan: #00f3ff;
    --accent-blue: #3b82f6;
    --accent-purple: #bd00ff;
    --glass-bg: rgba(10, 10, 15, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --nav-height: 70px;
    --font-jp: 'Noto Sans JP', sans-serif;
    --font-en: 'JetBrains Mono', monospace;
    --easing: cubic-bezier(0.23, 1, 0.32, 1);
}

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

::selection {
    background: var(--accent-cyan);
    color: #000;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-jp);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

h1, h2, h3, .nav-logo, .tagline, .work-link-arrow, .scramble-text {
    font-family: var(--font-en);
}

a, button {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s var(--easing);
    cursor: none;
    position: relative;
}

#star-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.cosmic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #000 120%);
    z-index: -1;
    pointer-events: none;
}

.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    will-change: transform, width, height;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 243, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}

body.hover-magnet .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 243, 255, 0.05);
    border-color: var(--accent-cyan);
    mix-blend-mode: screen;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

.loading-screen.hidden {
    transform: translateY(-100%);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-logo {
    font-size: 2rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 15px;
}

.loading-logo i {
    color: var(--accent-cyan);
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.loading-bar {
    width: 200px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    transition: width 0.5s ease;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(5, 5, 8, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(5, 5, 8, 0.95);
    height: 60px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo i {
    color: var(--accent-cyan);
    animation: glowPulse 3s infinite;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.menu-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-main);
    z-index: 1001;
}

.nav-links a {
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    padding: 5px 0;
    letter-spacing: 0.05em;
    transition: all 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-cyan);
    text-shadow: 0 0 8px var(--accent-cyan);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    transition: width 0.3s var(--easing);
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 60px) 24px 80px;
    flex: 1;
}

.card-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.4s var(--easing);
    position: relative;
    overflow: hidden;
}

.card-glass::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
}

.card-glass:hover::before {
    left: 200%;
    transition: 0.7s;
}

.card-glass:hover {
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
}

footer {
    border-top: 1px solid var(--glass-border);
    background: rgba(2, 2, 3, 0.8);
    backdrop-filter: blur(10px);
    padding: 60px 24px 40px;
    margin-top: auto;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.footer-links a {
    color: var(--text-sub);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan);
}

.copyright {
    color: var(--text-sub);
    font-size: 0.8rem;
    opacity: 0.5;
    font-family: var(--font-en);
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: opacity 0.8s var(--easing), transform 0.8s var(--easing);
}

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

@keyframes glowPulse {
    0%, 100% { filter: drop-shadow(0 0 2px var(--accent-cyan)); }
    50% { filter: drop-shadow(0 0 8px var(--accent-cyan)); }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 8, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s var(--easing);
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .menu-close {
        display: block;
    }
    
    .nav-links a {
        font-size: 1.4rem;
        padding: 20px;
        width: 100%;
        text-align: center;
    }

    .cursor-dot, .cursor-outline {
        display: none;
    }
    
    * {
        cursor: auto;
    }
}
