/* /tic-tac-eat: the Tic Tac Eat landing page. Colors are the app's own Toy Box
   palette: sunny yellow and ink #2A1A4A in light, starry navy and cream #FFF3C4
   in dark, Pink #B5123F edge, gold #FFD84D. Type is the system rounded design,
   like the app. The page follows prefers-color-scheme, like the app. */

.tte {
    --tte-bg: #FFF4C9;
    --tte-surface: #FFF8DD;
    --tte-sunken: #FFE79A;
    --tte-text: #2A1A4A;
    --tte-text-2: #4F3F6E;
    --tte-sep: #EBD08A;
    --tte-accent: #B5123F;
    --tte-accent-2: #173FA8;
    --tte-glow: rgba(255, 169, 31, .34);
    --tte-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
    --tte-round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    position: relative;
    background: var(--tte-bg);
    color: var(--tte-text);
    font-family: var(--tte-font);
    overflow: clip;
}
@media (prefers-color-scheme: dark) {
    .tte {
        --tte-bg: #14173F;
        --tte-surface: #232868;
        --tte-sunken: #2B3082;
        --tte-text: #FFF3C4;
        --tte-text-2: #C9C3F0;
        --tte-sep: #3C418F;
        --tte-accent: #FFD84D;
        --tte-accent-2: #FF9AAE;
        --tte-glow: rgba(134, 139, 242, .22);
    }
}
body.tte-page { background: #FFF4C9; }
@media (prefers-color-scheme: dark) { body.tte-page { background: #14173F; } }

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

/* ── Chapter text ─────────────────────────────────────────────────────────── */
.tte-card { position: relative; z-index: 2; max-width: 440px; }
.tte-card h1, .tte-card h2 { font-family: var(--tte-round); color: var(--tte-text); letter-spacing: -.02em; }
.tte-card h1 { font-size: clamp(3rem, 6vw, 4.6rem); font-weight: 800; line-height: 1; margin: 6px 0 18px; }
.tte-card h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 800; line-height: 1.08; margin: 4px 0 14px; }
.tte-card p { color: var(--tte-text-2); font-size: 1.08rem; line-height: 1.6; margin: 0 0 12px; }
.tte-card .tte-lede { font-size: 1.25rem; color: var(--tte-text); }
.tte-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--tte-accent) !important; margin-bottom: 6px !important;
}
.tte-feature h2 { color: var(--tte-text); }
.tte-aside { font-size: .95rem !important; font-weight: 600; color: var(--tte-text) !important; opacity: .8; }
.tte-note { font-size: .92rem !important; }
.tte-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 30px rgba(42, 26, 74, .22); display: block; margin-bottom: 18px; }
/* Facts: a quiet two-column list, label left and detail right, split by hairlines. */
.tte-facts { list-style: none; padding: 0; margin: 4px 0 16px; border-top: 1px solid var(--tte-sep); }
.tte-facts li {
    display: grid; grid-template-columns: 5.5rem 1fr; colutte-gap: 16px; align-items: baseline;
    color: var(--tte-text-2); line-height: 1.5; padding: 11px 0; border-bottom: 1px solid var(--tte-sep);
}
.tte-facts strong {
    color: var(--tte-accent); font-family: var(--tte-round); font-weight: 650;
    font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
}
@media (max-width: 380px) { .tte-facts li { grid-template-columns: 1fr; row-gap: 2px; } }
/* Bottom center of the first screen; it scrolls away with the hero. */
.tte-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(--tte-text-2);
}
.tte-scroll-cue::after { content: ""; display: block; width: 2px; height: 34px; margin: 10px auto 0; background: linear-gradient(var(--tte-accent), transparent); animation: tte-cue 1.8s ease-in-out infinite; }
@keyframes tte-cue { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(8px); opacity: 1; } }

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

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

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

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

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

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

/* ── This app's own bits ─────────────────────────────────────────────────── */
.tte-price { font-family: var(--tte-round); font-weight: 800; font-size: 1.15rem !important; color: var(--tte-text) !important; }
.tte-steps { list-style: none; padding: 0; margin: 6px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tte-steps li { font: 700 .82rem/1 var(--tte-font); padding: 7px 10px; border-radius: 999px; background: var(--tte-sunken); color: var(--tte-text); }
.tte-steps li b { color: var(--tte-accent); font-weight: 800; margin-right: 4px; }
