/* ========================================== 1. Base Reset & Variables ========================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary-color: #CCFF33;
    --secondary-color: #0066ff;
    --bg-dark: #02050a;
    --bg-gradient: radial-gradient(circle at center, #051020 0%, #02050a 100%);
    --text-light: #e0f7fa;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(0, 242, 255, 0.15);
    --color-cmd-main: #39ff14;
    --color-cmd-sub: #bc13fe;
    --color-group: #00f2ff;
    --color-unit: #ff00ff;
    --font-heading: 'Syncopate', sans-serif;
    --font-accent: 'Exo 2', sans-serif;
    --font-base: 'Noto Sans JP', sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: 'Orbitron', 'Segoe UI', sans-serif; background-color: var(--bg-dark); background: var(--bg-gradient); color: var(--text-light); line-height: 1.6; overflow-x: hidden; }

/* ========================================== 2. Cyber Background Layers ========================================== */
.bg-layers { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -10; pointer-events: none; }
.bg-gradient { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, #0a1a3a 0%, #02050a 100%); z-index: -3; }
.starfield { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background-image: radial-gradient(1px 1px at 30px 60px, #fff, rgba(0,0,0,0)), radial-gradient(2px 2px at 150px 250px, var(--primary-color), rgba(0,0,0,0)); background-size: 400px 400px; opacity: 0.6; animation: meteor-drift 30s linear infinite; z-index: -2; }
@keyframes meteor-drift { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(-15%, -15%) rotate(3deg); } }

/* ========================================== 3. Navigation ========================================== */
header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; background: rgba(5, 10, 16, 0.8); border-bottom: 1px solid var(--glass-border); }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 5%; max-width: 1400px; margin: 0 auto; }
.logo { font-family: 'Orbitron', 'Segoe UI', sans-serif; font-size: 1.4rem; font-weight: bold; color: var(--primary-color); text-shadow: 0 0 10px var(--primary-color); }
.nav-links { display: flex; list-style: none; }

.nav-links li a { margin-left: 2rem; font-size: 1.1rem; text-decoration: none; color: #39FF14; transition: all 0.3s ease; font-family: var(--font-accent); position: relative; font-weight: 800; text-shadow: 0 0 10px rgba(57, 255, 20, 0.8), 0 0 25px rgba(57, 255, 20, 0.4), 0 0 40px rgba(57, 255, 20, 0.2); }
.nav-links li a::after { content: ''; position: absolute; bottom: -5px; left: 50%; width: 0; height: 3px; background-color: var(--color-cmd-main); box-shadow: 0 0 15px var(--color-cmd-main), 0 0 30px var(--color-cmd-main); transition: width 0.3s ease, left 0.3s ease; }
.nav-links li a:hover::after { width: 100%; left: 0; }
.nav-links li a:hover { color: var(--primary-color); text-shadow: 0 0 12px rgba(0, 242, 255, 0.8), 0 0 30px rgba(0, 242, 255, 0.5), 0 0 50px rgba(0, 242, 255, 0.3); }

.btn-cyber { background: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); padding: 0.5rem 1rem; cursor: pointer; font-family: var(--font-heading); transition: all 0.3s ease; }
.btn-cyber:hover { background: var(--primary-color); color: var(--bg-dark); box-shadow: 0 0 15px var(--primary-color); }
.nav-controls { display: flex; align-items: center; gap: 1rem; }

/* Hamburger */ .hamburger { display: none; flex-direction: column; justify-content: space-between; width: 30px; height: 24px; cursor: pointer; z-index: 1001; }
.hamburger span { display: block; width: 100%; height: 3px; background-color: var(--primary-color); border-radius: 2px; transition: all 0.3s ease; }

@media screen and (max-width: 768px) { 
.logo { 
        font-size:0.8rem; }
.nav-links { 
position: fixed; 
right: -100%; 
top: 70px; 
flex-direction: column; 
width: 100%; 
text-align: center; 
transition: 0.3s; 
padding: 2rem 0; 
background: rgba(5, 10, 16, 0.65);
backdrop-filter: blur(5px); } 
.nav-links.active { right: 0; display: flex; } 
.nav-links li a { margin-left: 0; margin-bottom: 1.5rem; } 
.hamburger { display: flex; } }


/* ========================================== 4. Hero Section ========================================== */
#home{
    margin-top:70px;
}
.hero.fv-content { position: relative; width: 100%; height: 100vh; overflow: hidden; background-color: #000; }
@media screen and (max-width:767px) { .hero.fv-content { height: 60vh; } }

.contents-wrapper{ width: calc(100% - 100px); max-width: 1500px; margin: 0 auto; padding: 0 clamp(20px, 2.6596vw + -0.43px, 40px); position: relative; z-index: 10; }
@media screen and (max-width:767px) { .contents-wrapper{ width: calc(100% - 60px); } }

.background-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: -1; }
.bg-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 2s ease; z-index: 0; }
.bg-img.visible { opacity: 1; z-index: 1; }

.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 2; pointer-events: none; }

.fv-textbox { display: flex; align-items: center; height: 100vh; margin-left: clamp(40px, 5.4645vw + -1.97px, 80px); z-index: 10; }
@media screen and (max-width:767px) { .fv-textbox { justify-content: center; height: 50vh; margin-left: 0; } }

.fv-headline, .fv-textbox p { opacity: 0; transition: opacity 2s .5s ease; }
.fv-headline.fade-in, .fv-textbox p.fade-in { opacity: 1; }
.fv-headline.fade-out, .fv-textbox p.fade-out { opacity: 0; }

.fv-textbox .fv-headline { color: rgba(204, 255, 51, 0.7); font-weight: bold; font-size: clamp(60px, 8.1967vw + -2.95px, 120px); margin-bottom: 1rem; text-shadow: 3px 3px 3px rgba(0, 153, 204, 0.7); line-height: 1.1; }
@media screen and (max-width:767px) { .fv-textbox .fv-headline { font-size: clamp(40px, 4.2827vw + 27.15px, 60px); } }
.fv-textbox p { color: rgba(204, 255, 51, 0.7); font-size: clamp(14px, 2.1858vw + -2.79px, 30px); text-shadow: 3px 3px 3px rgba(0, 153, 204, 0.7); line-height: 1.2; }

/* ==========================================
   Hero Section: Text Line Animation (New)
   ========================================== */
/* 行ごとのフェードアップ用スタイル */
.fv-headline span {
    display: inline-block; /* transformを適用するために必要 */
    opacity: 0;
    transform: translateY(50px);
    animation: lineGlitchFadeUp 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; 
}

@keyframes lineGlitchFadeUp {
 /* 激しいズレ、マゼンタとシアン */
 0% { 
opacity: 0; 
transform: translateY(50px) taranslateX(0); 
text-shadow: none; 
}
 10% { opacity: 0.8; 
transform: translateY(30px) taranslateX(-15px); 
text-shadow: -4px 0 #ff00ff, 4px 0 #00ffff; 
}
 15% { opacity: 0.6; 
transform: translateY(20px) taranslateX(15px); 
text-shadow: 3px 0 #ff00ff, -3px 0 #00ffff; 
}
 20% { opacity: 0.9; 
transform: translateY(15px) taranslateX(-8px); 
text-shadow: -2px 0 #ff00ff, 2px 0 #00ffff; 
}
 /* 本来の位置へ戻る */
 30% { 
opacity: 1; 
transform: translateY(8px) taranslateX(0); 
text-shadow: 0 0 10px rgba(204, 255, 51, 0.8);
 }
 40% { 
opacity: 1; 
transform: translateY(3px) taranslateX(-15px); 
text-shadow: 0 0 15px rgba(204, 255, 51, 0.5);
    }
 /* 本来のスタイル */
 100% { 
opacity: 1; 
transform: translateY(0) taranslateX(0); 
text-shadow: 3px 3px 3px rgba(0, 153, 204, 0.7);
 } 
}
/* 重要　javaとの干渉防止 */
.fv-headline, 
.fv-textbox p { 
opacity: 0; 
transition: opacity 2s ease;　/* フェードインの速度を滑らかに調整 */
 }
/* javaから付与されるクラス */
.fv-headline. fade-in, 
.fv-textbox p. fade-in { 
opacity: 1;
 }

.fv-headline. fade-out, 
.fv-textbox p. fade-out { 
opacity: 0;
 }

/* テキストの基本色とフォント指定 */
.fv-textbox .fv-headline { color: rgba(204, 255, 51, 0.7); 
font-weight: bold; 
font-size: clamp(60px, 8.1967vw + -2.95px, 120px); 
margin-bottom: 4rem; 
line-height: 1.1;
 }

@media screen and (max-width:767px) { 
.fv-textbox .fv-headline {
 font-size: clamp(40px, 4.2827vw + 27.15px, 60px); } }
.fv-textbox p {
 color: rgba(204, 255, 51, 0.7); 
font-size: clamp(14px, 2.1858vw + -2.79px, 30px);
 text-shadow: 3px 3px 3px rgba(0, 153, 204, 0.7);
 line-height: 1.2; }
/* フォント指定の適用 */
.fv-textbox .fv-headline,
.fv-textbox p,
[data-en] { 
font-family: 'Orbitron', 'Segoe UI', sans-serif; !important; 
}


/* ========================================== 5. Section Animations & Others ========================================== */
section { opacity: 0; transform: translateY(60px); }
.is-visible { animation: fadeUp 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, pureHorizontalGlitch 0.3s steps(5) 0.2s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

@keyframes pureHorizontalGlitch { 0% { transform: translateX(0); clip-path: inset(0 0 0 0); filter: none; } 20% { transform: translateX(-25px); clip-path: inset(45% 0 45% 0); filter: drop-shadow(10px 0 #ff00ff) drop-shadow(-10px 0 #00ffff); } 40% { transform: translateX(25px); clip-path: inset(30% 0 60% 0); filter: drop-shadow(-10px 0 #ff00ff) drop-shadow(10px 0 #00ffff); } 60% { transform: translateX(-15px); clip-path: inset(20% 0 70% 0); filter: drop-shadow(8px 0 #ff00ff) drop-shadow(-8px 0 #00ffff); } 80% { transform: translateX(15px); clip-path: inset(60% 0 30% 0); filter: drop-shadow(-8px 0 #ff00ff) drop-shadow(8px 0 #00ffff); } 100% { transform: translateX(0); clip-path: inset(0 0 0 0); filter: none; } }

.container { padding: 80px 5%; max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.section-title { font-family: 'Orbitron', 'Segoe UI', sans-serif; font-size: 2.5rem; text-align: center; margin-bottom: 3rem; color: var(--primary-color); position: relative; text-shadow: 0 0 10px rgba(0, 242, 255, 0.8), 0 0 20px rgba(0, 242, 255, 0.4); }
footer { text-align: center; padding: 2rem; border-top: 1px solid var(--glass-border); font-size: 0.8rem; position: relative; z-index: 1; }

/* --- Cyberpunk UI Framework for #units --- */
#units { background-color: #02050a; background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03)); background-size: 100% 4px, 3px 100%; padding: 60px 20px; color: #e0f7fa; font-family: 'Orbitron', 'Segoe UI', sans-serif; }
.cyber-container { max-width: 1400px; margin: 0 auto; }
.command-header { text-align: center; margin-bottom: 50px; border-bottom: 2px solid #00f3ff; display: inline-block; width: 100%; padding-bottom: 10px; box-shadow: 0 4px 15px -5px rgba(0, 243, 255, 0.6); }
.command-header h1 { font-size: 2.5rem; letter-spacing: 4px; color: #fff; text-shadow: 0 0 10px #00f3ff, 0 0 20px #00f3ff; }

.cyber-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
@media (max-width: 1024px) { .cyber-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cyber-grid { grid-template-columns: 1fr; } }

.command-column { background: rgba(0, 20, 30, 0.6); backdrop-filter: blur(8px); border: 1px solid rgba(0, 243, 255, 0.3); padding: 20px; position: relative; overflow: hidden; }
.column-title { font-size: 1.4rem; color: #CCFF33; text-align: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 1); text-shadow: 0 0 8px #33FF00; }
.unit-list { display: flex; flex-direction: column; gap: 12px; }

.level-3-unit { text-decoration: none; color: rgba(204, 255, 51, 1); font-size: 1.1rem; font-weight: bold; padding: 15px; background: rgba(0, 0, 0, 0.4); border-left: 3px solid #00f3ff; transition: all 0.3s ease; display: block; position: relative; overflow: hidden; }
.level-3-unit:hover { background: rgba(0, 243, 255, 0.15); border-left: 3px solid #ff00ff; transform: translateX(5px); box-shadow: -5px 0 15px rgba(0, 243, 255, 0.4); animation: glitch 0.2s infinite; color: #ff00ff; text-shadow: 2px 0 #00f3ff, -2px 0 #ff00ff; }

/* Animations */ @keyframes subtle-flicker { 0%, 100% { opacity: 1; } 95% { opacity: 0.98; } 97% { opacity: 1; } 98% { opacity: 0.95; } }
@keyframes jitter { 0% { transform: translate(0, 0); } 25% { transform: translate(-1px, 1px); } 50% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, -1px); } 100% { transform: translate(1px, 1px); } }
@keyframes glitch-anim { 0% { clip-path: inset(40% 0 61% 0); transform: skew(0.5deg); } 20% { clip-path: inset(92% 0 1% 0); transform: skew(-0.5deg); } 40% { clip-path: inset(43% 0 6% 0); transform: skew(0.8deg); } 60% { clip-path: inset(27% 0 15% 0); transform: skew(-0.8deg); } 80% { clip-path: inset(90% 0 3% 0); transform: skew(0.5deg); } 100% { clip-path: inset(10% 0 80% 0); transform: skew(-0.5deg); } }
@keyframes scanline-anim { 0% { background-position: 0 0; } 100% { background-position: 0 100%; } }
@keyframes flicker-anim { 0%, 100% { opacity: 0.8; } 50% { opacity: 0.4; } 70% { opacity: 0.9; } }
@keyframes glitch { 0% { transform: translate(0); } 20% { transform: translate(-1.5px, 1.5px); } 40% { transform: translate(-1.5px, -1.5px); } 60% { transform: translate(1.5px, 1.5px); } 80% { transform: translate(1.5px, -1.5px); } 100% { transform: translate(0); } }
@media screen and (max-width:767px) { 
    .command-header h1 { 
        font-size:1.4rem; 
    } 
}
/* --- 追加：見出しリンク用のスタイル (Requirements) --- */
.command-link, .column-link {
    text-decoration: none !important;
    display: inline-block;
    transition: all 0.3s ease;
}
.command-link:hover, .column-link:hover {
    transform: scale(1.1);
    text-shadow: 0 0 15px var(--primary-color), 0 0 30px var(--secondary-color);
}
.command-header .command-link { width: 100%; }

/* --- Back Button Section --- */
.back-button-container { text-align: center; margin: 60px auto 40px; position: relative; z-index: 10; }
.btn-back { padding: 1rem 3rem !important; font-size: 1.2rem !important; letter-spacing: 0.2em !important; position: relative; overflow: hidden; }
.btn-back:hover { transform: scale(1.1); background: var(--primary-color) !important; color: var(--bg-dark) !important; box-shadow: 0 0 20px var(--primary-color), 0 0 40px var(--color-cmd-main), inset 0 0 15px rgba(255, 255, 255, 0.5) !important; }
.btn-back:active { transform: scale(0.95); }




/* その他アニメーション等 */
@keyframes subtle-flicker { 0%, 100% { opacity: 1; } 95% { opacity: 0.98; } 97% { opacity: 1; } 98% { opacity: 0.95; } }
a.logo {
     text-decoration: none; !important;
     display: inline-block;
     position: relative;
     cursor: pointer;
}

a.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 3px; /* 下線を少し太くして存在感をアップ */
    background-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color), 0 0 30px var(--primary-color);
    transition: width 0.4s ease, left 0.4s ease;
}
a.logo:hover::after {
    width: 100%;
    left: 0;
}
a.logo:hover { 
    color: #fff; 
    /* ホバー時のGlowも強化 */
    text-shadow: 0 0 12px rgba(0, 242, 255, 0.8), 0 0 30px rgba(0, 242, 255, 0.5), 0 0 50px rgba(0, 242, 255, 0.3);
}
/* ========================================== 
   Footer Glitch Effect Implementation
   ========================================== */

/* ベースとなるリンクスタイル */
footer .paragraph a {
    position: relative;
    display: inline-block; /* エフェクトの基準点として必要 */
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
    /* テキストの影（リファレンス仕様） */
    text-shadow: 1px 0 rgba(255, 0, 255, 0.4), -1px 0 rgba(0, 255, 255, 0.4);
}



/* 走査線エフェクト用の擬似要素 */
footer .paragraph a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(255, 255, 255, 0.1) 50%
    );
    background-size: 100% 4px;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
}

/* ホバー時のエフェクト発動 */
footer .paragraph a:hover {
    animation: jitter 0.1s infinite; /* jitter (揺れ) */
    text-shadow: 3px 0 #ff00ff, -3px 0 #00ffff;
}

footer .paragraph a:hover::before {
    opacity: 1;
    animation: glitch-anim 0.2s infinite; /* glitch-anim (クリッピング変化) */
    z-index: -2;
    color: #00ffff; /* シアン */
}

footer .paragraph a:hover::after {
    opacity: 1;
    animation: scanline-anim 0.1s infinite, flicker-anim 0.15s infinite; /* scanline & flicker */
}