/* /dirty-minds: the Dirty Minds landing page.
   Colors come from the app's Halo & Horns palette: devil red (#B8141A, #EF4046
   in dark) and halo gold (#9A6A00 text, #F2C14E fill) on soft cream (#FBF3E6)
   in light mode and dark plum (#1E0F1F) in dark, in the system's rounded face.
   The app follows the system's light and dark mode, and so does the page. */

.dm {
    position: relative;
    --dm-bg: #FBF3E6;
    --dm-surface: #FFFAF2;
    --dm-text: #2A1420;
    --dm-text-2: #6B5060;
    --dm-sep: #E7D3B8;
    --dm-accent: #B8141A;
    --dm-halo: #9A6A00;
    --dm-halo-fill: #F2C14E;
    --dm-tile: #FFF4DE;
    --dm-tile-edge: #D9B98A;
    --dm-glow: rgba(242, 193, 78, .35);
    --dm-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
    --dm-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
    background: var(--dm-bg);
    color: var(--dm-text);
    font-family: var(--dm-font);
    overflow: clip;
}
@media (prefers-color-scheme: dark) {
    .dm {
        --dm-bg: #1E0F1F;
        --dm-surface: #2E1830;
        --dm-text: #F8EDE3;
        --dm-text-2: #C9B3BF;
        --dm-sep: #4A2C48;
        --dm-accent: #EF4046;
        --dm-halo: #F2C14E;
        --dm-tile: #F5E6C8;
        --dm-tile-edge: #A8814E;
        --dm-glow: rgba(239, 64, 70, .22);
    }
}
@media (prefers-color-scheme: dark) { body.dm-page { background: #1E0F1F; } }

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

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

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

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

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

/* ── 3D layout (app-story.js adds .is-3d once WebGL is up) ────────────────── */
.dm.is-3d .dm-stage {
    display: block; position: sticky; top: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh;
    z-index: 0; pointer-events: none;
}
.dm.is-3d .dm-stage canvas { display: block; width: 100%; height: 100%; }
.dm.is-3d .dm-shot { display: none; }
.dm.is-3d .dm-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;
}
.dm.is-3d .dm-hero { min-height: 130vh; padding-top: max(12vh, 64px); }
.dm.is-3d .dm-feature { min-height: 200vh; }
.dm.is-3d .dm-finale { min-height: 190vh; }
.dm.is-3d .dm-card {
    position: sticky; top: max(calc(var(--nav-h) + 24px), 20vh);
    padding: 30px 32px; border-radius: 26px;
    background: color-mix(in srgb, var(--dm-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(--dm-sep) 70%, transparent);
    box-shadow: 0 20px 50px rgba(70, 20, 40, .08);
}
.dm.is-3d .dm-hero .dm-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) {
    .dm.is-3d .dm-ch {
        display: flex; flex-direction: column; justify-content: flex-end;
        padding: 0 14px 0; min-height: 150vh;
    }
    .dm.is-3d .dm-feature { min-height: 175vh; }
    .dm.is-3d .dm-hero { min-height: 120vh; }
    .dm.is-3d .dm-card, .dm.is-3d .dm-hero .dm-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(--dm-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(--dm-sep) 70%, transparent);
    }
    .dm.is-3d .dm-card h1 { font-size: 2.6rem; margin-bottom: 10px; }
    .dm.is-3d .dm-card h2 { font-size: 1.6rem; margin-bottom: 8px; }
    .dm.is-3d .dm-card p { font-size: .97rem; line-height: 1.5; margin-bottom: 8px; }
    .dm.is-3d .dm-card .dm-lede { font-size: 1.05rem; }
    .dm.is-3d img.dm-icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 10px; }
    .dm.is-3d .dm-badges { margin: 12px 0 8px; }
    .dm.is-3d .dm-scroll-cue { display: none; }
}

/* ── The header while the story plays: slim and see-through ───────────────── */
body.dm-page .nav-inner, body.dm-page .nav-links { transition: height .35s ease; }
body.dm-page .nav-logo img { transition: height .35s ease; }
body.dm-page.dm-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.dm-page.dm-immersive .nav {
    --nav-h: 50px;
    background: color-mix(in srgb, var(--white) 55%, transparent);
    border-bottom-color: transparent;
}
body.dm-page.dm-immersive .nav-logo img { height: 34px !important; }
body.dm-page.dm-immersive .nav-links a:not(.nav-cta) { font-size: .82rem; }
}
.dm:not(.is-3d) .dm-scroll-cue { display: none; }

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

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

/* The welcome line and the solve line, in the app's own words. */
.dm-quote {
    font-family: var(--dm-round); font-weight: 700; font-size: 1.12rem !important; color: var(--dm-text) !important;
    border-left: 4px solid var(--dm-halo-fill); padding: 2px 0 2px 14px; margin: 14px 0 !important;
}
.dm-wrong { color: var(--dm-accent) !important; font-family: var(--dm-round); font-weight: 800; font-size: 1.2rem !important; }

/* The answer spelled in letter tiles, like the game's bank. */
.dm-tiles { list-style: none; padding: 0; margin: 14px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.dm-tiles li {
    width: 44px; height: 48px; border-radius: 10px; display: grid; place-items: center;
    background: var(--dm-tile); color: #2A1420; border: 1px solid var(--dm-tile-edge); box-shadow: 0 3px 0 var(--dm-tile-edge);
    font-family: var(--dm-round); font-weight: 800; font-size: 1.35rem;
}

/* Halo rewards and costs, as small gold chips. */
.dm-halos { list-style: none; padding: 0; margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.dm-halos li {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--dm-surface) 85%, transparent); border: 1px solid var(--dm-sep);
    font-size: .92rem; font-weight: 600; color: var(--dm-text);
}
.dm-halos b { color: var(--dm-halo); font-family: var(--dm-round); }

/* The eight levels, by word length. */
.dm-levels { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.dm-levels li {
    border-radius: 12px; padding: 6px 4px; text-align: center; font-size: .78rem; font-weight: 600; color: var(--dm-text-2);
    background: color-mix(in srgb, var(--dm-surface) 85%, transparent); border: 1px solid var(--dm-sep);
}
.dm-levels li b { display: block; font-family: var(--dm-round); font-size: 1.15rem; color: var(--dm-text); }
.dm-levels li.dm-free { border-color: var(--dm-halo-fill); }
.dm-levels li.dm-free b { color: var(--dm-halo); }
@media (max-aspect-ratio: 1/1) {
    .dm.is-3d .dm-halos li { font-size: .82rem; padding: 4px 10px; }
    .dm.is-3d .dm-tiles li { width: 36px; height: 40px; font-size: 1.1rem; }
    .dm.is-3d .dm-levels { display: none; }
}
.dm-age { display: inline-block; font-weight: 800; color: var(--dm-accent) !important; }
