/**
 * SP専用コンポーネント
 * このファイルは max-width: 900px でのみ読み込まれる
 * PC用CSSとは完全に分離されているため、詳細度競合は発生しない
 */

/* ============================================================
   共通コンポーネント
   ============================================================ */

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: 1px solid #111;
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #111;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #111;
    color: #fff;
}

/* ============================================================
   HOME セクション
   ============================================================ */
#home.section {
    justify-content: center;
    align-items: flex-start;
    background: transparent;
}

#home .asym-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    height: 100%;
}

#home .hero-content {
    padding: 0 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
}

/* 背景装飾テキスト */
.hero-bg-text {
    position: absolute;
    right: -5%;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-size: 25vw;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    opacity: 0.04;
    -webkit-text-stroke: 1px #000;
    color: transparent;
    white-space: nowrap;
    z-index: 0;
    pointer-events: none;
}

.hero-bg-letter {
    position: absolute;
    right: -15%;
    bottom: 5%;
    transform: scaleX(-1);
    font-size: 80vw;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    opacity: 0.02;
    filter: blur(1px);
    z-index: 0;
    pointer-events: none;
}

/* 座標表示 */
#home .hero-coord {
    font-size: 0.45rem;
    opacity: 0.4;
    white-space: nowrap;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

/* タイトル */
#home h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.0;
    letter-spacing: -0.02em;
    text-align: left;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    color: #111;
}

/* タイトルの改行制御 */
#home h1>.assembly-space:nth-child(4),
#home h1>.assembly-space:nth-child(6) {
    flex-basis: 100%;
    width: 100%;
    height: 0;
    display: block;
    margin: 0;
}

/* 文字アニメーション */
.assembly-char {
    display: inline-block;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.8s ease;
}

.assembly-explosion {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) rotate(var(--tr));
}

/* 説明テキスト */
#home .typing-text {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: rgba(0, 0, 0, 0.6);
    max-width: 100%;
}

/* ボタン */
#home .btn {
    margin: 0;
}

/* ============================================================
   ABOUT セクション
   ============================================================ */
#about.section {
    overflow-y: scroll !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    /* セクション自体は透明 - グリッドが周囲に見える */
    background: transparent;
}

/* プロフィールコンテナ - スリガラス風カード（高詳細度セレクタ） */
#about.section .profile-container,
#about.section .profile-container.fade-in,
#about.section .profile-container.fade-in.visible,
#about.section div.profile-container {
    padding: 25px 20px 40px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    /* スリガラス風背景 - 強制適用 */
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    margin: 0 auto 20px !important;
    position: relative !important;
}

#about .profile-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 15px;
    height: 15px;
    border-top: 2px solid #111;
    border-left: 2px solid #111;
}

/* プロフィールヘッダー */
#about .profile-header {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* アバター */
#about .avatar-box {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 3px;
    position: relative;
}

#about .avatar-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: url('../../../../assets/images/unsplash/l4_icon_base_outline_text_sizeicon.png') no-repeat center center;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
}

#about .avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.1), rgba(0, 0, 0, 0.02));
}

/* プロフィール情報 */
#about .profile-info {
    flex: 1;
    min-width: 0;
}

#about .section-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--primary-color, #0af);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

#about .profile-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin: 0 0 8px 0;
    color: #111;
    line-height: 1.1;
}

#about .profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: rgba(0, 0, 0, 0.5);
}

#about .meta-item {
    letter-spacing: 1px;
}

/* プロフィールボディ */
#about .profile-body {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

/* セクションタイトル */
#about .sub-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: #111;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#about .sub-title::before {
    content: '//';
    color: var(--primary-color, #0af);
}

/* BIO テキスト */
#about .about-text {
    font-size: 0.85rem;
    line-height: 1.8;
    color: rgba(0, 0, 0, 0.65);
}

/* タイムライン */
#about .timeline {
    position: relative;
    padding-left: 25px;
}

#about .timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(0, 0, 0, 0.08);
}

#about .timeline-item {
    position: relative;
    margin-bottom: 25px;
}

#about .timeline-item:last-child {
    margin-bottom: 0;
}

#about .timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 6px;
    width: 7px;
    height: 7px;
    background: #fff;
    border: 2px solid var(--primary-color, #0af);
    border-radius: 50%;
    z-index: 1;
}

#about .time {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--primary-color, #0af);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

#about .timeline-content h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #111;
}

#about .timeline-content p {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.55);
    line-height: 1.6;
    margin: 0;
}

/* スキルセクション */
#about .mt-3rem {
    margin-top: 0;
}

#about .skill-items-text {
    font-size: 0.75rem;
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.6);
    word-break: break-word;
}

/* ============================================================
   WORK セクション
   ============================================================ */
#work.section {
    overflow-y: scroll !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    /* 背景は透明 - グリッドが見える */
    background: transparent;
}

#work .section-title-wrap {
    padding: 40px 20px 20px;
    margin-bottom: 0;
}

#work .portfolio-gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 20px 100px;
    /* 下部に余白 */
    width: 100%;
    box-sizing: border-box;
}

/* カードスタイル - スリガラス風 */
#work .card {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

#work .card-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

#work .card:active .card-img-placeholder {
    opacity: 0.2;
}

#work .card-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 5px 0;
    color: #111;
}

#work .card-tag {
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: #555;
    font-weight: 700;
}

#work .card-desc {
    font-size: 0.8rem;
    color: #333;
    margin-top: 5px;
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
}

#work .card-cta {
    font-size: 0.75rem;
    margin-top: 15px;
    display: inline-block;
    color: var(--primary-color, #0af);
    font-weight: 700;
    opacity: 1 !important;
}

/* ============================================================
   LAB セクション
   ============================================================ */
#lab.section {
    overflow: hidden;
    padding: 0;
    /* スリガラス風オーバーレイ */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

#lab .lab-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

/* ============================================================
   CONTACT セクション
   ============================================================ */
#contact.section {
    overflow: hidden;
    padding: 0;
    /* スリガラス風オーバーレイ */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* LAB (LINK) セクション */
#lab.section {
    justify-content: center;
    align-items: center;
    background: transparent !important;
    position: absolute !important;
    /* SPでは絶対配置で重ねる */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    /* layout.cssでflexだが念のため */
}

/* Labセクション表示時にグローバル背景とアニメーションを強制表示 */
/* Lab/Contactセクション表示時にグローバル背景とアニメーションを強制表示 */
/* .main-content (z:10) より手前に表示させるため z-index: 15 に設定 */
body:has(#lab.section.active) #bg-root,
body:has(#lab.section.active) .grid-system,
body:has(#lab.section.active) #particles,
body:has(#lab.section.active) .scanning-line,
body:has(#lab.section.active) .scanning-line-v,
body:has(#contact.section.active) #bg-root,
body:has(#contact.section.active) .grid-system,
body:has(#contact.section.active) #particles,
body:has(#contact.section.active) .scanning-line,
body:has(#contact.section.active) .scanning-line-v {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 15 !important;
}

/* Contactの場合はコンテンツをさらに手前に出す */
body:has(#contact.section.active) #contact.section {
    z-index: 20 !important;
}



.contact-warning {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    /* 背景透過 - グリッドを表示 */
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 20px !important;
    box-sizing: border-box;
    margin: 0 !important;
}

.warning-text {
    font-size: clamp(2rem, 12vw, 6rem);
    font-weight: 900;
    line-height: 0.9;
    color: #ff3b3b !important;
    margin: 0;
    letter-spacing: -0.05em;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
}

.warning-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #ff3b3b !important;
    margin-bottom: 15px;
    letter-spacing: 3px;
    opacity: 0.6;
    text-align: center;
    width: 100%;
}

/* 点滅アニメーションドット */
.warning-dot {
    width: 10px;
    height: 2px;
    background: #ff3b3b !important;
    margin-bottom: 15px;
    animation: warning-blink 0.2s infinite;
}

@keyframes warning-blink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.2;
    }
}

.warning-subtext {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #ff3b3b !important;
    margin-top: 30px;
    padding: 4px 16px;
    border: 1px solid #ff3b3b !important;
    display: inline-block;
    letter-spacing: 1px;
    text-align: center;
}


.access-denied-stamp {
    display: block;
    margin-top: 30px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #ff3b3b !important;
    opacity: 0.8 !important;
    letter-spacing: 2px;
    padding: 5px 10px;
    border: 1px solid #ff3b3b !important;
    text-align: center;
}

/* 縦書きテキスト（PCデザイン踏襲） */
.vertical-text {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    color: #ff3b3b !important;
    opacity: 0.3;
    letter-spacing: 4px;
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
}

/* ============================================================
   CONTACT (LINK) セクション
   ============================================================ */
#contact.section {
    overflow: hidden !important;
    /* 1ページに収めるためスクロール禁止 */
    padding: 0;
    /* 背景は透明 */
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh !important;
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#contact .contact-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    padding: 15px 20px 20px;
    /* 上部余白を70%削減（50px -> 15px） */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* 上詰めに変更して余白を制御 */
    align-items: center;
    gap: 15px;
    /* バランスの良い間隔に戻す */
    transform: none;
    /* スケール小を解除 */
}

#contact .section-tag {
    align-self: flex-start;
    margin-bottom: 5px;
}

#contact .contact-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    /* サイズを大きく戻す */
    font-weight: 900;
    line-height: 1.1;
    color: #111;
    margin-bottom: 10px;
    width: 100%;
    text-align: left;
}

/* ステータスインジケーター (channel_status) */
#contact .status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    /* 元の30pxから50%詰めて15pxに設定 */
    width: 100%;
}

#contact .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #44ff44;
    box-shadow: 0 0 10px #44ff44;
}

#contact .status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 1px;
}

/* コンタクトフォーム - スリガラス風 */
#contact .contact-form-glass {
    width: 100%;
    background: #000000;
    /* 不透明なブラック背景を維持 */
    opacity: 1;
    backdrop-filter: none;
    /* ブラーを解除 */
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* 赤枠を削除し、薄い白枠に変更 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 20px;
    /* パディングを戻す */
    box-sizing: border-box;
    margin-top: 5px;
}

#contact .form-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #ffffff;
    /* 白文字に変更 */
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 1px;
}

#contact .form-group {
    margin-bottom: 12px;
    /* マージンを戻す */
}

#contact .form-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #aaaaaa;
    /* 明るいグレーに変更 */
    margin-bottom: 5px;
    letter-spacing: 1px;
}

#contact .form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    /* わずかに明るい背景 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    color: #ffffff;
    /* 白文字に変更 */
    border-radius: 6px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#contact .form-input:focus {
    outline: none;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

#contact textarea.form-input {
    height: 70px;
    /* 適度な高さに調整 */
    min-height: 70px;
    resize: none;
}

/* 送信ボタン */
#contact .form-submit-btn {
    width: 100%;
    padding: 14px;
    background: #ffffff;
    /* 黒背景なのでボタンは白に反転 */
    color: #000000;
    /* ボタンテキストは黒 */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    margin-top: 5px;
}

#contact .form-submit-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* 詳細ページコンテナ (Project Viewer Root) */
.project-viewer-root {
    box-sizing: border-box;
    /* JSでinline styleが設定されているので、必要なら !important */
}

.project-content-area {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 60px;
}

/* ナビゲーションバー */
/* ナビゲーションバー - コンパクト版 */
.project-nav-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* インラインスタイルで display: flex が当たっているdivを上書き */
.project-nav-bar>div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100%;
}

.nav-title {
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    margin-bottom: 2px;
    opacity: 0.5;
    letter-spacing: 2px;
}

.project-nav-bar a {
    text-decoration: none;
    color: #333;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
}

/* Closeボタン (Back to List) - 1行目 */
.project-nav-bar .close-project {
    background: #111;
    color: #fff;
    border: 1px solid #111;
    width: 100%;
    /* 強制的に100%幅を取って改行させる */
    flex: 0 0 100%;
    margin-bottom: 5px;
    order: -1;
    /* 念のため先頭に */
    padding: 8px 10px;
}

/* プロジェクトリンク - 2行目 */
.project-nav-bar .project-link {
    flex: 1;
    min-width: 60px;
    /* 小さくなりすぎないように */
    max-width: 100px;
}

/* 詳細コンテンツコンテナ */
.project-detail.note-grid-only {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    display: block !important;
}

/* ヘッダー */
.project-header {
    margin-bottom: 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
}

.hud-label {
    display: block;
    font-size: 0.6rem;
    color: var(--primary-color, #0af);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.project-title {
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 900;
    color: #111;
    word-break: break-word;
}

/* プロジェクトボディ - スリガラス風 */
.project-body.hud-grid-bg {
    width: 100%;
    box-sizing: border-box;
    padding: 20px !important;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    position: relative;
    margin-bottom: 40px;
}

/* スキャンラインエフェクトなどは非表示に */
.hud-scanline {
    display: none;
}

.project-hero-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    margin-bottom: 20px;
    background-color: #eee;
    /* 読み込み前用 */
    background-size: cover;
    background-position: center;
}

.project-info {
    font-size: 0.85rem;
    line-height: 1.8;
    color: #333;
}

.hud-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 0.65rem;
    color: #555;
    letter-spacing: 1px;
}