/* =================================================
   存在の証明 - ベーススタイル
   テーマ: 創造性と保存性、有と無、生と死
   ================================================= */

/* フォントとベース設定 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100;200;300;400;500;600;700;800;900&family=Noto+Serif+JP:wght@200;300;400;500;600;700;900&display=swap');

:root {
    /* 色彩の哲学 */
    --void: #000000;
    --existence: #ffffff;
    --liminal: #0a0a0a;
    --whisper: rgba(255, 255, 255, 0.03);
    --breath: rgba(255, 255, 255, 0.1);
    --pulse: rgba(255, 255, 255, 0.2);
    --manifestation: rgba(255, 255, 255, 0.4);
    --essence: rgba(255, 255, 255, 0.6);
    --transcendence: rgba(255, 255, 255, 0.9);
    
    /* 時間の感覚 */
    --instant: 0.1s;
    --moment: 0.3s;
    --breath-cycle: 4s;
    --existence-cycle: 8s;
    --eternity: 20s;
    
    /* 空間の定義 */
    --void-space: 0;
    --minimal-space: 4px;
    --whisper-space: 8px;
    --breath-space: 16px;
    --presence-space: 32px;
    --existence-space: 64px;
    --infinite-space: 128px;
    
    /* タイポグラフィの重み */
    --weightless: 100;
    --whisper-weight: 200;
    --breath-weight: 300;
    --presence-weight: 400;
    --manifestation-weight: 600;
    --transcendence-weight: 900;
}

/* 無の基盤 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--void);
    color: var(--existence);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: var(--breath-weight);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 呼吸する背景 */
.breathing-void {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(
        ellipse at center,
        var(--liminal) 0%,
        var(--void) 70%
    );
    z-index: -20;
    animation: breathe var(--breath-cycle) ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* 存在のキャンバス */
#existence-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    pointer-events: none;
}

/* メインサイトへの戻りリンク */
.back-to-main {
    position: fixed;
    top: var(--presence-space);
    left: var(--presence-space);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: var(--whisper-space);
    text-decoration: none;
    color: var(--existence);
    padding: var(--whisper-space) var(--breath-space);
    background: var(--whisper);
    border: 1px solid var(--breath);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    transition: all var(--moment) ease;
    font-size: 0.85rem;
    font-weight: var(--breath-weight);
    opacity: 0.7;
}

.back-to-main:hover {
    opacity: 1;
    background: var(--breath);
    border-color: var(--essence);
    transform: translateX(-4px);
}

.back-arrow {
    font-size: 1rem;
    transition: transform var(--moment) ease;
}

.back-to-main:hover .back-arrow {
    transform: translateX(-3px);
}

.back-text {
    letter-spacing: 0.05em;
}

/* 時間の存在 */
.time-existence {
    position: fixed;
    bottom: var(--presence-space);
    left: var(--presence-space);
    z-index: 1000;
    text-align: left;
    pointer-events: none;
}

.current-time {
    font-family: 'Noto Sans JP', monospace;
    font-size: 1.2rem;
    font-weight: var(--breath-weight);
    margin-bottom: var(--whisper-space);
    opacity: 0.6;
}

.time-philosophy {
    font-size: 0.8rem;
    opacity: 0.4;
    font-style: italic;
    font-weight: var(--breath-weight);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    :root {
        --presence-space: 16px;
        --infinite-space: 64px;
    }

    .back-to-main {
        top: var(--breath-space);
        left: var(--breath-space);
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .time-existence {
        bottom: var(--breath-space);
        left: var(--breath-space);
    }
}

@media (max-width: 480px) {
    .back-to-main {
        font-size: 0.7rem;
    }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* フォーカス状態 */
button:focus,
a:focus {
    outline: 2px solid var(--essence);
    outline-offset: 2px;
}

/* 選択テキスト */
::selection {
    background: var(--pulse);
    color: var(--void);
}

::-moz-selection {
    background: var(--pulse);
    color: var(--void);
}