/* 変数の定義 */
:root {
    --bg-color-surface: #f4f1ea;
    --bg-color-works: #0f267f;
    --bg-color-profile: #0f267f;
    --bg-color-event: #040a23;
    --text-color-dark: #f4f1ea;
    --text-color-light: #f4f1ea;
    --font-main: 'Zen Old Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'MS PMincho', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* 背景色を --bg-color-works に統一 */
    background-color: var(--bg-color-works);
    font-family: var(--font-main);
    overflow: hidden;
    position: relative;
}

/* ノイズレイヤー */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ビューワーの外枠 */
.viewer {
    height: 100vh;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    direction: rtl; /* 右から左へのスクロール */
    background-color: var(--bg-color-works);
}

/* 本文エリア */
.content {
    writing-mode: vertical-rl;
    height: 100%;
    padding: 8vh 5vw;
    direction: ltr;
    position: relative;
    z-index: 2;
    min-width: 100vw;
}

/* 文字色（背景が明るい水色なのでダークカラーに固定） */
.content h2, 
.content p {
    color: var(--text-color-dark);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

h2 {
    font-size: 2rem;
    margin-left: 2em;
    border-left: 1px solid currentColor;
    padding-left: 0.5em;
    font-weight: 700;
}

p {
    margin-left: 2em;
    text-align: justify;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    line-height: 2;
}

/* 泡の演出用 */
#bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    animation: floatUp 10s infinite ease-in;
}

@keyframes floatUp {
    0% { transform: translateY(110vh); opacity: 0; }
    50% { opacity: 0.6; }
    100% { transform: translateY(-10vh); opacity: 0; }
}

/* 戻るボタン */
.back-home {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    color: var(--text-color-dark);
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid var(--text-color-dark);
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.back-home:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* スクロールバー */
.viewer::-webkit-scrollbar { height: 6px; }
.viewer::-webkit-scrollbar-track { background: transparent; }
.viewer::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }