/* 全体設定：スクロールを完全に禁止して1枚固定にする */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    /* スクロールバーを絶対に消す */
    background-color: #ffffff;
    font-family: monospace;
    user-select: none;
}

/* Three.js キャンバス */
#webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ヘッダー */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Contactモード時のヘッダースタイル（赤背景に合わせて馴染ませる） */
body.contact-mode #site-header {
    background: rgba(230, 0, 18, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body.contact-mode .brand-name {
    color: #ffffff;
}

body.contact-mode .nav-btn {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.header-brand {
    display: flex;
    align-items: center;
}

.brand-name {
    font-weight: bold;
    font-size: 13px;
    color: #111111;
    letter-spacing: 0.9em;
    /* 文字間を全角スペース約1文字分に拡張 */
    margin-right: -0.9em;
    /* 右端の余白を取り除き位置合わせ */
    transition: color 0.3s ease;
}

.header-nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    background: none;
    border: 1px solid transparent;
    font-family: monospace;
    font-size: 11px;
    color: #555555;
    cursor: pointer;
    padding: 4px 10px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.05);
}

/* タイムコントローラー（ヘッダー直下へ配置） */
#slider-container {
    position: fixed;
    top: 65px;
    left: 20px;
    z-index: 90;
    background: rgba(220, 220, 220, 0.4);
    padding: 10px 16px;
    border-radius: 4px;
    backdrop-filter: blur(5px);
    color: #444444;
    font-size: 10px;
    letter-spacing: 0.1em;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.3s ease;
}

/* Contactモード時はスライダーを非表示にする */
body.contact-mode #slider-container {
    opacity: 0;
    pointer-events: none;
}

/* 左下のステータス表示 */
#debug-ui {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #888888;
    font-size: 10px;
    letter-spacing: 0.1em;
    pointer-events: none;
    line-height: 1.5;
    z-index: 2;
    transition: color 0.3s ease;
}

body.contact-mode #debug-ui {
    color: rgba(255, 255, 255, 0.7);
}

/* 右側の詳細パネル */
#detail-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 380px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 200;
    transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #eeeeee;
}

#detail-panel.open {
    right: 0;
}

#close-btn {
    align-self: flex-end;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: monospace;
    font-size: 10px;
    color: #ffffff;
    cursor: pointer;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    transition: all 0.2s;
}

#close-btn:hover {
    background: #ffffff;
    color: #000000;
}

#project-title {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    color: #ffffff;
}

#project-meta {
    font-size: 10px;
    color: #888888;
    line-height: 1.6;
}

#project-desc {
    font-size: 11px;
    line-height: 1.8;
    color: #cccccc;
}

/* 🌟 Contact モード用のオーバレイUI（下部に浮遊） */
#contact-overlay {
    position: fixed;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

body.contact-mode #contact-overlay {
    bottom: 30px;
    pointer-events: auto;
}

.contact-card {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px 28px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.contact-title {
    font-size: 10px;
    letter-spacing: 0.2em;
    color: #888888;
}

.contact-links {
    display: flex;
    gap: 16px;
}

.contact-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: #ffffff;
    color: #e60012;
}

.contact-note {
    font-size: 9px;
    color: #aaaaaa;
    letter-spacing: 0.1em;
}