/* Pocora's landing page.
   Colours follow android/app/src/main/java/ir/pocora/ui/AppColors.kt. The page has its own ink and coral;
   the parent app's violet and the child app's cyan appear only where something belongs to one of the apps.
   Every size comes from the tokens below: a type scale, a 4px spacing grid, radii and component sizes.
   Tablets, phones and the narrowest phones change the tokens and stack the columns; the rules stay the same.
   Icons: the Solar set, Bold style, by 480 Design, CC BY 4.0 (sprite.svg, written by tools/icons.sh).
   Sections, in page order: base, top bar, shared parts, hero, family, apps, presets, setup, questions,
   download, footer, motion, tablets, phones, narrowest phones. */

/* --- Fonts --- */
@font-face {
    font-family: Dana;
    src: url("../fonts/dana-regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: Dana;
    src: url("../fonts/dana-bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

/* --- Tokens --- */
:root {
    /* The page */
    --paper: #f8f7fc;
    --card: #ffffff;
    --text: #1e1b2e;
    --muted: #6f6b88;
    --accent: #ff6b3d;
    --accent-deep: #e8552a;
    --accent-light: #ff8a5c;
    --accent-soft: rgba(255, 107, 61, 0.1);
    --line: rgba(30, 27, 46, 0.08);
    --shadow-sm: 0 4px 14px rgba(30, 27, 46, 0.05);
    --shadow-md: 0 10px 30px rgba(30, 27, 46, 0.07);
    --shadow-lg: 0 24px 60px rgba(30, 27, 46, 0.1);

    /* The apps, and the colours copied from their screens */
    --parent: #7b61ff;
    --parent-light: #9b87ff;
    --parent-deep: #6a4ff0;
    --child: #22b8f0;
    --child-light: #3dd6f5;
    --child-deep: #0e9fcc;
    --allowed: #22b8f0;
    --limited: #e6e2f3;
    --green: #22c55e;
    --blue: #3b82f6;

    /* Fills: the coral and each app's colour, light to deep, for tiles, tags and buttons */
    --accent-fill: linear-gradient(
        135deg,
        var(--accent-light),
        var(--accent-deep)
    );
    --parent-fill: linear-gradient(
        135deg,
        var(--parent-light),
        var(--parent-deep)
    );
    --child-fill: linear-gradient(
        135deg,
        var(--child-light),
        var(--child-deep)
    );

    /* Type */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-lg: 17px;
    --title: 34px;
    --display: 48px;
    --leading: 1.75;
    --leading-title: 1.3;

    /* Space: a 4px grid */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s8: 32px;
    --s10: 40px;
    --s12: 48px;
    --s16: 64px;

    /* Radius */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* Components */
    --content: 1080px;
    --gutter: 24px;
    --nav: 64px;
    --control: 48px;
    --tile: 36px;
    --badge: 34px;
    --tick: 20px;
    --phone: 240px;
    --phone-pair: 200px;
    --stage: 520px;
}

/* --- Base --- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Dana, system-ui, sans-serif;
    font-size: var(--text-base);
    line-height: var(--leading);
    color: var(--text);
    background: var(--paper);
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    flex: none;
}

.wrap {
    width: 100%;
    max-width: var(--content);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Every sentence stays on one line; only the answers to the questions may wrap. */
h1,
h2,
h3,
.lead,
.pill,
.eyebrow,
.checks li,
.toast span,
summary {
    white-space: nowrap;
}

/* --- Top bar: clear over the hero, solid once the page scrolls --- */
.nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    transition:
        background 0.3s,
        box-shadow 0.3s;
}

.nav.solid {
    background: rgba(248, 247, 252, 0.85);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--line);
}

.nav .wrap {
    display: flex;
    align-items: center;
    gap: var(--s6);
    height: var(--nav);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--text-lg);
    font-weight: 700;
}

/* Pocora's mark: the shield-P from the app icon on its own, 40.23 wide by 46.99 high. */
.mark {
    display: inline-flex;
    color: var(--text);
}

.mark svg {
    width: 0.86em;
    height: 1em;
}

.logo .mark {
    font-size: 26px;
}

.links {
    display: flex;
    gap: var(--s6);
    margin-inline-start: auto;
    font-size: var(--text-sm);
    color: var(--muted);
}

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

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 var(--s4);
    border-radius: var(--r-pill);
    font-size: var(--text-sm);
    font-weight: 700;
    color: #fff;
    background: var(--text);
    box-shadow: 0 6px 18px rgba(30, 27, 46, 0.2);
}

.nav-cta svg {
    font-size: 18px;
}

/* --- Shared: sections --- */
/* Each section fills the screen. Plain ones sit on the paper; tinted ones get a soft colour of their own. */
.screen {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--nav) + var(--s8)) 0 var(--s16);
    overflow: hidden;
}

.tint {
    background: linear-gradient(165deg, #f6f3ee, var(--paper) 70%);
}

.hero.tint {
    background: linear-gradient(160deg, #fff1e8, #fffaf5 45%, #f5f3ee);
}

#apps.tint {
    background: linear-gradient(160deg, #fff3ec, #fdfaf6 60%, var(--paper));
}

/* Setup is where the two apps meet: a wash from the parent's violet to the child's cyan. */
#start.tint {
    background: linear-gradient(150deg, #e9e3ff, #f3f1fd 45%, #def4fd);
}

#download.tint {
    background: linear-gradient(180deg, var(--paper), #f6f3ee);
}

.glow {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.32;
    pointer-events: none;
}

.glow.hero-end {
    background: #ffc4a8;
    top: -140px;
    inset-inline-end: -120px;
}

.glow.hero-start {
    background: #ffe2b8;
    bottom: -160px;
    inset-inline-start: 8%;
}

.glow.apps {
    background: #ffc2dc;
    bottom: -200px;
    inset-inline-end: -140px;
}

.glow.download {
    background: #ffd9a8;
    top: -200px;
    inset-inline-start: -200px;
}

/* A section's label, title and one line, centred. */
.section-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- Shared: type --- */
h1 {
    margin: var(--s4) 0 var(--s3);
    font-size: var(--display);
    line-height: var(--leading-title);
    letter-spacing: -0.5px;
}

h2 {
    margin: var(--s3) 0 var(--s2);
    font-size: var(--title);
    line-height: var(--leading-title);
}

h3 {
    margin: var(--s2) 0 var(--s4);
    font-size: var(--text-lg);
    line-height: 1.5;
}

.gradient {
    background: linear-gradient(110deg, var(--accent), #f5a524 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    margin: 0 0 var(--s6);
    font-size: var(--text-lg);
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s1) var(--s3);
    border-radius: var(--r-pill);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--accent-deep);
    background: var(--accent-soft);
}

.tint .eyebrow {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-sm);
}

/* --- Shared: lists and small parts --- */
.checks {
    display: grid;
    gap: var(--s3);
    margin: 0 0 var(--s6);
    padding: 0;
    list-style: none;
}

.checks li {
    display: flex;
    align-items: center;
    gap: var(--s3);
}

.checks li::before {
    content: "";
    flex: none;
    width: var(--tick);
    height: var(--tick);
    border-radius: 7px;
    background: var(--accent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
        center / 14px no-repeat;
}

/* A coloured square with a white icon: coral for the page, violet or cyan for an app. */
.group-icon,
.tile {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tile);
    height: var(--tile);
    border-radius: var(--r-sm);
    font-size: 18px;
    color: #fff;
    background: var(--accent-fill);
}

.tile.parent {
    background: var(--parent-fill);
}

.tile.child {
    background: var(--child-fill);
}

/* An icon, then a bold title over a small line. */
.group-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s3);
    line-height: 1.5;
    white-space: nowrap;
}

.group-head b {
    display: block;
    font-size: var(--text-lg);
}

.group-head small {
    font-size: var(--text-xs);
    color: var(--muted);
}

/* A day's internet in blue, on its 24 hours, as on the app's screens. Hours run left to right in both languages. */
.bar,
.dayline {
    position: relative;
    border-radius: 4px;
    background: var(--limited);
    direction: ltr;
}

.bar {
    height: 8px;
}

.dayline {
    height: 5px;
    margin-top: var(--s1);
}

.bar i,
.dayline i {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 4px;
    background: var(--allowed);
}

/* --- Shared: phones --- */
/* One model for both apps: edge-to-edge, a thin black bezel, a punch-hole camera, buttons on the right. */
.stage {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: var(--stage);
}

.phone {
    position: relative;
    width: var(--phone);
    margin: 0;
    padding: 7px;
    border-radius: 28px;
    background: linear-gradient(145deg, #3d3a4a, #15141b 40%, #26242f);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        inset 0 0 0 3px #08080b,
        0 32px 72px rgba(22, 18, 43, 0.38);
}

.phone img {
    border-radius: 22px;
}

.phone::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 50%;
    z-index: 1;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle at 35% 35%, #3b3a52, #050508 60%);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.phone::after {
    content: "";
    position: absolute;
    top: 30%;
    right: -3px;
    width: 3px;
    height: 12%;
    border-radius: 0 2px 2px 0;
    background: #26242f;
}

/* Under each phone, which app it shows: a caption rather than a control, the app's name in its colour on a
   faint tint of it, with no shadow. */
.phone figcaption {
    position: absolute;
    left: 50%;
    bottom: calc(-1 * var(--s10));
    transform: translateX(-50%);
    padding: 2px var(--s3);
    border-radius: var(--r-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
    color: var(--parent-deep);
    background: rgba(123, 97, 255, 0.1);
}

.phone.child figcaption {
    color: var(--child-deep);
    background: rgba(34, 184, 240, 0.12);
}

/* Two phones side by side, the second a little lower. */
.stage.pair {
    gap: var(--s5);
}

.stage.pair .phone {
    width: var(--phone-pair);
}

.stage.pair .lower {
    transform: translateY(var(--s10));
}

/* --- 1. Hero --- */
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s12);
    align-items: center;
}

/* A small filled tag, then one plain sentence. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s1);
    padding-inline-end: var(--s4);
    border-radius: var(--r-pill);
    font-size: var(--text-sm);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.pill b {
    padding: 2px var(--s3);
    border-radius: var(--r-pill);
    font-size: var(--text-xs);
    color: #fff;
    background: linear-gradient(135deg, #34d399, var(--green));
}

/* One way forward: down to the download section. */
.cta {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    height: var(--control);
    padding: 0 var(--s6);
    border-radius: var(--r-md);
    font-weight: 700;
    color: #fff;
    /* The coral drifts slowly through the page's orange and back, so the one button draws the eye. */
    background: linear-gradient(
        110deg,
        var(--accent-deep),
        var(--accent-light),
        #f5a524,
        var(--accent-light),
        var(--accent-deep)
    );
    background-size: 300% 100%;
    box-shadow: 0 12px 28px rgba(255, 107, 61, 0.3);
    transition: transform 0.15s;
    animation: drift 6s ease-in-out infinite alternate;
}

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

.cta svg {
    font-size: 20px;
}

.hero .phone.front {
    z-index: 2;
    transform: translateX(-56px);
}

.hero .phone.behind {
    position: absolute;
    width: var(--phone-pair);
    transform: translateX(116px) translateY(var(--s6));
}

/* A notification floating over the phones. */
.toast {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s2);
    padding-inline-end: var(--s4);
    border-radius: var(--r-lg);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(30, 27, 46, 0.18);
    animation: float 6s ease-in-out infinite;
}

.toast small {
    display: block;
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--muted);
}

.toast.lower {
    bottom: 96px;
    inset-inline-end: calc(-1 * var(--s2));
}

.toast.upper {
    top: 0;
    inset-inline-start: calc(-1 * var(--s3));
    animation-delay: -3s;
}

.scroll {
    position: absolute;
    bottom: var(--s6);
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 36px;
    border-radius: var(--r-md);
    border: 2px solid rgba(30, 27, 46, 0.25);
}

.scroll span {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 7px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--text);
    animation: wheel 1.6s ease-in-out infinite;
}

/* --- 2. Family: two matching cards, the parent's and the child's, each edged and washed in its app's colour --- */
.sides {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s5);
}

.side {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    padding: var(--s5);
    border-radius: var(--r-xl);
    background: linear-gradient(
            180deg,
            rgba(123, 97, 255, 0.06),
            var(--card) 120px
        )
        var(--card);
    border: 1px solid rgba(123, 97, 255, 0.22);
    box-shadow: var(--shadow-md);
}

.side.child {
    background: linear-gradient(
            180deg,
            rgba(34, 184, 240, 0.07),
            var(--card) 120px
        )
        var(--card);
    border-color: rgba(34, 184, 240, 0.28);
}

/* The app's icon, whose phone it is in the app's colour, and what that side is about. */
.side-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    line-height: 1.5;
    white-space: nowrap;
}

.side-head img {
    width: 40px;
    height: 40px;
}

.side-head small {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--parent-deep);
}

.side.child .side-head small {
    color: var(--child-deep);
}

.side-head b {
    font-size: var(--text-lg);
}

/* A short list as the app shows it: each child's day on one side, the child's alerts on the other. */
.rows {
    display: grid;
    gap: var(--s2);
}

.row {
    display: flex;
    align-items: center;
    gap: var(--s3);
    min-height: 64px;
    padding: var(--s2) var(--s3);
    border-radius: var(--r-md);
    background: var(--paper);
}

.avatar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tile);
    height: var(--tile);
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.avatar.violet {
    background: var(--parent-fill);
}

.avatar.blue {
    background: linear-gradient(135deg, #60a5fa, var(--blue));
}

.row-body {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    white-space: nowrap;
}

.row-body b {
    margin-inline-end: var(--s2);
    font-size: var(--text-sm);
}

.row-body small {
    font-size: var(--text-xs);
    color: var(--muted);
}

.today {
    margin-top: var(--s1);
    direction: ltr;
}

.hours {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.4;
    color: var(--muted);
}

.side .checks {
    gap: var(--s2);
    margin: auto 0 0;
    font-size: var(--text-sm);
}

/* The section's last word: Pocora starts a talk, shown as one. The parent asks, the child answers. */
.talk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s8);
    margin-top: var(--s5);
    padding: var(--s4) var(--s6);
    border-radius: var(--r-xl);
    background: linear-gradient(120deg, #fff4ee, var(--card) 70%);
    border: 1px solid rgba(255, 107, 61, 0.18);
    box-shadow: var(--shadow-sm);
}

.talk-text {
    line-height: 1.6;
    white-space: nowrap;
}

.talk-text b {
    display: block;
    font-size: var(--text-lg);
}

.talk-text small {
    font-size: var(--text-sm);
    color: var(--muted);
}

.chat {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
}

.bubble {
    width: fit-content;
    padding: var(--s1) var(--s3);
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: nowrap;
    color: #fff;
}

.bubble.parent {
    border-radius: 14px 14px 4px 14px;
    background: var(--parent-fill);
}

.bubble.child {
    align-self: flex-end;
    border-radius: 14px 14px 14px 4px;
    background: var(--child-fill);
}

/* --- 3. Apps and data: a card on each side, the parent's two screens between them --- */
.trio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--s6);
    align-items: center;
}

.trio .stage {
    --phone-pair: 180px;
    min-height: 0;
    padding-bottom: var(--s16);
}

/* The two cards match: title, a picture of the choice, and two lines at the foot. */
.feature-card {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    padding: var(--s5) var(--s4);
    border-radius: var(--r-xl);
    background: var(--card);
    box-shadow: var(--shadow-md);
}

.feature-card .group-head {
    margin: 0;
}

.feature-card .checks {
    gap: var(--s2);
    margin: 0;
    font-size: var(--text-sm);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chips span {
    padding: 2px var(--s3);
    border-radius: var(--r-pill);
    font-size: var(--text-sm);
    background: var(--paper);
}

/* The eight data levels as plain badges, like the app chips beside them, from the start of the line. */
.levels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.levels span {
    padding: 2px 10px;
    border-radius: var(--r-pill);
    font-size: var(--text-xs);
    white-space: nowrap;
    background: var(--paper);
}

/* --- 4. Presets: today's suggestion, every preset on one timetable, then the app lists by age --- */
/* This season's suggestion: today's date as a tear-off calendar leaf, then what Pocora suggests and for how long. */
.now {
    display: flex;
    align-items: center;
    gap: var(--s4);
    width: fit-content;
    margin: 0 auto var(--s4);
    padding: var(--s3);
    padding-inline-end: var(--s8);
    border-radius: var(--r-lg);
    background: linear-gradient(120deg, #fff4ee, var(--card) 60%);
    border: 1px solid rgba(255, 107, 61, 0.22);
    box-shadow: 0 14px 36px rgba(255, 107, 61, 0.12);
}

.leaf {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64px;
    overflow: hidden;
    border-radius: var(--r-md);
    line-height: 1.2;
    background: var(--card);
    box-shadow: 0 6px 16px rgba(30, 27, 46, 0.1);
}

.leaf small {
    order: -1;
    align-self: stretch;
    padding: 3px 0;
    text-align: center;
    font-size: var(--text-xs);
    font-weight: 700;
    color: #fff;
    background: var(--accent-fill);
}

.leaf b {
    padding: var(--s1) 0 var(--s2);
    font-size: 26px;
}

.now-text {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    white-space: nowrap;
}

.now-text small,
.now-text span {
    display: block;
    font-size: var(--text-xs);
    color: var(--muted);
}

.now-text b {
    display: block;
    font-size: var(--text-lg);
}

/* The same coral dot as the suggested rows below, so the two read as one. */
.now-text b::before,
.preset-group li.suggested b::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-end: 6px;
    border-radius: 50%;
    vertical-align: 2px;
    background: var(--accent);
}

/* App lists by age: a slim strip under the timetable, its title on one side and the three ages as pills. */
.ages {
    display: flex;
    align-items: center;
    gap: var(--s2);
    max-width: 880px;
    margin: var(--s4) auto 0;
    padding: var(--s3) var(--s4);
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: var(--shadow-md);
}

.ages-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-inline-end: auto;
    line-height: 1.5;
    white-space: nowrap;
}

.ages-head b {
    display: block;
    font-size: var(--text-sm);
}

.ages-head small {
    font-size: var(--text-xs);
    color: var(--muted);
}

.age {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: var(--s1) var(--s3);
    border-radius: var(--r-pill);
    font-size: var(--text-sm);
    white-space: nowrap;
    background: var(--paper);
}

.age small {
    font-size: var(--text-xs);
    color: var(--muted);
}

/* Every preset on one line, its group beside it: name and hours, then its day. */
.timetable {
    --group: 150px;
    --timeline: 340px;
    max-width: 880px;
    margin: 0 auto;
    padding: var(--s2) var(--s4) var(--s3);
    border-radius: var(--r-xl);
    background: var(--card);
    box-shadow: var(--shadow-md);
}

.preset-group,
.preset-group li {
    display: grid;
    align-items: center;
    column-gap: var(--s4);
}

.preset-group {
    grid-template-columns: var(--group) 1fr;
    padding: var(--s2) 0;
}

.preset-group + .preset-group {
    border-top: 1px solid var(--line);
}

.preset-group .group-head {
    margin: 0;
    padding-inline-start: var(--s3);
}

.preset-group .group-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 15px;
}

.preset-group .group-head b {
    font-size: var(--text-sm);
}

.preset-group ul {
    display: grid;
    gap: var(--s1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.preset-group li {
    grid-template-columns: 1fr var(--timeline);
    padding: var(--s2) var(--s3);
    border-radius: var(--r-sm);
    transition: background 0.2s;
}

.preset-group li:hover {
    background: var(--paper);
}

.preset-name {
    display: flex;
    align-items: baseline;
    gap: var(--s2);
    line-height: 1.6;
    white-space: nowrap;
}

.preset-name b {
    font-size: var(--text-sm);
}

.preset-name small {
    font-size: var(--text-xs);
    color: var(--muted);
}

/* Each bar is a whole day, marked faintly every six hours. */
.timetable .dayline {
    height: 8px;
    margin: 0;
    background:
        linear-gradient(
            90deg,
            transparent calc(25% - 1px),
            #fff calc(25% - 1px) 25%,
            transparent 25%,
            transparent calc(50% - 1px),
            #fff calc(50% - 1px) 50%,
            transparent 50%,
            transparent calc(75% - 1px),
            #fff calc(75% - 1px) 75%,
            transparent 75%
        ),
        var(--limited);
}

/* This season's preset, marked as the app marks it: a tinted row, and the coral dot set with .now-text above. */
.preset-group li.suggested {
    background: rgba(255, 107, 61, 0.08);
}

/* --- 5. Setup: the steps on one side, one phone showing the chosen step on the other --- */
.setup {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--s12);
    align-items: center;
    max-width: 880px;
    margin: 0 auto;
}

.setup .stage {
    min-height: 0;
    padding-bottom: var(--s10);
}

.setup .phone img {
    aspect-ratio: 540 / 1200;
    object-fit: cover;
}

/* The steps on one line: numbered dots joined by a thread, the chosen step lifted onto a white card. */
.steps {
    position: relative;
    display: grid;
    gap: var(--s1);
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps::before {
    content: "";
    position: absolute;
    top: var(--s8);
    bottom: var(--s8);
    inset-inline-start: calc(var(--s4) + var(--badge) / 2 - 1px);
    border-inline-start: 2px dashed rgba(123, 97, 255, 0.25);
}

.step {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--s4);
    width: 100%;
    padding: var(--s3) var(--s4);
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--r-lg);
    font: inherit;
    text-align: start;
    color: inherit;
    background: transparent;
    cursor: pointer;
    transition:
        background 0.2s,
        box-shadow 0.2s,
        border-color 0.2s;
}

.step:hover {
    background: rgba(255, 255, 255, 0.6);
}

.step.active {
    background: var(--card);
    border-color: rgba(255, 107, 61, 0.3);
    box-shadow: var(--shadow-md);
}

.step-number {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--badge);
    height: var(--badge);
    border-radius: 50%;
    font-weight: 700;
    color: var(--muted);
    background: var(--card);
    box-shadow:
        0 0 0 1px var(--line),
        var(--shadow-sm);
    transition:
        background 0.2s,
        color 0.2s;
}

.step.active .step-number {
    color: #fff;
    background: var(--accent-fill);
    box-shadow: 0 6px 14px rgba(255, 107, 61, 0.3);
}

.step-text {
    line-height: 1.5;
    white-space: nowrap;
}

.step-text b {
    display: block;
}

.step-text small {
    font-size: var(--text-sm);
    color: var(--muted);
}

/* Which app the step happens in, in that app's colour. */
.step-text .step-app {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--parent-deep);
}

.step-text .step-app.child {
    color: var(--child-deep);
}

/* While the steps play by themselves, a thin ring around the chosen step's number fills up until the next. */
.step-ring {
    display: none;
    position: absolute;
    inset: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    transform: rotate(-90deg);
    fill: none;
}

.step-ring circle {
    stroke: var(--accent);
    stroke-width: 2.5;
    /* The circle is 126 long; the gap after the dash is longer, so nothing shows until the ring starts. */
    stroke-dasharray: 126 200;
    stroke-dashoffset: 126;
}

.step.active .step-ring {
    display: block;
}

.step.active .step-ring circle {
    animation: ring 4s linear;
}

.steps.paused .step-ring {
    display: none;
}

/* --- 6. Questions: the title centred, the questions as cards under it --- */
/* The questions as a column of cards. */
.questions {
    display: grid;
    gap: var(--s2);
    max-width: 760px;
    margin: 0 auto;
}

details {
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition:
        box-shadow 0.2s,
        border-color 0.2s;
}

/* The open question: a thin coral edge all round, on plain white. */
details[open] {
    border-color: rgba(255, 107, 61, 0.3);
    box-shadow: var(--shadow-md);
}

summary {
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: var(--s4) var(--s5);
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

summary:hover .q-text {
    color: var(--accent-deep);
}

summary::-webkit-details-marker {
    display: none;
}

.q-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 15px;
    color: var(--accent-deep);
    background: var(--accent-soft);
    transition:
        background 0.2s,
        color 0.2s;
}

details[open] .q-icon {
    color: #fff;
    background: var(--accent-fill);
}

.q-text {
    flex: 1;
}

/* A thin chevron in a soft circle that turns to point up when the answer is open. */
.q-toggle {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--muted);
    background: var(--paper);
    transition:
        transform 0.25s,
        background 0.2s,
        color 0.2s;
}

.q-toggle::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: -3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    border-radius: 0 0 2px 0;
    transform: rotate(45deg);
}

summary:hover .q-toggle {
    color: var(--accent-deep);
}

details[open] .q-toggle {
    transform: rotate(180deg);
    color: var(--accent-deep);
    background: var(--accent-soft);
}

/* The one place a sentence may wrap: an answer explains. It sits under the question, clear of the icon and the
   toggle. */
details p {
    margin: 0;
    padding: 0 var(--s5) var(--s5);
    padding-inline: calc(30px + var(--s4) + var(--s5))
        calc(24px + var(--s4) + var(--s5));
    font-size: var(--text-sm);
    line-height: 2;
    color: var(--muted);
}

/* The words to catch at a glance, in the text colour. */
details p b {
    font-weight: 700;
    color: var(--text);
}

/* --- 7. Download: a card per app in its own colour, then two notes on where to get them and how to install --- */
#download {
    justify-content: space-between;
    padding-bottom: 0;
}

/* The content sits centred between the top bar and the footer, with as much room under it as over it. */
.download-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: var(--s12);
}

/* A card per app, edged and washed in its colour as the family cards are: what it is, what it does, and the
   newest file in one tap. */
.apps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 360px));
    justify-content: center;
    gap: var(--s5);
}

.app-card {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    padding: var(--s5);
    border-radius: var(--r-xl);
    background: linear-gradient(
            180deg,
            rgba(123, 97, 255, 0.06),
            var(--card) 120px
        )
        var(--card);
    border: 1px solid rgba(123, 97, 255, 0.22);
    box-shadow: var(--shadow-lg);
}

.app-card.child {
    background: linear-gradient(
            180deg,
            rgba(34, 184, 240, 0.07),
            var(--card) 120px
        )
        var(--card);
    border-color: rgba(34, 184, 240, 0.28);
}

.app-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    line-height: 1.5;
    white-space: nowrap;
}

.app-head img {
    width: 52px;
    height: 52px;
}

.app-head b {
    display: block;
    font-size: var(--text-lg);
}

.app-head small {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--parent-deep);
}

.app-card.child .app-head small {
    color: var(--child-deep);
}

.app-card .checks {
    gap: var(--s2);
    margin: 0;
    font-size: var(--text-sm);
}

.get {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    width: 100%;
    height: var(--control);
    border-radius: var(--r-md);
    font-weight: 700;
    color: #fff;
    background: var(--parent-fill);
    box-shadow: 0 10px 24px rgba(106, 79, 240, 0.28);
    transition: transform 0.15s;
}

.app-card.child .get {
    background: var(--child-fill);
    box-shadow: 0 10px 24px rgba(14, 159, 204, 0.28);
}

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

.get svg {
    font-size: 20px;
}

/* The file's size as a light badge at the end of the button, filled in by page.js from the newest release;
   hidden until it is known. */
.get-size {
    padding: 1px var(--s2);
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.22);
}

.get-size:empty {
    display: none;
}

/* Two things to know before installing, as a matching pair of notes: where the apps come from, so a copy in a
   store is not mistaken for them, and the one permission Android asks for. */
.notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 360px));
    justify-content: center;
    gap: var(--s5);
    margin-top: var(--s5);
}

.note {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3);
    padding-inline-end: var(--s5);
    border-radius: var(--r-lg);
    line-height: 1.5;
    white-space: nowrap;
    background: linear-gradient(120deg, #fff4ee, var(--card) 70%);
    border: 1px solid rgba(255, 107, 61, 0.22);
}

.note b {
    display: block;
    font-size: var(--text-sm);
}

.note small {
    font-size: var(--text-xs);
    color: var(--muted);
}

/* --- Footer --- */
.footer {
    padding: var(--s8) 0 var(--s5);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s6);
}

.footer-brand small {
    display: block;
    margin-top: var(--s1);
    font-size: var(--text-sm);
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s6);
    font-size: var(--text-sm);
    color: var(--muted);
}

/* Its line spans the content only, not the page's side padding. */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: var(--s4);
    width: calc(100% - 2 * var(--gutter));
    max-width: calc(var(--content) - 2 * var(--gutter));
    margin-top: var(--s6);
    padding: var(--s4) 0 0;
    border-top: 1px solid var(--line);
    font-size: var(--text-xs);
    color: var(--muted);
}

.footer a:hover {
    color: var(--accent-deep);
}

/* --- Motion --- */
/* Sections rise in as they reach the screen; page.js adds "shown". */
.reveal {
    opacity: 0;
    transform: translateY(var(--s8));
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

.reveal.shown {
    opacity: 1;
    transform: none;
}

@keyframes float {
    50% {
        transform: translateY(-8px);
    }
}

@keyframes wheel {
    to {
        transform: translateY(10px);
        opacity: 0;
    }
}

@keyframes drift {
    to {
        background-position: 100% 0;
    }
}

@keyframes ring {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .toast,
    .scroll span,
    .cta {
        animation: none;
    }
}

/* --- Tablets: smaller tokens; the hero stacks and centres, the rest keeps two columns where they fit --- */
@media (max-width: 960px) {
    :root {
        --text-base: 14px;
        --text-lg: 16px;
        --title: 28px;
        --display: 40px;
        --phone: 220px;
        --phone-pair: 180px;
        --stage: 480px;
    }

    .screen {
        padding: calc(var(--nav) + var(--s6)) 0 var(--s12);
    }

    /* Hero: the words centred above the two phones */
    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--s10);
    }

    .hero-grid > :first-child {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero .phone.front {
        transform: translateX(-48px);
    }

    .hero .phone.behind {
        transform: translateX(96px) translateY(var(--s6));
    }

    .scroll {
        display: none;
    }

    /* Apps and data: the two cards side by side, the two screens under them */
    .trio {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--s4);
    }

    .trio .stage {
        grid-column: 1 / -1;
        order: 2;
        padding-top: var(--s6);
    }

    /* Setup: the steps beside a smaller phone */
    .setup {
        gap: var(--s6);
    }

    /* Presets: each group's name above its rows */
    .timetable {
        --timeline: 42%;
    }

    .preset-group {
        grid-template-columns: minmax(0, 1fr);
    }

    .preset-group .group-head {
        margin-bottom: var(--s1);
    }
}

/* --- Phones: the smallest tokens, and every row becomes one column --- */
@media (max-width: 640px) {
    :root {
        --title: 25px;
        --display: 34px;
        --gutter: 20px;
        --text-lg: 15px;
        --phone-pair: 46%;
    }

    .sides,
    .trio,
    .setup,
    .apps,
    .notes {
        grid-template-columns: minmax(0, 1fr);
    }

    .trio .stage {
        grid-column: auto;
    }

    /* Top bar: the logo and the download button only */
    .links {
        display: none;
    }

    .nav-cta {
        margin-inline-start: auto;
    }

    /* Hero: one screen tall. The download button is in the top bar, so the words lead straight to the parent's
       phone, a little smaller, with the toasts on its corners. */
    .hero-grid {
        gap: var(--s8);
    }

    .hero .lead {
        margin-bottom: 0;
    }

    .hero .cta {
        display: none;
    }

    .hero .stage {
        min-height: 0;
        padding-bottom: var(--s10);
    }

    /* The phone shrinks on short screens: what is left of the height after the words, over its 2.3 aspect. */
    .hero .phone.front {
        width: clamp(150px, calc((100svh - 360px) / 2.3), 200px);
        transform: none;
    }

    .hero .phone.behind {
        display: none;
    }

    .toast {
        gap: var(--s2);
        padding: 6px;
        padding-inline-end: var(--s3);
        font-size: var(--text-xs);
    }

    .toast .tile {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .toast small {
        font-size: 11px;
    }

    .toast.lower {
        bottom: 96px;
        inset-inline-end: 0;
    }

    .toast.upper {
        top: var(--s6);
        inset-inline-start: 0;
    }

    /* Family: each row's small line under its title, and the talk's words above the chat */
    .row-body b {
        display: block;
    }

    .talk {
        flex-direction: column;
        align-items: stretch;
        gap: var(--s4);
        padding: var(--s4);
    }

    .talk-text b {
        font-size: var(--text-base);
    }

    /* Setup: the phone under the steps */
    .setup .stage {
        order: 2;
    }

    /* Presets: each preset's name above its day, and the ages under their title */
    .timetable {
        padding-inline: var(--s2);
    }

    .preset-group li {
        grid-template-columns: minmax(0, 1fr);
        row-gap: var(--s1);
    }

    .preset-name {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        line-height: 1.5;
    }

    .ages {
        flex-wrap: wrap;
    }

    .ages-head {
        flex-basis: 100%;
        margin-bottom: var(--s1);
    }

    .age {
        flex: 1;
        flex-direction: column;
        align-items: center;
        gap: 0;
        border-radius: var(--r-md);
        line-height: 1.5;
    }

    /* Questions */
    summary {
        padding-inline: var(--s4);
    }

    details p {
        padding-inline: var(--s4);
    }

    /* Footer */
    .footer-row,
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- The narrowest phones: slightly smaller type and edges, so every line still fits --- */
@media (max-width: 380px) {
    :root {
        --text-lg: 14px;
        --text-sm: 12px;
        --gutter: 16px;
        --badge: 30px;
    }

    .step {
        gap: var(--s2);
        padding-inline: var(--s2);
    }

    summary {
        gap: var(--s2);
        padding-inline: var(--s3);
    }

    details p {
        padding-inline: var(--s3);
    }
}
