/* Sleep Descent Ritual */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-dark: #05050a;
    --bg-mid: #0a0a14;
    --indigo: #667eea;
    --indigo-dim: rgba(102, 126, 234, 0.1);
    --indigo-glow: rgba(102, 126, 234, 0.2);
    --text-primary: #e8eaff;
    --text-secondary: rgba(232, 234, 255, 0.6);
    --text-muted: rgba(232, 234, 255, 0.3);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', sans-serif;
}

body { font-family: var(--font-body); background: var(--bg-dark); color: var(--text-primary); min-height: 100vh; overflow: hidden; }
.ritual-container { width: 100%; height: 100vh; position: relative; }
.ambient-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at center, var(--bg-mid) 0%, var(--bg-dark) 70%); transition: opacity 5s ease; }
.ambient-bg.dimming { opacity: 0.5; }
.ambient-bg.dark { opacity: 0.2; }

.audio-toggle { position: fixed; top: 20px; left: 20px; z-index: 100; }
.audio-btn { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.audio-icon { font-size: 1.2rem; }
.audio-icon.off { display: none; }
.audio-btn.muted .audio-icon.on { display: none; }
.audio-btn.muted .audio-icon.off { display: inline; }
.close-btn { position: fixed; top: 20px; right: 20px; z-index: 100; color: var(--text-muted); text-decoration: none; font-size: 1.5rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.03); border-radius: 50%; }

.ritual-progress { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 15px; z-index: 100; opacity: 0.5; }
.progress-bar { width: 120px; height: 2px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--indigo); width: 0%; transition: width 0.5s ease; }
.progress-time { font-size: 0.8rem; color: var(--text-muted); }

.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 1.5s ease; z-index: 10; padding: 40px 20px; }
.screen.active { opacity: 1; visibility: visible; }
.screen-content { max-width: 480px; width: 100%; text-align: center; }

.ritual-icon { font-size: 3rem; margin-bottom: 20px; opacity: 0.8; }
.ritual-title { font-family: var(--font-display); font-size: 2.5rem; color: var(--indigo); margin-bottom: 10px; font-weight: 300; }
.ritual-subtitle { font-size: 1rem; color: var(--text-secondary); margin-bottom: 30px; }
.ritual-info { display: flex; justify-content: center; gap: 30px; margin-bottom: 30px; }
.info-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); }
.ritual-overview { background: var(--indigo-dim); border-radius: 12px; padding: 25px; margin-bottom: 30px; text-align: left; }
.overview-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.overview-steps { margin: 0; padding-left: 20px; color: var(--text-secondary); line-height: 1.8; font-size: 0.95rem; }
.begin-btn { background: var(--indigo); color: white; border: none; padding: 16px 48px; border-radius: 30px; font-size: 1rem; cursor: pointer; margin-bottom: 20px; opacity: 0.9; }
.prep-note { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

.phase-indicator { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 40px; opacity: 0.7; }
.phase-num { width: 28px; height: 28px; background: var(--indigo-dim); border: 1px solid var(--indigo); color: var(--indigo); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.phase-label { font-family: var(--font-display); font-size: 1.2rem; color: var(--indigo); }
.guidance-container { min-height: 80px; display: flex; align-items: center; justify-content: center; margin-bottom: 40px; }
.guidance-text { font-family: var(--font-display); font-size: 1.4rem; color: var(--text-secondary); font-style: italic; transition: opacity 1s ease; }
.visual-element { margin: 30px 0; }

.sun-set { font-size: 4rem; opacity: 0.6; animation: sunset 10s ease-in-out forwards; }
@keyframes sunset { from { transform: translateY(0); opacity: 0.6; } to { transform: translateY(50px); opacity: 0.1; } }

.sleep-orb { width: 100px; height: 100px; margin: 0 auto 20px; border: 2px solid var(--indigo); border-radius: 50%; opacity: 0.5; transition: all 4s ease; }
.sleep-orb.expand { transform: scale(1.3); opacity: 0.7; }
.sleep-orb.hold { opacity: 0.4; }
.sleep-orb.contract { transform: scale(0.7); opacity: 0.3; }
.breath-phase { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; }
.breath-count { font-size: 2rem; color: var(--indigo); font-family: var(--font-display); margin-top: 10px; }
.breath-counter { margin-top: 20px; color: var(--text-muted); font-size: 0.9rem; }
.breath-counter span { color: var(--indigo); }

.relaxation-wave { width: 200px; height: 4px; margin: 0 auto; background: var(--indigo); border-radius: 2px; animation: wave-pulse 6s ease-in-out infinite; }
@keyframes wave-pulse { 0%, 100% { transform: scaleX(1); opacity: 0.3; } 50% { transform: scaleX(1.5); opacity: 0.6; } }

.count-number { font-size: 5rem; color: var(--indigo); font-family: var(--font-display); font-weight: 300; opacity: 0.6; transition: all 1s ease; }

.drift-content { opacity: 0.4; }
.drift-text { font-family: var(--font-display); font-size: 2rem; color: var(--text-muted); font-style: italic; margin-bottom: 40px; animation: drift-fade 8s ease-in-out infinite; }
@keyframes drift-fade { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.5; } }
.stars { display: flex; justify-content: center; gap: 30px; }
.star { color: var(--indigo); font-size: 1rem; opacity: 0.3; animation: twinkle 3s ease-in-out infinite; }
.star:nth-child(2) { animation-delay: 1s; }
.star:nth-child(3) { animation-delay: 2s; }
@keyframes twinkle { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.5; } }



