/* ══════════════════════════════════════════════════════════════════
   CS42 · Version 2
   Big type, real screenshots, lots of room, and motion that follows
   the scroll. One sans face (San Francisco on Apple devices, Inter
   elsewhere). Three themes, all owls:
     Night Owl   deep navy, the default             :root
     Snowy Owl   white and light grey               [data-palette="snowy-owl"]
     Midnight    black                              [data-palette="midnight"]
   <html> carries data-palette (which theme) and data-theme="dark|light"
   (its mode). Older page CSS (games, quizzes, Sukoon, piano) uses the
   same token names (--bg, --fg, --accent...), so it follows every theme.
   tools/site/DESIGN.md shows how to build a page with these parts.
   ══════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens ───────────────────────────────────────────────────── */
:root {
    color-scheme: dark;
    --bg:      #0E2841;   /* page */
    --bg-alt:  #0A1F34;   /* alternate band */
    --bg-2:    #15324F;   /* tiles and cards */
    --bg-3:    #1C3C5C;   /* soft fills, fields */
    --bg-4:    #26496C;
    --ink-band:#061527;   /* the darkest band (showcase sections) */
    --fg:      #F5F5F7;
    --fg-2:    #BFCCD9;
    --fg-3:    #8FA3B7;
    --fg-4:    rgba(245,245,247,0.3);
    --line:    rgba(255,255,255,0.12);
    --line-2:  rgba(255,255,255,0.22);
    --accent:      #6BD3C8;
    --accent-2:    #93E2D9;
    --accent-ink:  #052725;
    --accent-soft: rgba(107,211,200,0.14);
    --gold:    #E8C079;
    --rose:    #F2927F;
    --lilac:   #C3B8F0;
    --sage:    #A9CFB6;
    --nav-bg:  rgba(14,40,65,0.8);
    --nav-fg:  rgba(245,245,247,0.86);
    --scrim:   rgba(4,14,26,0.42);
    --shadow:  0 40px 80px -40px rgba(0,0,0,0.65);
    --shadow-sm: 0 18px 40px -24px rgba(0,0,0,0.6);

    /* Play colours (tiles in Play and Chill) */
    --tile-quiz:  #E9BF63;
    --tile-game:  #EC8D72;
    --tile-piano: #C3B8F0;
    --tile-chill: #A9CFB6;
    --tile-ink:   #16161A;

    --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-ar: -apple-system, BlinkMacSystemFont, "Noto Sans Arabic", "Inter", "Segoe UI", Tahoma, sans-serif;
    --serif: var(--font);        /* older pages asked for a serif or a mono label face: both are the sans now */
    --mono:  var(--font);
    --font-display: var(--font);
    --font-body: var(--font);
    --font-px: var(--font);

    --gutter: 22px;
    --w-text: 692px;
    --w:      980px;
    --w-wide: 1240px;
    --w-chrome: var(--w-wide);   /* the nav, flyouts and footer share the content's wide edge */
    --nav-h:  48px;
    --radius-lg: 28px;
    --radius:    18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --ease:     cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --pad: var(--gutter);
}
@media (min-width: 735px) { :root { --gutter: 40px; } }

:root[data-palette="snowy-owl"] {
    color-scheme: light;
    --bg:      #FFFFFF;
    --bg-alt:  #F5F5F7;
    --bg-2:    #F5F5F7;
    --bg-3:    #E8E8ED;
    --bg-4:    #D2D2D7;
    --ink-band:#000000;
    --fg:      #1D1D1F;
    --fg-2:    #424245;
    --fg-3:    #6E6E73;
    --fg-4:    rgba(29,29,31,0.3);
    --line:    #D2D2D7;
    --line-2:  #B9B9C0;
    --accent:      #0B6E69;
    --accent-2:    #08524E;
    --accent-ink:  #FFFFFF;
    --accent-soft: rgba(11,110,105,0.1);
    --gold:    #93640F;
    --rose:    #B4422F;
    --lilac:   #6B55C2;
    --sage:    #3F7A52;
    --nav-bg:  rgba(255,255,255,0.8);
    --nav-fg:  rgba(29,29,31,0.86);
    --scrim:   rgba(232,232,237,0.5);
    --shadow:  0 40px 80px -44px rgba(29,29,31,0.38);
    --shadow-sm: 0 18px 40px -26px rgba(29,29,31,0.3);
    --tile-quiz:  #F4C766;
    --tile-game:  #F08C73;
    --tile-piano: #D5CCF6;
    --tile-chill: #BFDDC9;
}
:root[data-palette="midnight"] {
    --bg:      #000000;
    --bg-alt:  #0D0D0F;
    --bg-2:    #161618;
    --bg-3:    #1F1F22;
    --bg-4:    #2C2C30;
    --ink-band:#000000;
    --fg:      #F5F5F7;
    --fg-2:    #C8C8CD;
    --fg-3:    #8E8E93;
    --line:    rgba(255,255,255,0.14);
    --line-2:  rgba(255,255,255,0.24);
    --nav-bg:  rgba(22,22,24,0.78);
    --scrim:   rgba(0,0,0,0.5);
    --shadow:  0 40px 80px -40px rgba(0,0,0,0.9);
}

/* A band that is always dark, in every theme (showcase sections) */
.band-ink {
    color-scheme: dark;
    --bg: var(--ink-band);
    --bg-2: #141A22;
    --bg-3: #1E252F;
    --fg: #F5F5F7;
    --fg-2: #C9CFD6;
    --fg-3: #8E98A4;
    --line: rgba(255,255,255,0.14);
    --line-2: rgba(255,255,255,0.24);
    --accent: #6BD3C8;
    --accent-2: #93E2D9;
    --accent-ink: #052725;
    --gold: #E8C079;
    --rose: #F2927F;
    background: var(--bg);
    color: var(--fg);
}
:root[data-palette="midnight"] .band-ink { --bg-2: #161618; --bg-3: #1F1F22; }
.band-alt { background: var(--bg-alt); }
:root[data-palette="snowy-owl"] .band-alt { --bg-2: #FFFFFF; }

/* ── 2. Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: var(--bg);
}
/* Jump targets stop below a sticky product bar. This is scroll-margin on the targets, not
   scroll-padding on the page: with scroll-padding, focusing a control inside the sticky bar
   made the browser scroll to "reveal" it. */
:where(main [id]):not(.ln, .ln *) { scroll-margin-top: calc(var(--ln-h, 0px) + 12px); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.47;
    letter-spacing: -0.012em;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}
:lang(ar) { font-family: var(--font-ar); letter-spacing: 0; }
/* the shared chrome is English on every page, Arabic ones included */
[lang="en"]:not(html) { font-family: var(--font); letter-spacing: -0.012em; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
strong, b { font-weight: 600; }
/* --focus is the theme's own accent, resolved on the root, so tiles that recolour --accent keep a visible ring */
:root { --focus: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 34%, transparent); }
[hidden] { display: none !important; }
.sr, .cs-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
    position: absolute; left: 12px; top: -60px; z-index: 200;
    padding: 10px 16px; border-radius: 980px;
    background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 600;
}
.skip:focus { top: 8px; text-decoration: none; }

/* ── 3. Type ─────────────────────────────────────────────────────── */
.t-hero    { font-size: clamp(48px, 7.4vw, 96px);  line-height: 1.04; letter-spacing: -0.032em; font-weight: 600; }
.t-display { font-size: clamp(40px, 5.6vw, 80px);  line-height: 1.05; letter-spacing: -0.03em;  font-weight: 600; }
.t-1       { font-size: clamp(34px, 4.6vw, 56px);  line-height: 1.07; letter-spacing: -0.026em; font-weight: 600; }
.t-2       { font-size: clamp(28px, 3.3vw, 40px);  line-height: 1.1;  letter-spacing: -0.02em;  font-weight: 600; }
.t-3       { font-size: clamp(21px, 2.1vw, 28px);  line-height: 1.16; letter-spacing: -0.014em; font-weight: 600; }
.t-4       { font-size: clamp(19px, 1.6vw, 21px);  line-height: 1.24; letter-spacing: -0.01em;  font-weight: 600; }
.t-lead    { font-size: clamp(19px, 2vw, 24px);    line-height: 1.38; letter-spacing: -0.012em; font-weight: 400; color: var(--fg-2); }
.t-intro   { font-size: clamp(19px, 2vw, 24px);    line-height: 1.36; letter-spacing: -0.014em; font-weight: 600; color: var(--fg-3); }
.t-intro strong, .t-intro b { color: var(--fg); }
.t-body    { font-size: 17px; line-height: 1.47; }
.t-small   { font-size: 14px; line-height: 1.43; letter-spacing: -0.006em; }
.t-fine    { font-size: 12px; line-height: 1.33; letter-spacing: 0; color: var(--fg-3); }
.t-muted   { color: var(--fg-3); }
.t-soft    { color: var(--fg-2); }
.t-num     { font-variant-numeric: tabular-nums; }
.t-center  { text-align: center; }
/* Arabic letters join: never track them */
:lang(ar) :is(.t-hero, .t-display, .t-1, .t-2, .t-3, .t-4, .t-lead, .t-intro, .t-body, .t-small, .eyebrow, .btn, .more, .stat-num, .pull) { letter-spacing: 0; }
.t-center .btns { justify-content: center; }

/* The small line above a headline: what it is, then its status */
.eyebrow {
    display: block;
    margin-bottom: 12px;
    font-size: clamp(15px, 1.4vw, 17px);
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.008em;
    color: var(--fg-2);
}
/* Status words keep the colour of the line they sit in; a small dot says which kind */
.st, .st--new, .st--live { white-space: nowrap; }
.st::before, .st--new::before, .st--live::before {
    content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 0 1px;
    border-radius: 50%; background: var(--gold); vertical-align: 0.18em;
}
.st--new::before { background: var(--rose); }
.st--live::before { background: var(--accent); }
/* inside a headline's eyebrow (which already has its own · separators) and inside links,
   the status is just a word, set a touch brighter */
.eyebrow .st::before, .eyebrow .st--new::before, .eyebrow .st--live::before,
a .st::before, a .st--new::before, a .st--live::before { display: none; }
.eyebrow .st, .eyebrow .st--new, .eyebrow .st--live { color: var(--fg); }
a .st--new { font-weight: 600; }

/* ── 4. Layout ───────────────────────────────────────────────────── */
.wrap      { width: min(100% - 2 * var(--gutter), var(--w)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * var(--gutter), var(--w-wide)); margin-inline: auto; }
.wrap-text { width: min(100% - 2 * var(--gutter), var(--w-text)); margin-inline: auto; }
.wrap-full { width: 100%; }
.sec      { padding-block: clamp(84px, 11vw, 168px); position: relative; }
.sec--sm  { padding-block: clamp(56px, 7vw, 96px); }
.sec--top0 { padding-top: 0; }
.sec--bot0 { padding-bottom: 0; }
.stack > * + * { margin-top: var(--stack, 20px); }
.head { max-width: 820px; }
.head.t-center { margin-inline: auto; }
.head > .t-lead, .head > .t-intro, .head > p { margin-top: 18px; }
.head > .btns { margin-top: 28px; }
.split {
    display: grid;
    gap: clamp(32px, 6vw, 96px);
    align-items: center;
}
@media (min-width: 900px) {
    .split { grid-template-columns: 1fr 1fr; }
    .split--wide-media { grid-template-columns: 5fr 7fr; }
    .split--wide-text  { grid-template-columns: 7fr 5fr; }
    .split--flip > :first-child { order: 2; }
}
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ── 5. Buttons and links ────────────────────────────────────────── */
.btns { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.btn, .cs-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 11px 22px;
    border-radius: 980px; border: 1px solid transparent;
    background: var(--accent); color: var(--accent-ink);
    font-size: 17px; line-height: 1.18; font-weight: 500; letter-spacing: -0.01em;
    text-decoration: none; white-space: nowrap;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover, .cs-btn:hover { background: var(--accent-2); text-decoration: none; }
.btn:active, .cs-btn:active { transform: scale(0.98); }
.btn--ghost, .cs-btn--ghost { background: transparent; color: var(--accent); border-color: currentColor; }
.btn--ghost:hover, .cs-btn--ghost:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--sm, .cs-btn--sm { min-height: 32px; padding: 6px 15px; font-size: 14px; }
.btn--lg, .cs-btn--lg { min-height: 52px; padding: 14px 30px; font-size: 19px; }
.btn--plain { background: var(--fg); color: var(--bg); }
.btn--plain:hover { background: var(--fg-2); }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* "Learn more ›": a text link with a chevron */
.more {
    display: inline-block;
    font-size: 17px; font-weight: 400; color: var(--accent);
}
.more::after {
    content: ""; display: inline-block; vertical-align: 0.1em; width: 0.42em; height: 0.42em; margin-left: 0.3em;
    border: solid currentColor; border-width: 0.09em 0.09em 0 0;
    transform: rotate(45deg) translateY(-0.02em);
    transition: transform .2s var(--ease);
}
.more:hover::after { transform: translateX(2px) rotate(45deg); }
.more:dir(rtl)::after { margin-left: 0; margin-right: 0.3em; transform: rotate(-135deg) translateY(-0.02em); }
.more:dir(rtl):hover::after { transform: translateX(-2px) rotate(-135deg); }
.more--ext::after { transform: rotate(0deg); border-width: 0.09em 0.09em 0 0; }
a[target="_blank"] .ext { display: inline-block; margin-left: 0.15em; font-size: 0.85em; }

/* ── 6. Global nav (Apple's globalnav: thin bar, flyout panels) ──── */
.gn { position: relative; z-index: 100; height: var(--nav-h); }
.gn-bar {
    position: relative; z-index: 3;
    display: flex; align-items: center; justify-content: space-between;
    height: var(--nav-h);
    width: min(100% - 2 * var(--gutter), var(--w-chrome)); margin-inline: auto;
}
.gn::before {
    content: ""; position: absolute; inset: 0 0 auto; height: var(--nav-h); z-index: 1;
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    transition: height .32s var(--ease-out), background-color .3s var(--ease);
}
.gn.is-open::before { height: var(--fly-h, var(--nav-h)); background: var(--bg); }
.gn-logo { display: flex; align-items: center; padding: 8px; margin-left: -8px; border-radius: 8px; }
.gn-logo .mark { width: 24px; height: 24px; }
.gn-list { display: none; list-style: none; gap: clamp(18px, 3vw, 40px); }
.gn-list a {
    display: block; padding: 6px 0;
    font-size: 12.5px; line-height: 1; letter-spacing: -0.005em;
    color: var(--nav-fg); text-decoration: none;
    transition: color .2s var(--ease);
}
.gn-list a:hover, .gn-list a[aria-expanded="true"] { color: var(--fg); }
.gn-list a[aria-current="page"], .gn-list .is-section > a { color: var(--fg); font-weight: 500; }
.gn-tools { display: flex; align-items: center; gap: 2px; margin-right: -8px; }
.gn-btn {
    display: grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: 10px; background: transparent; color: var(--nav-fg);
}
.gn-btn:hover { color: var(--fg); }

/* the theme button shows the owl in use */
.gn-btn .owl { grid-area: 1 / 1; opacity: 0; transform: scale(.6) rotate(-20deg); transition: opacity .3s var(--ease), transform .4s var(--ease-out); }
:root[data-palette="night-owl"] .gn-btn .owl--night-owl,
:root[data-palette="snowy-owl"] .gn-btn .owl--snowy-owl,
:root[data-palette="midnight"]  .gn-btn .owl--midnight,
:root:not([data-palette]) .gn-btn .owl--night-owl { opacity: 1; transform: none; }
.gn-theme { position: relative; }
.gn-theme-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 4;
    min-width: 200px; padding: 6px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-sm);
}
.gn-theme-menu button {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 12px; border: 0; border-radius: 9px; background: transparent;
    font-size: 15px; text-align: left; color: var(--fg);
}
.gn-theme-menu button:hover { background: var(--bg-3); }
.gn-theme-menu button[aria-checked="true"]::after {
    content: ""; margin-left: auto; width: 6px; height: 11px;
    border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px);
}

/* flyouts */
.gn-fly {
    position: absolute; left: 0; right: 0; top: var(--nav-h); z-index: 2;
    padding: 28px 0 64px;
}
.gn-fly-in {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px;
    width: min(100% - 2 * var(--gutter), var(--w-chrome)); margin-inline: auto;
}
.gn-h { font-size: 12px; font-weight: 400; color: var(--fg-3); margin-bottom: 14px; }
.gn-fly ul { list-style: none; }
.gn-col--big ul { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: 48px; }
.gn-col--big a { display: inline-block; padding: 4px 0; font-size: 24px; line-height: 1.17; font-weight: 600; letter-spacing: -0.016em; color: var(--fg); }
.gn-col a { display: inline-block; padding: 4px 0; font-size: 14px; color: var(--fg-2); }
.gn-fly a:hover { color: var(--accent); text-decoration: none; }
.gn-fly a[aria-current="page"] { color: var(--accent); }
.gn.is-open .gn-fly.is-on .gn-fly-in > * { animation: gn-in .4s var(--ease-out) both; }
.gn.is-open .gn-fly.is-on .gn-fly-in > :nth-child(2) { animation-delay: .05s; }
@keyframes gn-in { from { opacity: 0; transform: translateY(-6px); } }
.gn-scrim {
    position: fixed; inset: 0; z-index: 0;
    background: var(--scrim);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    animation: fade-in .3s var(--ease) both;
}
@keyframes fade-in { from { opacity: 0; } }

/* phone menu */
.gn-burger { display: grid; gap: 6px; align-content: center; }
.gn-burger span { display: block; width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease-out); }
.gn-burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.gn-burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.75px) rotate(-45deg); }
.gn-menu {
    position: fixed; inset: var(--nav-h) 0 0; z-index: 2;
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg);
    padding: 12px var(--gutter) 48px;
}
.gn-menu:not([hidden]) { animation: fade-in .25s var(--ease) both; }
.mm { list-style: none; max-width: 560px; margin-inline: auto; }
.mm > li > a, .mm summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; font-size: 28px; line-height: 1.14; font-weight: 600; letter-spacing: -0.02em;
    color: var(--fg); text-decoration: none; cursor: pointer; list-style: none;
}
.mm summary::-webkit-details-marker { display: none; }
.mm summary .chev { width: 18px; height: 18px; color: var(--fg-3); transition: transform .3s var(--ease-out); }
.mm details[open] summary .chev { transform: rotate(90deg); }
.mm details ul { list-style: none; padding: 2px 0 14px; }
.mm details a { display: block; padding: 7px 0; font-size: 17px; color: var(--fg-2); }
.mm a[aria-current="page"] { color: var(--accent); }
body.menu-open { overflow: hidden; }

@media (min-width: 834px) {
    .gn-list { display: flex; }
    .gn-burger, .gn-menu { display: none !important; }
}
@media (max-width: 833px) {
    .gn-fly, .gn-scrim { display: none !important; }
}

/* ── 7. Local nav (a product's own bar; it sticks while you read) ── */
.ln {
    --ln-h: 52px;
    position: sticky; top: 0; z-index: 90;
    height: var(--ln-h);
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
}
.ln-in {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    height: 100%; width: min(100% - 2 * var(--gutter), var(--w-wide)); margin-inline: auto;   /* on the content's own edge */
}
.ln-title { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 600; letter-spacing: -0.016em; color: var(--fg); white-space: nowrap; }
.ln-title:hover { text-decoration: none; }
.ln-title img { width: 28px; height: 28px; border-radius: 7px; }
.ln-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.ln-links a:not(.btn) { font-size: 12.5px; color: var(--fg-2); white-space: nowrap; }
.ln-links a:not(.btn):hover, .ln-links a.is-here { color: var(--fg); text-decoration: none; }
.ln-links .btn { position: relative; min-height: 28px; padding: 4px 13px; font-size: 12.5px; }
.ln-links .btn::after { content: ""; position: absolute; inset: -8px -6px; }   /* a 44px tap area around the small pill */
@media (max-width: 733px) {
    .ln-links li:not(:last-child) { display: none; }
    .ln-title { font-size: 19px; }
}
:root { --ln-h: 0px; }
:root:has(.ln) { --ln-h: 52px; }   /* on the root, so html's scroll-padding allows for the bar */

/* ── 8. Components ───────────────────────────────────────────────── */

/* Hero: the first screen of a page */
.hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(48px, 7vw, 96px); text-align: center; }
.hero .head { margin-inline: auto; }
.hero .t-lead { max-width: 640px; margin-inline: auto; }
.hero .btns { justify-content: center; }
.page-head { padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(36px, 5vw, 64px); }

/* Tiles: big rounded panels, headline on top, picture below (Apple's home page) */
.tiles { display: grid; gap: 12px; width: min(100% - 24px, 1680px); margin-inline: auto; }
@media (min-width: 900px) { .tiles--2 { grid-template-columns: 1fr 1fr; } .tiles--3 { grid-template-columns: repeat(3, 1fr); } }
.tile {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; align-items: center;
    min-height: clamp(480px, 52vw, 640px);
    padding: clamp(44px, 5vw, 60px) 24px 0;
    border-radius: var(--radius-lg);
    background: var(--bg-2); color: var(--fg);
    text-align: center;
}
.tile > .tile-media { margin-top: auto; width: 100%; display: flex; justify-content: center; }
.tile .t-2 + p, .tile .t-1 + p { margin-top: 8px; }
.tile .btns { justify-content: center; margin-top: 18px; }
.tile--left { align-items: flex-start; text-align: left; padding-inline: clamp(24px, 4vw, 56px); }
.tile--left .btns { justify-content: flex-start; }
a.tile:hover { text-decoration: none; }
.tile--quiz  { background: var(--tile-quiz);  color: var(--tile-ink); }
.tile--game  { background: var(--tile-game);  color: var(--tile-ink); }
.tile--piano { background: var(--tile-piano); color: var(--tile-ink); }
.tile--chill { background: var(--tile-chill); color: var(--tile-ink); }
/* inside a coloured tile the ring is ink; the tile's own ring (drawn on the page) stays the theme's */
:is(.tile--quiz, .tile--game, .tile--piano, .tile--chill) * { --focus: var(--tile-ink); }
.tile--quiz, .tile--game, .tile--piano, .tile--chill {
    color-scheme: light;
    --fg: var(--tile-ink); --fg-2: rgba(22,22,26,0.78); --fg-3: rgba(22,22,26,0.64);
    --accent: #16161A; --accent-2: #000; --accent-ink: #FFFFFF; --line: rgba(22,22,26,0.16);
}

/* Cards: smaller rounded panels in a row or grid */
.cards { display: grid; gap: 20px; }
@media (min-width: 735px) { .cards--2 { grid-template-columns: repeat(2, 1fr); } .cards--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } .cards--4 { grid-template-columns: repeat(4, 1fr); } }
.card {
    position: relative; overflow: hidden;
    padding: clamp(24px, 3vw, 36px);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    color: var(--fg);
}
a.card { display: block; transition: transform .45s var(--ease-out); }
a.card:hover { text-decoration: none; transform: scale(1.012); }
.card .t-3 + p, .card .t-4 + p { margin-top: 8px; color: var(--fg-2); }

/* Text features on hairlines (no icon boxes) */
.specs { display: grid; gap: 0 clamp(28px, 4vw, 56px); list-style: none; }
@media (min-width: 735px) { .specs--2 { grid-template-columns: repeat(2, 1fr); } .specs--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .specs--3 { grid-template-columns: repeat(3, 1fr); } }
.specs > li, .specs > div { padding: 22px 0 28px; border-top: 1px solid var(--line); }
.specs h3, .specs dt { font-size: 19px; line-height: 1.26; font-weight: 600; letter-spacing: -0.01em; }
.specs p, .specs dd { margin: 6px 0 0; color: var(--fg-2); }

/* Checks: a short list of facts */
.facts { list-style: none; display: grid; gap: 12px; }
.facts li { position: relative; padding-inline-start: 28px; color: var(--fg-2); }
.facts li::before {
    content: ""; position: absolute; inset-inline-start: 3px; top: 0.42em; width: 13px; height: 7px;
    border: solid var(--accent); border-width: 0 0 2px 2px; transform: rotate(-45deg);
}

/* Big numbers */
.stats { display: grid; gap: 28px 40px; list-style: none; }
@media (min-width: 735px) { .stats { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); } }
.stat-num {
    display: block;
    font-size: clamp(44px, 5.4vw, 72px); line-height: 1; font-weight: 600; letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
}
.stat-label { display: block; margin-top: 10px; font-size: 15px; line-height: 1.35; color: var(--fg-2); max-width: 26ch; text-wrap: balance; }

/* Screens: a desktop screenshot, flat, with a hairline and a soft shadow */
.screen {
    position: relative; overflow: hidden;
    border-radius: clamp(10px, 1.2vw, 16px);
    background: var(--bg-3);
    box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.screen img { width: 100%; }
/* Phones: an app screenshot in a rounded black bezel */
.phone {
    position: relative; overflow: hidden;
    width: min(100%, var(--phone-w, 280px));
    aspect-ratio: 9 / 19.5;
    padding: 9px;
    border-radius: clamp(34px, 4vw, 48px);
    background: #0B0B0D;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), inset 0 0 0 1.5px #2A2A2E, var(--shadow);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: clamp(26px, 3.2vw, 39px); }
/* App Store artwork (already framed): just round it off */
.shot { border-radius: clamp(18px, 2vw, 28px); overflow: hidden; background: var(--bg-3); }
.shot img { width: 100%; }

/* Gallery: a row that scrolls sideways, with paddles (Apple's "Get the highlights") */
.gallery { position: relative; }
.gallery-track {
    display: flex; gap: 20px; list-style: none; margin: 0;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 4px max(var(--gutter), calc((100vw - var(--w-wide)) / 2)) 28px;
    scroll-padding-inline: max(var(--gutter), calc((100vw - var(--w-wide)) / 2));
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 auto; scroll-snap-align: start; width: var(--item-w, min(78vw, 372px)); }
.gallery-item figcaption { margin-top: 14px; font-size: 14px; color: var(--fg-3); }
.gallery-nav { display: flex; justify-content: flex-end; gap: 14px; width: min(100% - 2 * var(--gutter), var(--w-wide)); margin: 8px auto 0; }
.paddle {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%;
    background: var(--bg-3); color: var(--fg);
    transition: background-color .2s var(--ease), opacity .2s var(--ease);
}
.paddle:hover { background: var(--bg-4); }
.paddle:disabled { opacity: 0.38; cursor: default; }
.paddle svg { width: 18px; height: 18px; }

/* Story: one picture stays put while the text steps scroll past it */
.story { position: relative; }
.story-grid { display: grid; gap: 40px; }
.story-media { position: relative; }
.story-frame { position: relative; display: grid; }
.story-frame > * { grid-area: 1 / 1; transition: opacity .6s var(--ease), transform .8s var(--ease-out); }
.story-frame > :not(.is-on) { opacity: 0; transform: scale(0.97); }
.story-step { padding-block: 8px; }
.story-step .eyebrow { color: var(--accent); }
@media (min-width: 900px) {
    .story-grid { grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
    .story-media { position: sticky; top: calc(var(--ln-h) + max(80px, (100vh - var(--story-h, 560px)) / 2)); }
    .story-steps { padding-block: 22vh 30vh; }
    .story-step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; }
    .js .story-step { opacity: 0.28; transition: opacity .5s var(--ease); }
    .js .story-step.is-on { opacity: 1; }
}
@media (max-width: 899px) {
    .story-media { display: none; }            /* phones see each step's own picture (.story-inline) */
    .story-frame > :not(.is-on) { display: none; }
    .story-steps { display: grid; gap: 56px; }
    .story-step .story-inline { margin-top: 24px; }
}
@media (min-width: 900px) { .story-inline { display: none; } }

/* Quote: a line on its own */
.pull {
    font-size: clamp(28px, 3.6vw, 48px); line-height: 1.12; letter-spacing: -0.024em; font-weight: 600;
}
.pull + .pull-by { margin-top: 18px; color: var(--fg-3); font-size: 17px; }

/* Long text (privacy, terms, notes) */
.prose { font-size: 17px; line-height: 1.6; color: var(--fg-2); }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 2.2em; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.16; letter-spacing: -0.018em; color: var(--fg); }
.prose h3 { margin-top: 1.8em; font-size: 21px; line-height: 1.24; letter-spacing: -0.012em; color: var(--fg); }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose strong { color: var(--fg); }
.prose a { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--fg); font-weight: 600; }
:lang(ar) .prose ul, :lang(ar) .prose ol { padding-left: 0; padding-right: 1.3em; }
:lang(ar) .prose th, :lang(ar) .prose td { text-align: right; padding: 10px 0 10px 12px; }

/* Questions and answers */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    padding: 22px 0; cursor: pointer; list-style: none;
    font-size: clamp(17px, 1.7vw, 21px); font-weight: 600; letter-spacing: -0.012em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: ""; flex: none; width: 12px; height: 12px;
    background: linear-gradient(currentColor, currentColor) center / 12px 1.6px no-repeat,
                linear-gradient(currentColor, currentColor) center / 1.6px 12px no-repeat;
    color: var(--fg-3); transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 0 24px; color: var(--fg-2); max-width: 760px; }
.faq .faq-a > * + * { margin-top: 0.8em; }

/* Forms */
.field { display: grid; gap: 8px; }
.field + .field { margin-top: 18px; }
.field label, .label { font-size: 14px; font-weight: 600; color: var(--fg-2); }
.input, .field input, .field textarea, .field select {
    width: 100%; min-height: 52px; padding: 14px 16px;
    border: 1px solid var(--line-2); border-radius: 12px;
    background: var(--bg); color: var(--fg); font-size: 17px;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.47; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.field .hint { font-size: 13px; color: var(--fg-3); }
.field [aria-invalid="true"] { border-color: var(--rose); }
.field [aria-invalid="true"]:focus { border-color: var(--rose); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rose) 20%, transparent); }
.field .err { font-size: 13px; color: var(--rose); }

/* Dialog */
.dlg {
    width: min(100% - 32px, 520px); padding: 0; border: 0; border-radius: 24px;
    background: var(--bg-2); color: var(--fg); box-shadow: var(--shadow);
}
.dlg::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.dlg[open] { animation: dlg-in .4s var(--ease-out) both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.dlg-in { position: relative; padding: 40px 36px 32px; }
.dlg-in > p { color: var(--fg-2); }
.dlg-in > * + * { margin-top: 14px; }
.dlg-title { font-size: 28px; line-height: 1.14; letter-spacing: -0.02em; }
.dlg-hint { font-size: 15px; color: var(--fg-3) !important; }
.dlg .btns { margin-top: 24px; }
.dlg-x { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg-3); color: var(--fg-2); }
.dlg-x:hover { color: var(--fg); }
.dlg-foot { margin-top: 26px !important; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; color: var(--fg-3); }
.copy { margin-left: 6px; padding: 2px 10px; border: 1px solid var(--line-2); border-radius: 980px; background: transparent; font-size: 12px; color: var(--fg-2); }

/* Media that grows to the edges as it scrolls in (data-scrub="enter") */
.expand {
    --inset: calc((1 - var(--p, 1)) * 7%);
    --round: calc(var(--radius-lg) * (1 - var(--p, 1)) + 0px);
    clip-path: inset(var(--inset) var(--inset) var(--inset) var(--inset) round var(--round));
}

/* A picture with a caption under it */
.fig figcaption { margin-top: 14px; font-size: 14px; color: var(--fg-3); text-align: center; }

/* App icon */
.app-icon { border-radius: 22.5%; box-shadow: 0 0 0 1px var(--line); }

/* Status dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-right: 8px; }

/* Older markup that still appears in play screens */
.cs-wrap { width: min(100% - 2 * var(--gutter), var(--w-wide)); margin-inline: auto; }

/* "More in Games / Quizzes": a quiet row just before the footer */
.sib { border-top: 1px solid var(--line); }
.sib-in {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px;
    width: min(100% - 2 * var(--gutter), var(--w-chrome)); margin-inline: auto; padding: 26px 0 30px;
}
.sib-h { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--fg-3); }
.sib ul { display: flex; flex-wrap: wrap; gap: 6px 24px; list-style: none; }
.sib li a { display: inline-block; padding: 6px 0; font-size: 15px; color: var(--fg-2); }
.sib li a:hover { color: var(--fg); text-decoration: none; }
.sib .more { margin-left: auto; font-size: 15px; padding: 6px 0; }
@media (max-width: 733px) { .sib .more { margin-left: 0; flex-basis: 100%; } }

/* ── 9. Footer (Apple's: quiet, small, dense) ────────────────────── */
.ft {
    background: var(--bg-alt);
    color: var(--fg-3);
    font-size: 12px; line-height: 1.33; letter-spacing: -0.005em;
}
:root[data-palette="snowy-owl"] .ft { background: #F5F5F7; }
.ft-in { width: min(100% - 2 * var(--gutter), var(--w-chrome)); margin-inline: auto; padding: 22px 0 28px; }
.ft a { color: var(--fg-2); }
.ft a:hover { color: var(--fg); }
.ft-quote { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ft-quote blockquote { margin: 0; }
.ft-quote p { font-size: 14px; line-height: 1.45; color: var(--fg-2); }
.ft-quote figcaption { margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.ft-quote-next { padding: 0; border: 0; background: none; font-size: 12px; color: var(--accent); }
.ft-quote-next:hover { text-decoration: underline; }
.ft-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0; list-style: none; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.ft-crumbs li { display: flex; align-items: center; color: var(--fg-2); }
.ft-crumbs li + li::before {
    content: ""; width: 6px; height: 6px; margin: 0 10px 0 9px;
    border: solid var(--fg-3); border-width: 1px 1px 0 0; transform: rotate(45deg);
}
.ft-crumbs .mark { width: 16px; height: 16px; }
.ft-cols { display: grid; padding: 18px 0 6px; }
.ft-col h2 { font-size: 12px; font-weight: 600; color: var(--fg); }
.ft-col ul { list-style: none; }
.ft-col li { padding: 4px 0; }
.ft-acc summary { list-style: none; display: flex; align-items: center; justify-content: space-between; }
.ft-acc summary::-webkit-details-marker { display: none; }
.ft-acc .chev { display: none; }
@media (min-width: 834px) {
    .ft-cols { grid-template-columns: repeat(4, 1fr); gap: 24px; }
    .ft-acc summary { pointer-events: none; margin-bottom: 8px; }
}
@media (max-width: 833px) {
    .ft-col { border-bottom: 1px solid var(--line); }
    .ft-acc summary { padding: 12px 0; cursor: pointer; }
    .ft-acc .chev { display: block; width: 12px; height: 12px; transform: rotate(90deg); transition: transform .3s var(--ease-out); }
    .ft-acc[open] .chev { transform: rotate(-90deg); }
    .ft-acc ul { padding-bottom: 12px; }
}
.ft-legal { padding-top: 16px; display: grid; gap: 10px; }
.ft-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ft-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-themes button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px 5px 7px; border: 1px solid var(--line); border-radius: 980px;
    background: transparent; font-size: 12px; color: var(--fg-2);
}
.ft-themes button:hover { color: var(--fg); border-color: var(--line-2); }
.ft-themes button[aria-pressed="true"] { color: var(--fg); border-color: var(--fg-3); }

/* ── 10. Motion ──────────────────────────────────────────────────── */
/* Fade up as it comes into view. data-reveal on any element; --d staggers.
   It moves with the translate and scale properties, so an element's own transform
   (a hover lift, a scroll-linked .sc-* helper) keeps working on top of it. */
.js [data-reveal] {
    opacity: 0;
    translate: 0 32px;
    transition: opacity .9s var(--ease) var(--d, 0s), translate 1.1s var(--ease-out) var(--d, 0s), scale 1.1s var(--ease-out) var(--d, 0s);
}
.js [data-reveal="fade"] { translate: none; }
.js [data-reveal="scale"] { translate: none; scale: 0.94; }
.js [data-reveal="left"] { translate: -40px 0; }
.js [data-reveal="right"] { translate: 40px 0; }
.js [data-reveal].is-in { opacity: 1; translate: none; scale: none; }

/* Words that light up one by one as the paragraph scrolls through (data-words) */
.js [data-words] .w { opacity: 0.18; transition: opacity .35s var(--ease); }
.js [data-words] .w.on { opacity: 1; }

/* Scroll-linked helpers: any element under data-scrub gets --p from 0 to 1 */
.sc-rise   { transform: translate3d(0, calc((1 - var(--p, 1)) * 80px), 0); }
.sc-zoom   { transform: scale(calc(0.86 + 0.14 * var(--p, 1))); transform-origin: 50% 100%; }
.sc-shrink { transform: scale(calc(1 - 0.08 * var(--p, 0))); opacity: calc(1 - 0.5 * var(--p, 0)); }
.sc-fade   { opacity: calc(0.15 + 0.85 * var(--p, 1)); }
.sc-drift  { transform: translate3d(0, calc((0.5 - var(--p, 0.5)) * 90px), 0); }
.sc-tilt   { transform: perspective(1600px) rotateX(calc((1 - var(--p, 1)) * 18deg)) scale(calc(0.9 + 0.1 * var(--p, 1))); transform-origin: 50% 0; }
.sc-slide-l { transform: translate3d(calc((1 - var(--p, 1)) * -12%), 0, 0); }
.sc-slide-r { transform: translate3d(calc((1 - var(--p, 1)) * 12%), 0, 0); }
[data-scrub] { will-change: auto; }

/* Pages crossfade into each other where supported */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .js [data-reveal], .js [data-words] .w { opacity: 1 !important; translate: none !important; scale: none !important; }
    .sc-rise, .sc-zoom, .sc-shrink, .sc-fade, .sc-drift, .sc-tilt, .sc-slide-l, .sc-slide-r { transform: none !important; opacity: 1 !important; }
    .expand { clip-path: none !important; }
    .story-frame > * { transition: none; }
    @view-transition { navigation: none; }
}

/* ── 11. Print ───────────────────────────────────────────────────── */
@media print {
    .gn, .ln, .ft, .gallery-nav, .skip { display: none !important; }
    body { background: #fff; color: #000; }
    .js [data-reveal] { opacity: 1; transform: none; }
}
