:root {
    --bg-color: #010103;
    --text-color-base: #b0b0c0;
    --font-serif: 'Shippori Mincho', 'Noto Serif JP', serif;
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    background: #010103;
    color: var(--text-color-base);
    font-family: var(--font-serif);
    overflow-x: hidden;
    overflow-y: scroll;
    font-size: 16px;
    line-height: 2.0;
    scrollbar-width: auto;
    scrollbar-color: rgba(40, 30, 60, 0.7) rgba(5, 3, 15, 0.6);
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    background: #010103;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* === LAYER 0: Deep Space Background === */
.abyss-background {
    position: fixed;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    z-index: 0;
    background-color: #010103;
    background-image: url('../assets/img/phantom_resonance reverie.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Static Stars - hidden since image has stars */
.stars-static {
    display: none;
}

/* Wave Layers - CSS Nebula Core (lightweight) */
.wave-layer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 6;
}

.layer-1 {
    width: 100vmax;
    height: 100vmax;
    background: radial-gradient(circle,
            rgba(160, 120, 220, 0.35) 0%,
            rgba(140, 100, 200, 0.18) 30%,
            transparent 60%);
    animation: pulse-core 10s infinite ease-in-out;
}

.layer-2 {
    width: 70vmax;
    height: 70vmax;
    background: radial-gradient(circle,
            rgba(180, 140, 255, 0.28) 0%,
            rgba(150, 110, 220, 0.12) 35%,
            transparent 65%);
    animation: pulse-core 14s infinite ease-in-out reverse;
}

@keyframes pulse-core {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
    }
}

/* === LAYER 1: Canvas (Lattice, Satellite, Stars) === */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* === Header === */
.metaphor-header {
    position: relative;
    width: 100%;
    padding-top: 20vh;
    padding-bottom: 20vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.header-title {
    color: rgba(220, 230, 255, 0.9);
    font-family: 'Noto Serif JP', serif;
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-align: center;
    margin: 0;
    text-shadow:
        0 0 10px rgba(180, 200, 255, 0.6),
        0 0 20px rgba(150, 180, 250, 0.3);
    opacity: 0.9;
    animation: breathe-header 12s infinite ease-in-out;
}

@keyframes breathe-header {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
        filter: blur(0.5px);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
        filter: blur(0px);
    }
}

/* === LAYER 2: Chat Container === */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 10vh;
    position: relative;
    z-index: 100;
}

.chat-wrapper {
    padding: 1rem;
    animation: breathe-subtle 12s infinite ease-in-out;
}

/* Chat Lines */
.chat-line {
    margin-bottom: 3.5rem;
    opacity: 1;
    position: relative;
}

.chat-line p {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 2.2;
}

/* User (Right aligned, Cyan glow) */
.role-user {
    text-align: right;
    padding-left: 15%;
}

.role-user p {
    color: #e0f0ff;
    text-shadow:
        0 0 5px rgba(150, 200, 255, 1),
        0 0 15px rgba(100, 180, 255, 0.8),
        0 0 35px rgba(80, 150, 220, 0.5);
    display: inline-block;
}

/* GPT (Left aligned, Gold glow) */
.role-gpt {
    text-align: left;
    padding-right: 15%;
}

.role-gpt p {
    color: #fff8e8;
    text-shadow:
        0 0 5px rgba(255, 230, 180, 1),
        0 0 15px rgba(255, 200, 120, 0.8),
        0 0 35px rgba(255, 160, 80, 0.5);
    display: inline-block;
}

/* Hover Effect */
.chat-line:hover p {
    filter: brightness(1.2);
    transition: filter 0.3s ease;
}

/* Special Text Effects */
.shiver {
    display: inline-block;
    animation: shiver-text 0.2s infinite;
}

.melt {
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: melt-text 4s infinite alternate;
}

@keyframes shiver-text {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(0.5px, 0.5px);
    }

    50% {
        transform: translate(-0.5px, 0);
    }

    75% {
        transform: translate(0, -0.5px);
    }
}

@keyframes melt-text {
    0% {
        opacity: 1;
        filter: blur(0px);
    }

    100% {
        opacity: 0.7;
        filter: blur(1px);
    }
}

@keyframes breathe-subtle {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.001);
    }
}

/* === LAYER 3: Vignette Overlay === */
.overlay-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(5, 2, 15, 0.3) 80%, rgba(2, 1, 8, 0.5) 100%);
    pointer-events: none;
    z-index: 5;
}

.audio-visualizer-hint {
    display: none;
}

/* === Scrollbar === */

body::-webkit-scrollbar,
html::-webkit-scrollbar,
::-webkit-scrollbar {
    width: 18px;
}

body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
    background: rgba(5, 3, 15, 0.6);
}

body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
    background: rgba(40, 30, 60, 0.7);
    border-radius: 9px;
    border: 3px solid rgba(5, 3, 15, 0.6);
}

body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
    background: rgba(60, 45, 90, 0.8);
}

/* === Back Button === */
.back-button {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 200;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.back-button:hover {
    opacity: 0.7;
}

.back-button img {
    width: 32px;
    height: 32px;
    filter: brightness(0.8);
}

/* === Footer Light Beam === */
.footer-section {
    position: relative;
    width: 100%;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 3rem;
    margin-top: 0;
}

.light-beam,
.light-beam-core,
.light-particles,
.footer-ground {
    display: none;
}

.footer-text {
    position: relative;
    z-index: 10;
    text-align: center;
}

.footer-title {
    color: rgba(200, 210, 220, 0.9);
    font-family: 'Noto Serif JP', serif;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    margin: 0 0 0.8rem 0;
    text-shadow: 0 0 15px rgba(150, 170, 200, 0.4);
}

.footer-model {
    color: rgba(180, 190, 210, 0.7);
    font-family: 'Noto Serif JP', serif;
    font-size: 0.8rem;
    font-weight: 200;
    letter-spacing: 0.1em;
    margin: 0 0 0.5rem 0;
}

.footer-date {
    color: rgba(160, 170, 190, 0.6);
    font-family: 'Noto Serif JP', serif;
    font-size: 0.75rem;
    font-weight: 200;
    letter-spacing: 0.12em;
    margin: 0;
}