/* ==========================================================================
   Sleep Relax — Landing Page Styles
   Design System: context/design-system.md
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-elevated: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #999999;
    --accent: #4a9eff;
    --accent-light: #6bb6ff;
    --accent-dark: #2d5aa0;
    --premium-gold: #daa520;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-gentle: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-quick: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-quick);
}

a:hover {
    color: var(--accent-light);
}

/* ---------- Container ---------- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-stack);
    border: none;
    cursor: pointer;
    transition: all var(--transition-quick);
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(74, 158, 255, 0.3);
}

.btn-primary:hover {
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(74, 158, 255, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 12px 28px;
}

.btn-secondary:hover {
    background: rgba(74, 158, 255, 0.1);
    color: var(--accent-light);
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
    border-radius: var(--radius-md);
}

.apple-icon {
    flex-shrink: 0;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg,
            rgba(26, 26, 26, 0.4) 0%,
            rgba(26, 26, 26, 0.2) 40%,
            rgba(26, 26, 26, 0.6) 80%,
            rgba(26, 26, 26, 1) 100%
        );
}

/* Star particles */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.hero-particles::before,
.hero-particles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: twinkle 4s ease-in-out infinite;
}

.hero-particles::before {
    width: 3px;
    height: 3px;
    top: 20%;
    left: 30%;
    animation-delay: 0s;
}

.hero-particles::after {
    width: 2px;
    height: 2px;
    top: 35%;
    right: 25%;
    animation-delay: 2s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 40px 20px;
}

.hero-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin: 0 auto 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.hero h1 {
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.5;
}

.hero-free-note {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ==========================================================================
   SOUNDSCAPE / MIXER SECTION
   ========================================================================== */
.soundscape-section {
    padding: 80px 0 60px;
    background: var(--bg-primary);
}

.soundscape-section h2 {
    text-align: center;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
}

/* Mixer Container */
.mixer {
    max-width: 600px;
    margin: 0 auto 32px;
    padding: 28px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Play Button */
.mixer-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent);
    cursor: pointer;
    transition: all var(--transition-quick);
}

.mixer-play-btn:hover {
    background: rgba(74, 158, 255, 0.25);
    transform: scale(1.05);
}

.mixer-play-btn.playing {
    background: var(--accent);
    color: var(--bg-primary);
}

.mixer-play-btn.playing:hover {
    background: var(--accent-light);
}

.mixer-play-btn .play-icon {
    padding-left: 3px; /* visual centering for triangle */
}

/* Mixer Channels */
.mixer-channels {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.channel {
    display: grid;
    grid-template-columns: 44px 72px 1fr;
    align-items: center;
    gap: 12px;
}

.channel-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-quick);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.channel-toggle.active {
    border-color: var(--accent);
    background: rgba(74, 158, 255, 0.15);
}

.channel-toggle:not(.active) {
    opacity: 0.4;
}

.channel-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Volume Slider */
.channel-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.channel-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.channel-volume::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.channel-volume::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.channel:has(.channel-toggle:not(.active)) .channel-volume {
    opacity: 0.3;
    pointer-events: none;
}

.mixer-cta {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 16px;
}

.mixer-cta strong {
    color: var(--text-primary);
}

.soundscape-section .btn-secondary {
    display: block;
    max-width: 280px;
    margin: 0 auto;
    text-align: center;
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */
.features-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.features-section h2 {
    text-align: center;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-gentle);
}

.feature-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.feature-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.feature-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-pain {
    font-size: 14px;
    color: var(--accent);
    font-style: italic;
    margin-bottom: 8px;
}

.feature-card > p:last-child {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   AUDIENCE SECTION
   ========================================================================== */
.audience-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

.audience-section h2 {
    text-align: center;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    margin-bottom: 48px;
}

.audience-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.audience-card {
    text-align: center;
    padding: 32px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-gentle);
}

.audience-card:hover {
    border-color: var(--glass-border-hover);
}

.audience-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 16px;
}

.audience-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.audience-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   SCREENSHOTS SECTION
   ========================================================================== */
.screenshots-section {
    padding: 80px 0;
    background: var(--bg-secondary);
    overflow: hidden;
}

.screenshots-section h2 {
    text-align: center;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    margin-bottom: 40px;
}

.screenshots-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 16px;
    justify-content: center;
}

.screenshots-scroll::-webkit-scrollbar {
    display: none;
}

.screenshot-wrap {
    flex-shrink: 0;
    scroll-snap-align: center;
    width: 220px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
}

.screenshot-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   FAQ SECTION
   ========================================================================== */
.faq-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

.faq-section h2 {
    text-align: center;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    margin-bottom: 40px;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-quick);
}

.faq-item[open] {
    border-color: var(--glass-border-hover);
}

.faq-item summary {
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: color var(--transition-quick);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform var(--transition-quick);
}

.faq-item[open] summary::after {
    content: '\2212'; /* minus sign */
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-item p {
    padding: 0 20px 18px;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   CTA SECTION
   ========================================================================== */
.cta-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    text-align: center;
}

.cta-section h2 {
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 700;
    margin-bottom: 12px;
}

.cta-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.cta-free-note {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    padding: 40px 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand img {
    border-radius: 8px;
}

.footer-app-name {
    font-size: 16px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-tertiary);
    transition: color var(--transition-quick);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ==========================================================================
   RESPONSIVE — TABLET (768px+)
   ========================================================================== */
@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }

    .hero-app-icon {
        width: 100px;
        height: 100px;
        border-radius: 22px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .audience-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .screenshot-wrap {
        width: 260px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .footer-copy {
        order: -1;
    }
}

/* ==========================================================================
   RESPONSIVE — DESKTOP (1024px+)
   ========================================================================== */
@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .audience-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .screenshot-wrap {
        width: 280px;
    }

    .channel {
        grid-template-columns: 44px 90px 1fr;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
