:root {
    --primary: #ffffff;
    --bg-overlay: rgba(5, 5, 10, 0.3);
    --glass-bg: rgba(20, 20, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.15);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    background-color: #000;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#spatial-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 400vw;
    height: 100vh;
    display: flex;
    flex-direction: row;
    z-index: 2;
    transition: transform 1.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
}

/* Normal Mode: all sections visible, panning handles movement */
.content-section {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
    transition: opacity 1.5s ease-in-out;
    opacity: 1; 
    pointer-events: none;
}

.content-box {
    background: var(--bg-overlay);
    padding: 3rem 4rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

/* Calm mode: stack sections and use opacity fading */
body.calm-mode-active #spatial-container {
    transform: translateX(0) !important;
    transition: none;
}

body.calm-mode-active .content-section {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

body.calm-mode-active .content-section.active-section {
    opacity: 1;
    z-index: 5;
}

/* Bubble Menu Styles */
.bubble-menu {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.bubble-toggle {
    width: 50px;
    height: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.bubble-menu:hover .bubble-toggle {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.bubble-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bubble-menu:hover .bubble-links {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.bubble-links button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bubble-links button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    margin: 0 0 1rem 0;
    font-weight: 800;
    letter-spacing: -0.05em;
    text-shadow: 0 4px 24px rgba(0,0,0,0.8);
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fade-in-up 1s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

p {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin: 0 0 3rem 0;
    max-width: 600px;
    font-weight: 300;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    animation: fade-in-up 1s ease-out 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.cta-button {
    pointer-events: auto; /* Enable clicks on button */
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: fade-in-up 1s ease-out 0.4s forwards;
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(165, 180, 252, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.cta-button:active {
    transform: translateY(0) scale(0.95) !important;
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calm-button {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
    pointer-events: auto;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: rgba(20, 20, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.calm-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Sensory Chime Board */
#chime-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(4px, 1vw, 10px);
    width: 90vw;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    padding: 1.5rem;
}

.chime-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: clamp(8px, 2vw, 16px);
    transition: all 0.15s ease;
    touch-action: none; /* Crucial for touch-drag support */
    user-select: none;
    -webkit-user-select: none;
}

.chime-btn.active, .chime-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0.92);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}
