@charset "UTF-8";

/* ====== CORE SETTINGS ====== */
:root {
    --primary-color: #00f0ff;       /* メイン発光色（シアン） */
    --secondary-color: #00a8ff;     /* サブ発光色（濃い青） */
    --alert-color: #ff3333;         /* 警告色 */
    --bg-color: #050a10;            /* ベース背景色 */
    --frame-color: #1a1f24;         /* 機体フレーム色 */
    --frame-dark: #0f1215;          /* 機体フレーム影色 */
    --glass-tint: rgba(0, 240, 255, 0.05); /* ガラスの着色 */
    --text-main: #e0faff;
    
    --ease-mech: cubic-bezier(0.2, 0.8, 0.2, 1); /* 機械的な動き */
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: 'Rajdhani', sans-serif;
    background-color: #000;
    color: var(--text-main);
    overflow: hidden; /* HTML全体はスクロールさせない */
    height: 100vh;
    width: 100vw;
}

/* カスタムスクロールバー */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--primary-color); }
::-webkit-scrollbar-corner { background: #000; }

/* ====== BACKGROUND (WORLD) ====== */
#bg-video {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    object-fit: cover;
    z-index: -1;
    filter: brightness(0.6) contrast(1.1) hue-rotate(180deg);
    transition: filter 2s;
}

/* ====== START SCREEN (Overlay) ====== */
#start-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.start-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    padding: 15px 40px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 4px;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 0 0 15px var(--primary-color);
}
.start-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 30px var(--primary-color);
    letter-spacing: 6px;
}
.start-btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    transition: 0.5s;
}
.start-btn:hover::before { left: 100%; }

/* ====== COCKPIT FRAMES (The Mech Parts) ====== */
.mech-frame {
    position: fixed;
    z-index: 500;
    background: var(--frame-color);
    box-shadow: inset 0 0 20px #000;
    background-image: 
        linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%, rgba(0,0,0,0.3) 100%),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.2) 10px, rgba(0,0,0,0.2) 20px);
}

/* 上部フレーム（ハッチ） */
.frame-top {
    top: 0;
    left: 0; width: 100%; height: 8vh;
    clip-path: polygon(0 0, 100% 0, 100% 60%, 80% 100%, 20% 100%, 0 60%);
    border-bottom: 2px solid #333;
}
/* 下部フレーム（コンソール） */
.frame-bottom {
    bottom: 0;
    left: 0; width: 100%; height: 12vh;
    clip-path: polygon(0 100%, 100% 100%, 100% 30%, 85% 0, 15% 0, 0 30%);
    border-top: 2px solid #333;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
/* 左サイドフレーム */
.frame-left {
    top: 0; left: 0;
    width: 8vw; height: 100%;
    clip-path: polygon(0 0, 100% 0, 60% 15%, 60% 85%, 100% 100%, 0 100%);
    border-right: 2px solid #333;
}
/* 右サイドフレーム */
.frame-right {
    top: 0; right: 0;
    width: 8vw; height: 100%;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 85%, 40% 15%);
    border-left: 2px solid #333;
}

/* 支柱 (A-Pillar) */
.frame-pillar-left {
    position: fixed; top: 0; left: 8vw; width: 3vw; height: 100%;
    background: linear-gradient(90deg, var(--frame-dark), var(--frame-color));
    transform: skewX(-10deg);
    z-index: 490;
    opacity: 0;
}
.frame-pillar-right {
    position: fixed; top: 0; right: 8vw; width: 3vw; height: 100%;
    background: linear-gradient(-90deg, var(--frame-dark), var(--frame-color));
    transform: skewX(10deg);
    z-index: 490;
    opacity: 0;
}

/* ====== UI SCREENS (HUD) ====== */
.hud-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 600;
    pointer-events: none; /* 重要：HUDはクリックを透過させる */
    opacity: 0;
}

.screen-glass {
    position: absolute;
    background: var(--glass-tint);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1), inset 0 0 20px rgba(0, 240, 255, 0.1);
    backdrop-filter: blur(2px);
    overflow: hidden;
}
.scan-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 240, 255, 0.05) 51%, transparent 51%);
    background-size: 100% 4px;
    pointer-events: none;
}
.scan-bar {
    position: absolute; top: -100%; left: 0; width: 100%; height: 20px;
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 10px var(--primary-color);
    animation: scan 3s linear infinite;
}

/* LEFT SCREEN */
.screen-left {
    top: 15%; left: 1%; bottom: 20%; width: 18%;
    transform: perspective(1000px) rotateY(15deg);
    border-radius: 10px 0 0 10px;
    display: flex; flex-direction: column; padding: 15px;
}
/* RIGHT SCREEN */
.screen-right {
    top: 15%; right: 1%; bottom: 20%; width: 18%;
    transform: perspective(1000px) rotateY(-15deg);
    border-radius: 0 10px 10px 0;
    display: flex; flex-direction: column; padding: 15px;
}
/* TOP SCREEN (Header) */
.screen-top {
    top: 1%; left: 15%; width: 70%; height: 50px;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
    display: flex; justify-content: space-between; align-items: center; padding: 0 40px; 
    pointer-events: auto; /* ヘッダーのリンクはクリック可能にする */
}

/* HUD CONTENTS */
.hud-text { font-family: 'Share Tech Mono', monospace; color: var(--primary-color); text-transform: uppercase; }
.hud-title { font-size: 1.1rem; border-bottom: 2px solid var(--primary-color); margin-bottom: 10px; padding-bottom: 5px; color: var(--text-main); }

.skill-row { margin-bottom: 12px; }
.skill-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-main); }
.skill-bar-bg { width: 100%; height: 4px; background: rgba(255,255,255,0.1); margin-top: 4px; }
.skill-bar-fill { height: 100%; background: var(--primary-color); width: 0; transition: width 1s; box-shadow: 0 0 5px var(--primary-color); }

.nav-link {
    color: var(--text-main); text-decoration: none; margin: 0 15px; font-weight: bold; position: relative; transition: 0.3s;
    font-family: 'Share Tech Mono', monospace;
}
.nav-link:hover { color: var(--primary-color); text-shadow: 0 0 8px var(--primary-color); }
.nav-link.active { color: var(--primary-color); }
.nav-link.active::after { content:''; position: absolute; bottom: -5px; left: 0; width: 100%; height: 2px; background: var(--primary-color); }

/* GitHub Contribution Graph Style */
.github-graph {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: auto;
    margin-bottom: 20px;
    position: relative;
}
.git-dot {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 2px;
    transition: 0.3s;
}
.git-dot:hover {
    transform: scale(1.2);
    z-index: 10;
}
.git-dot.active-1 { background: rgba(0, 240, 255, 0.2); }
.git-dot.active-2 { background: rgba(0, 240, 255, 0.45); box-shadow: 0 0 3px var(--primary-color); }
.git-dot.active-3 { background: rgba(0, 240, 255, 0.8); box-shadow: 0 0 6px var(--primary-color); }
.git-dot.active-4 { background: #fff; box-shadow: 0 0 10px #fff; border: 1px solid var(--primary-color); }

/* BATT Display - Header Adjusted */
.batt-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    min-width: 150px;
}
.batt-icon {
    width: 40px; height: 12px;
    border: 1px solid var(--primary-color);
    padding: 1px;
    position: relative;
    margin-right: 10px;
}
.batt-icon::after {
    content: ''; position: absolute; right: -3px; top: 2px; width: 2px; height: 6px; background: var(--primary-color);
}
.batt-level {
    height: 100%; background: var(--primary-color); width: 50%;
    box-shadow: 0 0 5px var(--primary-color);
    transition: width 0.5s ease;
}

/* ====== MAIN CONTENT AREA ====== */
#main-viewport {
    height: 100vh;
    overflow-y: auto; 
    position: relative;
    z-index: 10;
    padding-top: 150px; 
    padding-bottom: 100px;
}
.content-wrapper {
    width: 50%; 
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

section {
    background: rgba(10, 20, 30, 0.85);
    border: 1px solid var(--secondary-color);
    margin-bottom: 80px;
    padding: 40px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(30px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    position: relative;
}
section::before {
    content: ''; position: absolute; top: -1px; left: -1px; width: 30px; height: 30px;
    border-top: 3px solid var(--primary-color); border-left: 3px solid var(--primary-color);
}
section::after {
    content: ''; position: absolute; bottom: -1px; right: -1px; width: 30px; height: 30px;
    border-bottom: 3px solid var(--primary-color); border-right: 3px solid var(--primary-color);
}

h2 { 
    border-left: 5px solid var(--primary-color); 
    padding-left: 20px; 
    color: var(--primary-color); 
    text-transform: uppercase; 
    letter-spacing: 2px;
    font-family: 'Share Tech Mono', monospace; 
}

.log-item { display: flex; border-bottom: 1px solid #333; padding-bottom: 10px; }
.log-date { width: 100px; color: var(--primary-color); font-weight: bold; font-family: 'Share Tech Mono'; }
.log-content { color: #fff; }
.log-highlight { color: #fff; font-weight: bold; text-shadow: 0 0 5px var(--alert-color); }
.log-date-highlight { width: 100px; color: var(--alert-color); font-weight: bold; font-family: 'Share Tech Mono'; }

/* ====== HORIZONTAL SCROLL WORKS ====== */
.horizontal-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px; 
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.card {
    background: rgba(255,255,255,0.05); 
    border: 1px solid #444; 
    padding: 10px; 
    transition: 0.3s;
    text-decoration: none; 
    color: #fff; 
    display: block;
    
    /* 固定幅設定（巨大化防止） */
    width: 300px;
    flex: 0 0 300px; 
    scroll-snap-align: start;
}

.card:hover { border-color: var(--primary-color); background: rgba(0, 240, 255, 0.1); transform: scale(1.02); }

.card-img-container {
    width: 100%;
    height: 170px; /* 高さ固定 */
    background: #000; 
    overflow: hidden;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; /* 枠内に完全に収める */
    transition: 0.5s; 
}

.card:hover img { filter: brightness(1.2); }

/* ====== WORKS GRID (Bio移植) ====== */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.hobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 50px;
}

.collapse-btn {
    background: rgba(0,240,255,0.08);
    color: var(--text-main);
    border: 1px solid rgba(0,240,255,0.4);
    padding: 8px 14px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.2s;
}

.collapse-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 240, 255, 0.15);
}

.collapsible {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.collapsible.is-collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.collapsible.is-open {
    max-height: 2000px;
    opacity: 1;
}

.work-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid #2a3a45;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.work-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.work-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.work-card h3 {
    margin: 0;
    color: var(--text-main);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
}

.badge {
    padding: 4px 8px;
    background: rgba(0,240,255,0.12);
    color: var(--primary-color);
    border: 1px solid rgba(0,240,255,0.4);
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.work-card p {
    margin: 0;
    color: #d0d9e3;
    font-size: 0.9rem;
    line-height: 1.5;
}

.work-media {
    border: 1px solid rgba(255,255,255,0.08);
    background: #060b12;
    border-radius: 6px;
    overflow: hidden;
    max-height: 220px;
}

.work-media img,
.work-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.work-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(0,240,255,0.4);
    color: var(--text-main);
    text-decoration: none;
    background: rgba(0, 240, 255, 0.08);
    transition: 0.2s;
    font-size: 0.85rem;
}

.work-link:hover {
    border-color: var(--primary-color);
    background: rgba(0, 240, 255, 0.15);
    color: #fff;
}

.work-note {
    color: #92a2b5;
    font-size: 0.8rem;
}

/* ANIMATIONS */
@keyframes scan { 0% { top: -100%; } 100% { top: 200%; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes batt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* Media Query */
@media (max-width: 1200px) {
    .content-wrapper { width: 60%; }
}