/* 基本リセットと変数定義 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --base-bg: #0A0A0A;
    --midnight-blue: #001F3F;
    --dark-purple: #2A0A2A;
    --neon-blue: #00FFFF;
    --cyber-pink: #FF00FF;
    --neon-green: #39FF14;
    --bright-yellow: #FFFF00;
    --silver-gray: #808080;
    --white: #FFFFFF;
}

body {
    font-family: 'Roboto Mono', monospace;
    background-color: var(--base-bg);
    color: var(--white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* グリッチエフェクト */
.glitch {
    position: relative;
    animation: glitch 1s linear infinite;
}

@keyframes glitch {
    2%, 64% {
        transform: translate(2px, 0) skew(0deg);
    }
    4%, 60% {
        transform: translate(-2px, 0) skew(0deg);
    }
    8% {
        transform: translate(0px, 0) skew(1deg);
    }
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--cyber-pink);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-green), 2px 2px var(--neon-blue);
    animation: glitch-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
    0% { clip: rect(31px, 9999px, 32px, 0); }
    5% { clip: rect(21px, 9999px, 14px, 0); }
    10% { clip: rect(44px, 9999px, 56px, 0); }
    15% { clip: rect(32px, 9999px, 32px, 0); }
    20% { clip: rect(31px, 9999px, 32px, 0); }
    25% { clip: rect(21px, 9999px, 14px, 0); }
    30% { clip: rect(44px, 9999px, 56px, 0); }
    35% { clip: rect(32px, 9999px, 32px, 0); }
    40% { clip: rect(31px, 9999px, 32px, 0); }
    45% { clip: rect(21px, 9999px, 14px, 0); }
    50% { clip: rect(44px, 9999px, 56px, 0); }
    55% { clip: rect(32px, 9999px, 32px, 0); }
    60% { clip: rect(31px, 9999px, 32px, 0); }
    65% { clip: rect(21px, 9999px, 14px, 0); }
    70% { clip: rect(44px, 9999px, 56px, 0); }
    75% { clip: rect(32px, 9999px, 32px, 0); }
    80% { clip: rect(31px, 9999px, 32px, 0); }
    85% { clip: rect(21px, 9999px, 14px, 0); }
    90% { clip: rect(44px, 9999px, 56px, 0); }
    95% { clip: rect(32px, 9999px, 32px, 0); }
    100% { clip: rect(31px, 9999px, 32px, 0); }
}

@keyframes glitch-2 {
    0% { clip: rect(65px, 9999px, 58px, 0); }
    5% { clip: rect(72px, 9999px, 24px, 0); }
    10% { clip: rect(56px, 9999px, 65px, 0); }
    15% { clip: rect(35px, 9999px, 72px, 0); }
    20% { clip: rect(65px, 9999px, 58px, 0); }
    25% { clip: rect(72px, 9999px, 24px, 0); }
    30% { clip: rect(56px, 9999px, 65px, 0); }
    35% { clip: rect(35px, 9999px, 72px, 0); }
    40% { clip: rect(65px, 9999px, 58px, 0); }
    45% { clip: rect(72px, 9999px, 24px, 0); }
    50% { clip: rect(56px, 9999px, 65px, 0); }
    55% { clip: rect(35px, 9999px, 72px, 0); }
    60% { clip: rect(65px, 9999px, 58px, 0); }
    65% { clip: rect(72px, 9999px, 24px, 0); }
    70% { clip: rect(56px, 9999px, 65px, 0); }
    75% { clip: rect(35px, 9999px, 72px, 0); }
    80% { clip: rect(65px, 9999px, 58px, 0); }
    85% { clip: rect(72px, 9999px, 24px, 0); }
    90% { clip: rect(56px, 9999px, 65px, 0); }
    95% { clip: rect(35px, 9999px, 72px, 0); }
    100% { clip: rect(65px, 9999px, 58px, 0); }
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--midnight-blue) 0%, var(--dark-purple) 100%);
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.main-catchphrase {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue), 0 0 30px var(--neon-blue); }
    to { text-shadow: 0 0 20px var(--neon-blue), 0 0 30px var(--neon-blue), 0 0 40px var(--neon-blue); }
}

.sub-catch {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--silver-gray);
}

.cta-button {
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 15px 30px;
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    background: var(--neon-blue);
    color: var(--base-bg);
    box-shadow: 0 0 20px var(--neon-blue);
    transform: scale(1.05);
}

.cta-button.large {
    padding: 20px 40px;
    font-size: 1.3rem;
}

.hero-bg .digital-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="noise" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23noise)"/></svg>');
    animation: noise 0.2s infinite linear;
    opacity: 0.1;
}

@keyframes noise {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 10%); }
    50% { transform: translate(10%, -5%); }
    60% { transform: translate(-10%, 10%); }
    70% { transform: translate(5%, -10%); }
    80% { transform: translate(-5%, -5%); }
    90% { transform: translate(10%, 5%); }
    100% { transform: translate(0, 0); }
}

.neon-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--neon-green) 2px,
        var(--neon-green) 4px
    );
    animation: scanline 4s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* HUD Navigation */
.hud-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--neon-blue);
    padding: 10px;
    backdrop-filter: blur(10px);
}

.hud-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hud-nav a {
    color: var(--neon-blue);
    text-decoration: none;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.hud-nav a:hover {
    color: var(--cyber-pink);
    text-shadow: 0 0 5px var(--cyber-pink);
}

/* 一般セクション */
.section {
    padding: 80px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
}

.section-text {
    font-size: 1.1rem;
    max-width: 800px;
    margin-bottom: 2rem;
    color: var(--silver-gray);
}

/* Intro Section */
.intro {
    background: var(--dark-purple);
}

.circuit-pattern {
    width: 100%;
    height: 300px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M10 10 L90 90 M10 90 L90 10" stroke="%2300FFFF" stroke-width="0.5" opacity="0.3"/></svg>');
    animation: circuit 3s ease-in-out infinite alternate;
}

@keyframes circuit {
    from { opacity: 0.3; }
    to { opacity: 0.6; filter: hue-rotate(90deg); }
}

/* Solution Section */
.solution {
    background: var(--midnight-blue);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
}

.feature {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border: 1px solid var(--silver-gray);
    border-radius: 5px;
    transition: all 0.3s;
}

.feature:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue);
    transform: translateY(-10px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    position: relative;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: var(--neon-blue);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.neon-blue::before { background: var(--neon-blue); }
.neon-pink::before { background: var(--cyber-pink); }
.neon-green::before { background: var(--neon-green); }

.feature h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.feature p {
    color: var(--silver-gray);
}

/* Tech Section */
.tech {
    background: var(--base-bg);
}

#tech-canvas {
    border: 1px solid var(--neon-blue);
    background: var(--midnight-blue);
}

/* Use Case Section */
.usecase {
    background: var(--dark-purple);
}

.timeline {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 800px;
}

.timeline-item {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--neon-blue);
    padding: 1rem 2rem;
    margin: 1rem;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s;
    position: relative;
}

.timeline-item:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px var(--neon-blue);
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, var(--neon-blue) 0%, var(--cyber-pink) 100%);
    color: var(--base-bg);
}

.cta .section-title {
    color: var(--base-bg);
    text-shadow: 0 0 10px var(--white);
}

.counter {
    margin-top: 2rem;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: var(--midnight-blue);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--neon-blue);
}

.footer p {
    margin-bottom: 1rem;
    color: var(--silver-gray);
}

.social-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--cyber-pink);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .main-catchphrase {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        flex-direction: column;
        align-items: center;
    }
    
    .hud-nav {
        top: 10px;
        right: 10px;
        padding: 5px;
    }
    
    .hud-nav ul {
        gap: 2px;
    }
    
    .hud-nav a {
        font-size: 0.7rem;
    }
}

/* スクロールエフェクトのためのクラス */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* パーティクルエフェクト用のベース */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
