/* =========================================================
   Baby Sleep — shared styles
   Soft night-light pastels taken straight from the app's
   theme palettes (default: Lavender). Every color is a
   variable, so the cloud picker can re-tint the whole page,
   and dark mode follows the visitor's system setting.
   ========================================================= */

:root {
    /* Lavender · light (app palette) */
    --bg: #D5CBE0;
    --surface: #D7CCE3;
    --sheet: #F1ECF6;
    --active: #E1D5EA;
    --text: #493E59;
    --muted: #614F6E;
    --accent: #68517F;
    --ink: #FAF6FF;
    --line: #AA98BE;
    --cloud: #9980B2;
    --shadow: #836C9C;
    --face: #443151;
    --cheek: #E1B0CB;
    --tile: #F4EFF9;

    --glow: rgba(255, 255, 255, 0.6);
    --card-shadow: 0 24px 60px rgba(60, 40, 80, 0.18);
    --soft-shadow: 0 10px 30px rgba(60, 40, 80, 0.12);

    --radius: 28px;
    --radius-sm: 18px;
    --maxw: 1120px;

    --font-head: "Nunito", "Segoe UI Rounded", system-ui, sans-serif;
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

    color-scheme: light;
}

/* Lavender · dark (app palette) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #3C3045;
        --surface: #4E4058;
        --sheet: #44364D;
        --active: #574562;
        --text: #F4E9F5;
        --muted: #D4C2D8;
        --accent: #EBC7D5;
        --ink: #503647;
        --line: #77627F;
        --cloud: #F0D0DC;
        --shadow: #D5ABBF;
        --face: #66475D;
        --cheek: #D999AF;
        --tile: #4A3C53;
        --glow: rgba(240, 208, 220, 0.10);
        --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
        --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #3C3045;
    --surface: #4E4058;
    --sheet: #44364D;
    --active: #574562;
    --text: #F4E9F5;
    --muted: #D4C2D8;
    --accent: #EBC7D5;
    --ink: #503647;
    --line: #77627F;
    --cloud: #F0D0DC;
    --shadow: #D5ABBF;
    --face: #66475D;
    --cheek: #D999AF;
    --tile: #4A3C53;
    --glow: rgba(240, 208, 220, 0.10);
    --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    line-height: 1.65;
    background-color: var(--bg);
    background-image:
        radial-gradient(1000px 700px at 85% -10%, var(--glow), transparent 65%),
        radial-gradient(800px 600px at -10% 30%, color-mix(in srgb, var(--cloud) 22%, transparent), transparent 60%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--text);
}

img,
svg {
    max-width: 100%;
    display: block;
}

img {
    height: auto;
}

h1,
h2,
h3 {
    font-family: var(--font-head);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 24px;
}

/* ---------- Sleepy cloud mascot (inline SVG) ---------- */
.cloud-svg {
    --cb: var(--cloud);
    --cs: var(--shadow);
    --cf: var(--face);
    --cc: var(--cheek);
    aspect-ratio: 230 / 150;
    height: auto;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-accent {
    background: var(--accent);
    color: var(--ink);
    box-shadow: var(--soft-shadow);
}

.btn-accent:hover {
    color: var(--ink);
    transform: translateY(-2px);
}

.btn-ghost {
    background: color-mix(in srgb, var(--tile) 70%, transparent);
    border-color: color-mix(in srgb, var(--line) 50%, transparent);
    color: var(--text);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--tile);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 35%, transparent);
    transition: background 0.5s ease;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.brand:hover {
    color: var(--text);
}

.brand .dot {
    color: var(--accent);
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: var(--soft-shadow);
}

.site-header .btn {
    padding: 9px 18px;
    font-size: 0.9rem;
}

/* ---------- Hero ---------- */
.hero {
    padding: 72px 0 56px;
    position: relative;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-copy,
.hero-art {
    min-width: 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tile) 70%, transparent);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 22px;
}

.hero .pssst {
    font-family: var(--font-head);
    font-weight: 850;
    font-size: clamp(1.4rem, 2.4vw, 1.7rem);
    color: var(--accent);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.hero h1 {
    font-size: clamp(2.6rem, 5.4vw, 4rem);
    font-weight: 850;
    margin-bottom: 20px;
}

.hero p.lead {
    font-size: 1.16rem;
    color: var(--muted);
    max-width: 520px;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.hero-note {
    margin-top: 18px;
    font-size: 0.9rem;
    color: var(--muted);
    opacity: 0.85;
}

.hero-art {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-art img {
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

.hero-cloud {
    position: absolute;
    width: 150px;
    right: -10px;
    bottom: -36px;
    filter: drop-shadow(0 12px 18px rgba(40, 20, 60, 0.18));
    animation: drift 7s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-cloud { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Section headings ---------- */
.section {
    padding: 72px 0;
}

.section-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 56px;
}

.section-head .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 14px;
}

.section-head h2 {
    font-size: clamp(2rem, 3.6vw, 2.7rem);
    font-weight: 850;
    margin-bottom: 14px;
}

.section-head p {
    color: var(--muted);
    font-size: 1.08rem;
}

/* ---------- Feature rows (alternating) ---------- */
.feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
    margin-bottom: 96px;
}

.feature:last-child {
    margin-bottom: 0;
}

.feature-text,
.feature-media {
    min-width: 0;
}

.feature.reverse .feature-text {
    order: 2;
}

.feature.reverse .feature-media {
    order: 1;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: var(--tile);
    box-shadow: var(--soft-shadow);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.feature-text h3 {
    font-size: clamp(1.6rem, 2.6vw, 2rem);
    font-weight: 850;
    margin-bottom: 14px;
}

.feature-text p {
    color: var(--muted);
    font-size: 1.06rem;
    max-width: 460px;
}

.feature-media {
    display: flex;
    justify-content: center;
}

.feature-media img {
    width: 100%;
    max-width: 320px;
    border-radius: 30px;
    box-shadow: var(--card-shadow);
}

/* ---------- Color picker (ten sleepy clouds) ---------- */
.swatches {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 26px;
    max-width: 460px;
}

.swatch {
    appearance: none;
    border: 2px solid transparent;
    background: var(--sw-bg);
    border-radius: 16px;
    padding: 8px 4px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font: 600 0.72rem/1.2 var(--font);
    color: var(--sw-text);
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.swatch:hover {
    transform: translateY(-2px);
}

.swatch[aria-pressed="true"] {
    border-color: var(--sw-text);
}

.swatch:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.swatch svg {
    width: 44px;
    aspect-ratio: 230 / 150;
    height: auto;
    --cb: var(--sw-cloud);
    --cs: var(--sw-shadow);
    --cf: var(--sw-face);
    --cc: var(--sw-cheek);
    --cw: 8px;
}

.swatch-hint {
    margin-top: 12px;
    font-size: 0.88rem;
    color: var(--muted);
    opacity: 0.85;
}

/* ---------- Sound library ---------- */
.library {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.library-group {
    background: color-mix(in srgb, var(--tile) 72%, transparent);
    border-radius: var(--radius);
    padding: 26px 22px;
    box-shadow: var(--soft-shadow);
}

.library-group h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.library-group ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.library-group li {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
}

/* ---------- Download CTA band ---------- */
.cta-band {
    margin: 30px auto 90px;
    max-width: var(--maxw);
    text-align: center;
    padding: 60px 32px;
    border-radius: 36px;
    background: var(--tile);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.cta-band img.cta-icon {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    margin: 0 auto 22px;
    box-shadow: var(--soft-shadow);
}

.cta-band h2 {
    font-size: clamp(1.9rem, 3.6vw, 2.5rem);
    font-weight: 850;
    margin-bottom: 14px;
}

.cta-band p {
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto 30px;
    font-size: 1.08rem;
}

/* Google Play badge (CSS-drawn) */
.play-badge {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    padding: 12px 26px;
    border-radius: 16px;
    background: #1d1724;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-badge:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(30, 20, 40, 0.35);
}

.play-badge .play-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.play-badge .play-text small {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e4dcef;
}

.play-badge .play-text strong {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.1;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid color-mix(in srgb, var(--line) 35%, transparent);
    padding: 44px 0;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-head);
    font-weight: 800;
    color: var(--text);
}

.footer-brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.footer-links {
    display: flex;
    gap: 26px;
    list-style: none;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--muted);
    font-weight: 500;
}

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

.footer-copy {
    width: 100%;
    color: var(--muted);
    opacity: 0.8;
    font-size: 0.85rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 35%, transparent);
    padding-top: 20px;
    margin-top: 4px;
}

/* ---------- Simple content page (privacy / terms) ---------- */
.content-page {
    max-width: 760px;
    margin: 60px auto 90px;
    padding: 44px;
    background: var(--tile);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

.content-page h1 {
    font-size: 2.3rem;
    font-weight: 850;
    margin-bottom: 8px;
}

.content-page .updated {
    color: var(--muted);
    opacity: 0.85;
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.content-page h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 32px 0 10px;
    color: var(--text);
}

.content-page p {
    color: var(--muted);
    margin-bottom: 14px;
}

.content-page ul {
    margin: 0 0 16px 0;
    padding-left: 22px;
    color: var(--muted);
}

.content-page li {
    margin-bottom: 8px;
}

.content-page strong {
    color: var(--text);
}

.content-page a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.content-page .policy-highlight {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 0 0 28px;
}

.content-page .policy-highlight p {
    margin-bottom: 0;
    color: var(--text);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero {
        padding: 36px 0 48px;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 36px;
    }

    .hero p.lead {
        margin-inline: auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-art img {
        width: 100%;
        max-width: 520px;
    }

    .hero-cloud {
        width: 110px;
        right: 4px;
        bottom: -28px;
    }

    .feature {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
        margin-bottom: 64px;
    }

    .feature.reverse .feature-text,
    .feature.reverse .feature-media {
        order: 0;
    }

    .feature-text p,
    .swatches {
        margin-inline: auto;
    }

    .feature-icon {
        margin-inline: auto;
    }

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

@media (max-width: 620px) {
    .container {
        padding-inline: 16px;
    }

    .hero {
        padding: 28px 0 40px;
    }

    .hero-badge {
        font-size: 0.8rem;
        margin-bottom: 16px;
    }

    .hero p.lead {
        font-size: 1.05rem;
        margin-bottom: 24px;
    }

    .hero-cta .play-badge {
        flex: 1 1 100%;
        justify-content: center;
    }

    .hero-cta .btn-ghost {
        flex: 1 1 100%;
    }

    .section {
        padding: 56px 0;
    }

    .library {
        grid-template-columns: 1fr;
    }

    .swatches {
        gap: 6px;
    }

    .swatch {
        font-size: 0.64rem;
        border-radius: 12px;
    }

    .swatch svg {
        width: 36px;
    }

    .cta-band {
        margin-inline: 16px;
        padding: 48px 20px;
    }

    .content-page {
        margin: 32px 16px 64px;
        padding: 28px 20px;
    }

    .content-page h1 {
        font-size: 1.9rem;
    }
}
