/* calmcast.delattre.me, built from the app's own design: the mesh gradient from Theme.swift,
   glass panels, the system blue accent, and the App Store screenshot type
   (Montserrat light over Libre Baskerville italic). Fonts: SIL OFL, see /assets/fonts. */

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/montserrat.woff2") format("woff2");
}
@font-face {
    font-family: "Libre Baskerville";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/libre-baskerville-italic.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    /* AppColors.lightGradient */
    --g1: #d9f2e6;
    --g2: #e0f0fa;
    --g3: #f0e6fa;
    --g4: #dbf2f2;
    --ink: #13203a;
    --soft: #3f4c66;      /* 7:1 on the gradient */
    --accent: #1f62c9;    /* app accent #3380F2, deepened for text contrast */
    --glass: rgb(255 255 255 / .55);
    --glass-edge: rgb(255 255 255 / .8);
    --glass-shade: rgb(19 32 58 / .10);
    --rule: rgb(19 32 58 / .12);
    --btn-bg: #13203a;
    --btn-ink: #ffffff;
    --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --page: min(64rem, 100% - 2 * clamp(1rem, 4vw, 2rem));
    --ease: cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-color-scheme: dark) {
    :root {
        /* AppColors.darkGradient */
        --g1: #291a4d;
        --g2: #0f1433;
        --g3: #1a294d;
        --g4: #0a0d1f;
        --ink: #eef1fb;
        --soft: #b9c2dc;
        --accent: #78b8ff;
        --glass: rgb(255 255 255 / .07);
        --glass-edge: rgb(255 255 255 / .14);
        --glass-shade: rgb(0 0 0 / .35);
        --rule: rgb(255 255 255 / .12);
        --btn-bg: #ffffff;
        --btn-ink: #0f1433;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font: 400 1rem/1.65 var(--sans);
    -webkit-font-smoothing: antialiased;
    /* A 2x2 mesh gradient, like the app's AppBackground */
    background-color: var(--g2);
}
/* Fixed gradient layer (background-attachment: fixed is ignored on iOS) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(at 0% 0%, var(--g1) 0, transparent 60%),
        radial-gradient(at 100% 0%, var(--g2) 0, transparent 60%),
        radial-gradient(at 0% 100%, var(--g3) 0, transparent 60%),
        radial-gradient(at 100% 100%, var(--g4) 0, transparent 60%);
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; height: auto; }
ul[role="list"] { list-style: none; margin: 0; padding: 0; }
.sprite { position: absolute; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; padding: .6rem 1rem; background: var(--btn-bg); color: var(--btn-ink); border-radius: 8px; z-index: 10; }
.skip-link:focus { top: 1rem; }

/* Glass, like .thinMaterial with a 20pt radius */
.glass {
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    border-radius: 20px;
    box-shadow: 0 1px 2px var(--glass-shade), 0 18px 40px -24px var(--glass-shade);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
}

/* Two-line titles in the App Store screenshot style */
.l1 { display: block; font-family: var(--sans); font-weight: 300; letter-spacing: -.01em; }
.l2 { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

/* Top bar */
.topbar {
    width: var(--page);
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; border-radius: 22.5%; }
.topbar nav { display: flex; gap: .25rem 1.25rem; flex-wrap: wrap; font-size: .9375rem; font-weight: 500; }
.topbar nav a { text-decoration: none; color: var(--soft); padding: .35rem 0; }
.topbar nav a:hover { color: var(--ink); }

main { width: var(--page); margin: 0 auto; }
section { margin-top: clamp(3.5rem, 8vw, 6rem); }

/* Hero */
.hero { margin-top: clamp(2rem, 6vw, 4rem); text-align: center; display: grid; justify-items: center; }
.pulse { position: relative; width: 112px; height: 112px; margin-bottom: 2rem; }
.pulse img { position: relative; width: 112px; height: 112px; border-radius: 22.5%; box-shadow: 0 20px 40px -18px rgb(15 20 51 / .55); }
.ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: 0;
}
h1 { font-size: clamp(2.4rem, 7vw, 4.25rem); line-height: 1.08; margin: 0 0 1.25rem; }
.lede { font-size: clamp(1.0625rem, 1.8vw, 1.25rem); color: var(--soft); max-width: 34em; margin: 0 0 2rem; text-wrap: pretty; }
.req { font-size: .875rem; color: var(--soft); margin: 1rem 0 0; }

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 54px;
    padding: .5rem 1.4rem .5rem 1.1rem;
    border-radius: 14px;
    background: var(--btn-bg);
    color: var(--btn-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.05;
    text-align: left;
    box-shadow: 0 12px 24px -14px rgb(15 20 51 / .6);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.store-btn svg { width: 1.6rem; height: 1.6rem; }
.store-btn small { display: block; font-size: .7rem; font-weight: 500; opacity: .8; }
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -14px rgb(15 20 51 / .6); }

/* Intents */
.intents ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.intents li { padding: 1.4rem 1.5rem; }
.intents svg { width: 1.6rem; height: 1.6rem; color: var(--accent); }
.intents h3 { margin: .7rem 0 .2rem; font-size: 1.125rem; font-weight: 600; }
.intents p { margin: 0; color: var(--soft); }
.intents .note { text-align: center; margin-top: 1.25rem; font-size: .9375rem; }

/* Section titles */
h2 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); line-height: 1.12; margin: 0 0 1.75rem; text-align: center; }

/* Sound categories */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; align-items: start; }
.cat { overflow: hidden; }
.cat img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cat-body { padding: 1.25rem 1.4rem 1.4rem; }
.cat h3 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.cat-body > p { margin: .15rem 0 .9rem; color: var(--soft); font-size: .9375rem; line-height: 1.5; }
.names { display: flex; flex-wrap: wrap; gap: .4rem; }
.names li {
    font-size: .8125rem;
    font-weight: 500;
    padding: .3rem .65rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--glass);
}

/* Features */
.features dl { margin: 0; padding: .5rem clamp(1.25rem, 3vw, 2rem); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); column-gap: 2.5rem; }
.features dl div { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.features dl div:last-child { border-bottom: 0; }
@media (min-width: 46rem) { .features dl div:nth-last-child(2) { border-bottom: 0; } }
.features dt { font-weight: 600; }
.features dd { margin: .15rem 0 0; color: var(--soft); font-size: .9375rem; line-height: 1.55; }

/* Privacy */
.privacy { padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 4vw, 3rem); text-align: center; }
.privacy h2 { margin-bottom: 1rem; }
.privacy p { margin: 0 auto; max-width: 34em; color: var(--soft); font-size: 1.0625rem; }

.cta { text-align: center; margin-top: clamp(2.5rem, 6vw, 4rem); }

.footer {
    width: var(--page);
    margin: clamp(3rem, 7vw, 5rem) auto 0;
    padding: 1.5rem 0 2.5rem;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    font-size: .875rem;
    color: var(--soft);
}
.footer p { margin: 0; }
.footer .links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.footer a { color: var(--ink); }

/* Legal pages */
.legal { width: min(46rem, 100% - 2rem); margin: clamp(1.5rem, 4vw, 3rem) auto 0; padding: clamp(1.5rem, 4vw, 3rem); }
.legal h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin-bottom: .5rem; }
.legal h2 { text-align: left; font-size: 1.25rem; font-weight: 600; margin: 2.25rem 0 .75rem; }
.legal h3 { font-size: 1.0625rem; margin: 1.5rem 0 .5rem; }
.legal p, .legal li { color: var(--soft); }
.legal strong { color: var(--ink); }
.legal .updated { font-size: .875rem; color: var(--soft); margin-bottom: 2rem; }
.legal a { color: var(--accent); }

/* One moment: the rings breathe out from the icon, like the app icon's sound rings */
@media (prefers-reduced-motion: no-preference) {
    .ring { animation: breathe 6s var(--ease) infinite; }
    .ring:nth-child(2) { animation-delay: 2s; }
    .ring:nth-child(3) { animation-delay: 4s; }
    .hero > :not(.pulse) { animation: rise .9s var(--ease) both; }
    .hero h1 { animation-delay: .1s; }
    .hero .lede { animation-delay: .2s; }
    .hero .store-btn, .hero .req { animation-delay: .3s; }
}
@keyframes breathe {
    0% { transform: scale(1); opacity: .55; }
    100% { transform: scale(2.6); opacity: 0; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 34rem) {
    .topbar nav a[href="/privacy"] { display: none; }
}
.legal .notice { border: 1px solid var(--rule); border-radius: 12px; padding: .25rem 1.1rem; margin: 0 0 1.5rem; background: var(--glass); }
main.legal { width: min(46rem, 100% - 2rem); }
