/* /expressify: the Expressify landing page.
   Colors come from the app (DSKit): idiom periwinkle #B0BFFB (#41387A in
   dark), proverb lilac #D2B1FB (#69347B), category sky #A9D6FF (#274EAB) and
   the deep ink #0A134F (#C1CBFF), in the system font with serif headings.
   The app follows the system's light and dark mode, and so does the page. */

.ex {
    position: relative;
    --ex-bg: #F3F4FF;
    --ex-surface: #FFFFFF;
    --ex-text: #0A134F;
    --ex-text-2: #4A4F75;
    --ex-sep: #D6DCF8;
    --ex-accent: #3B4FD8;
    --ex-pink: #8A3FC8;
    --ex-glow: rgba(176, 191, 251, .55);
    --ex-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
    --ex-round: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
    background: var(--ex-bg);
    color: var(--ex-text);
    font-family: var(--ex-font);
    overflow: clip;
}
@media (prefers-color-scheme: dark) {
    .ex {
        --ex-bg: #0B0C1E;
        --ex-surface: #1C1C1E;
        --ex-text: #EEF0FF;
        --ex-text-2: #B4B8D9;
        --ex-sep: #2A2D52;
        --ex-accent: #9AB3FF;
        --ex-pink: #D2B1FB;
        --ex-glow: rgba(94, 92, 230, .35);
    }
}
@media (prefers-color-scheme: dark) { body.ex-page { background: #0B0C1E; } }

.ex::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 140vh; pointer-events: none;
    background: radial-gradient(60% 50% at 70% 30%, var(--ex-glow), transparent 70%);
}

/* ── Chapter text ─────────────────────────────────────────────────────────── */
.ex-card { position: relative; z-index: 2; max-width: 440px; }
.ex-card h1, .ex-card h2 { font-family: var(--ex-round); color: var(--ex-text); letter-spacing: -.02em; }
.ex-card h1 { font-size: clamp(3rem, 6vw, 4.6rem); font-weight: 800; line-height: 1; margin: 6px 0 18px; }
.ex-card h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 800; line-height: 1.08; margin: 4px 0 14px; }
.ex-card p { color: var(--ex-text-2); font-size: 1.08rem; line-height: 1.6; margin: 0 0 12px; }
.ex-card .ex-lede { font-size: 1.25rem; color: var(--ex-text); }
.ex-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ex-accent) !important; margin-bottom: 6px !important;
}
.ex-feature h2 { color: var(--ex-text); }
.ex-price { font-size: 1.35rem !important; font-weight: 700; color: var(--ex-accent) !important; margin: 6px 0 12px !important; }
.ex-aside { font-size: .95rem !important; font-weight: 600; color: var(--ex-text) !important; opacity: .8; }
.ex-note { font-size: .92rem !important; }
img.ex-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 30px rgba(40, 38, 110, .18); display: block; margin-bottom: 18px; }
/* Bottom center of the first screen; it scrolls away with the hero. */
.ex-scroll-cue {
    position: absolute; left: 50%; top: calc(100svh - var(--nav-h) - 96px); transform: translateX(-50%);
    margin: 0; text-align: center; white-space: nowrap; z-index: 2;
    font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--ex-text-2);
}
.ex-scroll-cue::after { content: ""; display: block; width: 2px; height: 34px; margin: 10px auto 0; background: linear-gradient(var(--ex-accent), transparent); animation: ex-cue 1.8s ease-in-out infinite; }
@keyframes ex-cue { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(8px); opacity: 1; } }

/* ── Store badges ─────────────────────────────────────────────────────────── */
.ex-badges { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 14px; }
.ex-badge {
    display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 18px 8px 14px;
    border-radius: 12px; font-family: var(--ex-font); font-size: 1.2rem; font-weight: 600; line-height: 1.05; text-decoration: none;
}
.ex-badge svg { width: 22px; height: 26px; flex: none; }
.ex-badge span { display: flex; flex-direction: column; }
.ex-badge small { font-size: .68rem; font-weight: 500; letter-spacing: .01em; }
.ex-badge-apple { background: #000; color: #fff; border: 1px solid #000; transition: transform .2s, box-shadow .2s; }
.ex-badge-apple:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .22); color: #fff; }
.ex-badge-apple:focus-visible { outline: 3px solid var(--ex-accent); outline-offset: 3px; }
@media (prefers-color-scheme: dark) { .ex-badge-apple { border-color: #A6A6A6; } }

/* ── Screenshots (shown when the page is not in 3D) ───────────────────────── */
.ex-shot { margin: 0; display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; }
.ex-shot img { display: block; width: auto; max-width: 100%; height: auto; max-height: 640px; border-radius: 32px; box-shadow: 0 24px 60px rgba(40, 38, 110, .18); }
.ex-shot-wide img { max-height: 460px; border-radius: 22px; }
.ex-shot-widgets img { max-height: 200px; border-radius: 0; box-shadow: none; }

/* Flat layout: a normal stack of chapters, text beside the screen. */
.ex-ch { padding: 72px 24px; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.ex-ch + .ex-ch { border-top: 1px solid var(--ex-sep); }
.ex-stage { display: none; }
@media (max-width: 820px) {
    .ex-ch { grid-template-columns: 1fr; gap: 28px; padding: 56px 20px; }
    .ex-shot img { max-height: 520px; }
}

/* ── 3D layout (app-story.js adds .is-3d once WebGL is up) ────────────────── */
.ex.is-3d .ex-stage {
    display: block; position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh;
    z-index: 0; pointer-events: none;
}
.ex.is-3d .ex-stage canvas { display: block; width: 100%; height: 100%; }
.ex.is-3d .ex-shot { display: none; }
.ex.is-3d .ex-ch {
    display: block; max-width: none; margin: 0; border: 0; position: relative; z-index: 1;
    min-height: 170vh; padding: 24vh max(32px, calc((100vw - 1200px) / 2)) 0;
}
.ex.is-3d .ex-hero { min-height: 130vh; padding-top: max(12vh, 64px); }
.ex.is-3d .ex-feature { min-height: 200vh; }
.ex.is-3d .ex-finale { min-height: 190vh; }
.ex.is-3d .ex-card {
    position: sticky; top: max(calc(var(--nav-h) + 24px), 20vh);
    padding: 30px 32px; border-radius: 26px;
    background: color-mix(in srgb, var(--ex-bg) 74%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
    border: 1px solid color-mix(in srgb, var(--ex-sep) 70%, transparent);
    box-shadow: 0 20px 50px rgba(40, 38, 110, .08);
}
.ex.is-3d .ex-hero .ex-card { top: max(12vh, 64px); background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding-left: 0; }

/* Phones and portrait tablets: the devices take the top of the screen and the
   chapter text pins to the bottom. Matches solve-24.js (aspect below 1). */
@media (max-aspect-ratio: 1/1) {
    .ex.is-3d .ex-ch {
        display: flex; flex-direction: column; justify-content: flex-end;
        padding: 0 14px 0; min-height: 150vh;
    }
    .ex.is-3d .ex-feature { min-height: 175vh; }
    .ex.is-3d .ex-hero { min-height: 120vh; }
    .ex.is-3d .ex-card, .ex.is-3d .ex-hero .ex-card {
        position: sticky; top: auto; bottom: 14px; max-width: 560px; width: 100%; margin: 0 auto;
        padding: 20px 22px; border-radius: 22px;
        background: color-mix(in srgb, var(--ex-bg) 80%, transparent);
        -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
        border: 1px solid color-mix(in srgb, var(--ex-sep) 70%, transparent);
    }
    .ex.is-3d .ex-card h1 { font-size: 2.6rem; margin-bottom: 10px; }
    .ex.is-3d .ex-card h2 { font-size: 1.6rem; margin-bottom: 8px; }
    .ex.is-3d .ex-card p { font-size: .97rem; line-height: 1.5; margin-bottom: 8px; }
    .ex.is-3d .ex-card .ex-lede { font-size: 1.05rem; }
    .ex.is-3d img.ex-icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 10px; }
    .ex.is-3d .ex-badges { margin: 12px 0 8px; }
    .ex.is-3d .ex-scroll-cue { display: none; }
}

/* ── The header while the story plays: slim and see-through ───────────────── */
body.ex-page .nav-inner, body.ex-page .nav-links { transition: height .35s ease; }
body.ex-page .nav-logo img { transition: height .35s ease; }
body.ex-page.ex-immersive .nav {
    background: color-mix(in srgb, var(--white) 55%, transparent);
    border-bottom-color: transparent;
}
/* Only the desktop bar shrinks: on phones the menu is a drawer sized from --nav-h. */
@media (min-width: 769px) {
body.ex-page.ex-immersive .nav {
    --nav-h: 50px;
    background: color-mix(in srgb, var(--white) 55%, transparent);
    border-bottom-color: transparent;
}
body.ex-page.ex-immersive .nav-logo img { height: 34px !important; }
body.ex-page.ex-immersive .nav-links a:not(.nav-cta) { font-size: .82rem; }
}
.ex:not(.is-3d) .ex-scroll-cue { display: none; }

@media (prefers-reduced-motion: reduce) {
    .ex-scroll-cue::after { animation: none; }
    body.ex-page .nav-inner, body.ex-page .nav-links, body.ex-page .nav-logo img { transition: none; }
}

/* Google Play is not out yet: a quiet label, not a link. */
.ex-badge-soon {
    border: 1.5px dashed var(--ex-sep); color: var(--ex-text-2);
    font-size: .95rem; font-weight: 650; padding: 8px 16px; background: transparent;
}

/* Some of the themes, as sky-blue chips like the app's categories. */
.ex-themes { list-style: none; padding: 0; margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.ex-themes li {
    padding: 6px 12px; border-radius: 999px; background: #A9D6FF; color: #0A174F;
    font-size: .92rem; font-weight: 650;
}
@media (prefers-color-scheme: dark) { .ex-themes li { background: #274EAB; color: #EEF0FF; } }

/* A phrase and its meaning, the way the app's detail card shows it. */
.ex-quote {
    margin: 14px 0 6px; padding: 12px 16px; border-radius: 14px; border-left: 4px solid #B0BFFB;
    background: color-mix(in srgb, var(--ex-surface) 85%, transparent);
}
.ex-quote p { margin: 0 !important; }
.ex-quote strong { font-family: var(--ex-round); font-size: 1.1rem; color: var(--ex-text); }
/* The three tips on the Support Expressify screen. */
.ex-tips { list-style: none; padding: 0; margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.ex-tips li {
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ex-sep);
    background: color-mix(in srgb, var(--ex-surface) 85%, transparent); font-size: .92rem; color: var(--ex-text-2);
}
.ex-tips strong { color: var(--ex-text); margin-right: 4px; }
#support .ex-eyebrow { color: var(--ex-pink) !important; }
@media (max-aspect-ratio: 1/1) {
    .ex.is-3d .ex-themes li { font-size: .82rem; padding: 4px 10px; }
}
