/* Ember — A Warm Presence */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ember-warm: #ff6b35;
    --ember-glow: #ff9f1c;
    --ember-soft: #ffb347;
    --ember-deep: #c73e1d;
    --bg-dark: #0a0a0c;
    --bg-warm: #12100e;
    --text-soft: rgba(255, 255, 255, 0.6);
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: var(--bg-dark);
    color: white;
    overflow: hidden;
    min-height: 100vh;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#ember-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    touch-action: none;
}

/* Screens */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    background: radial-gradient(ellipse at center, var(--bg-warm) 0%, var(--bg-dark) 100%);
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Start Screen */
.start-content {
    text-align: center;
    padding: 40px 20px;
}

.ember-preview {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
}

.preview-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--ember-glow) 0%, var(--ember-warm) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: preview-breathe 4s ease-in-out infinite;
}

@keyframes preview-breathe {
    0%, 100% { 
        transform: scale(0.8); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.2); 
        opacity: 1; 
    }
}

.start-content h1 {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: 8px;
    margin-bottom: 12px;
    color: var(--ember-soft);
}

.tagline {
    font-size: 18px;
    color: var(--text-soft);
    margin-bottom: 48px;
    font-style: italic;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 48px;
}

.feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    color: var(--text-soft);
}

.feature-icon {
    font-size: 20px;
}

.start-btn {
    padding: 18px 48px;
    font-size: 18px;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--ember-warm) 0%, var(--ember-deep) 100%);
    border: none;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(255, 107, 53, 0.5);
}

.start-btn:active {
    transform: scale(0.98);
}

.hint {
    margin-top: 24px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* Main Experience */
#ember-screen {
    background: transparent;
    pointer-events: auto;
}

.exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    font-family: inherit;
}

.exit-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.breath-hint {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    pointer-events: none;
}

#breath-text {
    font-size: 16px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
    transition: opacity 0.5s ease;
}

.session-time {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    pointer-events: none;
}

#time-display {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.15);
    font-family: system-ui, sans-serif;
    letter-spacing: 1px;
}

/* End Screen */
.end-content {
    text-align: center;
    padding: 40px 20px;
}

.end-content h2 {
    font-size: 64px;
    margin-bottom: 24px;
}

.end-message {
    font-size: 24px;
    font-style: italic;
    color: var(--text-soft);
    margin-bottom: 16px;
}

.end-time {
    font-size: 18px;
    color: var(--ember-soft);
    margin-bottom: 48px;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .start-content h1 {
        font-size: 36px;
        letter-spacing: 4px;
    }
    
    .tagline {
        font-size: 16px;
    }
    
    .start-btn {
        padding: 16px 40px;
        font-size: 16px;
    }
}

/* Prevent pull-to-refresh */
html, body {
    overscroll-behavior: none;
}

