/* ==========================================================================
   Design System & Variables
   ========================================================================== */
:root {
    --bg-gradient-start: hsl(230, 40%, 4%);
    --bg-gradient-end: hsl(240, 50%, 2%);
    --accent-primary: hsl(260, 85%, 75%);
    --accent-primary-glow: hsla(260, 85%, 75%, 0.35);
    --accent-secondary: hsl(180, 70%, 70%);
    --accent-secondary-glow: hsla(180, 70%, 70%, 0.25);
    
    --text-main: hsl(210, 20%, 98%);
    --text-muted: hsl(210, 10%, 70%);
    
    --glass-bg: rgba(10, 12, 22, 0.45);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Noto Serif SC', "Playfair Display", Georgia, serif;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg-gradient-end);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Background Canvas */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: linear-gradient(to bottom, var(--bg-gradient-start), var(--bg-gradient-end));
}

/* ==========================================================================
   Layout Container
   ========================================================================== */
.zen-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 4rem 2rem 4rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    flex: 1;
}

/* Header */
.zen-header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    animation: float 4s ease-in-out infinite;
}

.zen-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.15em;
}

/* ==========================================================================
   Card Styling (Glassmorphism)
   ========================================================================== */
.card-section {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    transition: border 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.card-section:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 12px 40px 0 rgba(138, 92, 246, 0.1);
}

/* Grid Layout for Lower Cards */
.grid-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 768px) {
    .grid-section {
        grid-template-columns: 1fr;
    }
    .zen-container {
        padding: 2rem 1rem 6rem 1rem;
    }
    .card-section {
        padding: 2rem;
    }
}

/* ==========================================================================
   Specific Card Details
   ========================================================================== */

/* Quote Card */
.quote-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.quote-symbol {
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 1;
    color: var(--accent-primary);
    opacity: 0.5;
    height: 2rem;
}

.quote-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-main);
    margin-bottom: 1rem;
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.quote-author {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: opacity 0.5s ease;
}

/* Sound Card */
.sound-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
}

.sound-card h3, .breathing-card h3 {
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 300;
}

.sound-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: auto;
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vol-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

/* Custom Range Input */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-secondary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-secondary-glow);
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Breathing Card */
.breathing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.breathing-container {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breath-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138,92,246,0.1) 0%, rgba(138,92,246,0.3) 100%);
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 3.8s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 3.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.breath-circle span {
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-main);
    transition: opacity 0.5s ease;
}

/* Breathing Animation States */
.breath-circle.inhale {
    transform: scale(1.6);
    box-shadow: 0 0 40px 10px var(--accent-primary-glow), 0 0 60px 20px var(--accent-secondary-glow);
    background: radial-gradient(circle, rgba(138,92,246,0.2) 0%, rgba(138,92,246,0.5) 100%);
}

.breath-circle.hold {
    box-shadow: 0 0 50px 15px var(--accent-primary-glow), 0 0 80px 30px var(--accent-secondary-glow);
    animation: pulse-glow 2s infinite ease-in-out;
}

.breath-circle.exhale {
    transform: scale(1.0);
    box-shadow: 0 0 15px var(--accent-primary-glow);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    padding: 0.8rem 2.2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #8b5cf6 100%);
    color: hsl(240, 50%, 2%);
    border: none;
    box-shadow: 0 4px 15px var(--accent-primary-glow);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px var(--accent-primary-glow);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(138, 92, 246, 0.2);
}

/* ==========================================================================
   ICP Compliance Footer
   ========================================================================== */
.icp-footer {
    width: 100%;
    padding: 2rem 0;
    text-align: center;
    background: rgba(10, 12, 22, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.icp-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
}

.icp-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.icp-link:hover {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-secondary);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(5deg);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 40px 10px var(--accent-primary-glow), 0 0 60px 20px var(--accent-secondary-glow);
    }
    50% {
        box-shadow: 0 0 55px 20px var(--accent-primary-glow), 0 0 90px 40px var(--accent-secondary-glow);
    }
}
