/*
 * Islamic Portal design tokens on the kids site: the shared foundation (Part 39), loaded first by _Layout.
 *
 * The same names exist on the website and the portal, each with the value that site already uses, so a component
 * written with them looks right wherever it lands. Here they carry the Sky Garden's values: rounder corners, bigger
 * type and controls, softer and bouncier motion. The Sky Garden's own colours, shadows and fonts stay in kids.css
 * (--ink, --paper, --grape, --shadow, --font-display...); the neutrals are mirrored below under the shared names.
 * Inventory and rules: docs/learning-universe/DESIGN-SYSTEM.md. Living style guide: /design.
 */

:root {
    /* Spacing: the same rhythm as the website. */
    --ip-space-1: .25rem;
    --ip-space-2: .5rem;
    --ip-space-3: .75rem;
    --ip-space-4: 1rem;
    --ip-space-5: 1.5rem;
    --ip-space-6: 2rem;
    --ip-space-7: 2.5rem;
    --ip-space-8: 3rem;
    --ip-space-9: 4rem;
    --ip-space-10: 5rem;

    /* Radii: clay-soft. sm, md and lg are kids.css's --radius-s, --radius and --radius-l; the Sky Garden has no step
     * above lg, so xl is the same. */
    --ip-radius-xs: 12px;
    --ip-radius-sm: 16px;
    --ip-radius-md: 24px;
    --ip-radius-lg: 34px;
    --ip-radius-xl: 34px;
    --ip-radius-pill: 999px;

    /* Type scale: the body is 18px (17px on phones); headings come from kids.css. */
    --ip-text-xs: .8rem;
    --ip-text-sm: .9rem;
    --ip-text-base: 1.125rem;
    --ip-text-lg: 1.15rem;
    --ip-text-xl: 1.4rem;
    --ip-text-2xl: clamp(1.5rem, 2.8vw, 2.1rem);
    --ip-text-3xl: clamp(2rem, 5vw, 3rem);
    --ip-text-4xl: clamp(2.1rem, 4.8vw, 3.4rem);
    --ip-leading-tight: 1.1;
    --ip-leading-body: 1.5;

    /* Motion (Part 39.5): the same purposes as the website. */
    --ip-motion-fast: 150ms;
    --ip-motion-base: 200ms;
    --ip-motion-lift: 250ms;
    --ip-motion-panel: 300ms;
    --ip-motion-slow: 400ms;
    --ip-motion-scene: 600ms;

    /* Easing: kids.css's --ease-soft and --ease-bounce. */
    --ip-ease-out: cubic-bezier(.2, 1, .3, 1);
    --ip-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --ip-ease-standard: ease;
    --ip-ease-in-out: ease-in-out;

    /* Stacking: the Sky Garden shell. Dialogs (<dialog>) open in the browser's top layer, above all of these. */
    --ip-z-raised: 1;
    --ip-z-sticky: 50;     /* the phone tab bar */
    --ip-z-overlay: 55;    /* the dimmed sky behind the open phone menu */
    --ip-z-header: 60;
    --ip-z-dropdown: 70;
    --ip-z-toast: 80;
    --ip-z-modal: 90;      /* full-screen moments: confetti, the star burst */
    --ip-z-skip: 100;

    /* Breakpoints used by the Sky Garden. For scripts and as the reference; write (max-width: 760px) in @media. */
    --ip-bp-sm: 560px;
    --ip-bp-md: 760px;
    --ip-bp-lg: 900px;
    --ip-bp-xl: 1100px;
    --ip-bp-2xl: 1640px;

    /* Focus and touch: big targets for small fingers. */
    --ip-focus-width: 4px;
    --ip-focus-offset: 3px;
    --ip-control-h: 56px;  /* .k-btn; .k-btn--small is 46px */

    /* The Sky Garden's neutrals under the shared names. They follow Lantern time (the dark theme) by themselves. */
    --ip-bg: var(--page);
    --ip-surface: var(--paper);
    --ip-surface-2: var(--cream);
    --ip-line: var(--line);
    --ip-ink: var(--ink);
    --ip-ink-2: var(--ink-soft);
    --ip-muted: var(--ink-faint);
    --ip-focus: var(--grape);
}

/* Less motion: anything timed with the tokens becomes instant (kids.css also cuts every transition then). */
@media (prefers-reduced-motion: reduce) {
    :root {
        --ip-motion-fast: .01ms;
        --ip-motion-base: .01ms;
        --ip-motion-lift: .01ms;
        --ip-motion-panel: .01ms;
        --ip-motion-slow: .01ms;
        --ip-motion-scene: .01ms;
    }
}
