/* PlayMates waitlist page.
   Tokens and component styles come from the PlayMates design system (tokens.json, components/bundle.css).
   Fonts are self-hosted so no visitor data goes to Google (brief: Privacy and consent). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-latin.woff2") format("woff2");
  font-weight: 200 1000; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens (light theme) ---------- */
:root {
  --bg: #fffdfa; --surface: #ffffff; --surface-sunken: #f4eee5;
  --line: #e8e0d4; --line-strong: #8a7d6d;
  --ink: #1d1b1a; --ink-muted: #6b625a; --ink-on-color: #1d1b1a;
  --sky: #9cdee5; --sky-deep: #2599a5;
  --apricot: #fca863; --apricot-deep: #87461b;
  --teal-text: #1a6f78;
  --leaf: #7ccf5b; --leaf-deep: #3f8a2a; --leaf-soft: #e4f6da; --leaf-ink: #245f1e;
  --coral: #ff8a7a; --coral-soft: #ffe5e0; --coral-ink: #a3322a;
  --sun: #ffd24a; --sun-deep: #b8860b;
  --berry: #ff9cc0; --berry-deep: #b8457a;

  --font-display: "Bricolage Grotesque", "Sofia Sans Semi Condensed", system-ui, sans-serif;
  --font-sans: Nunito, ui-rounded, system-ui, sans-serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --radius-sm: 10px; --radius-md: 16px; --radius-lg: 24px; --radius-pill: 999px;

  --edge-apricot: 0 4px 0 #87461b;
  --spring: cubic-bezier(.34, 1.45, .64, 1); /* a small overshoot that settles */
  --smooth: cubic-bezier(.45, 0, .25, 1);    /* one shared ease for lines and sweeps */
  --edge-neutral: 0 4px 0 #e0d6c8;

  --gutter: var(--space-4);
  --content: 1080px;
  color-scheme: light dark;
}

/* ---------- Tokens (dark theme) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a24; --surface: #262533; --surface-sunken: #312f40;
    --line: #42405a; --line-strong: #7d7999;
    --ink: #fbf6ee; --ink-muted: #b9b2a8;
    --teal-text: #8fdbe3;
    --leaf-soft: #24351f; --leaf-ink: #b9ef9f;
    --coral-soft: #3d2422; --coral-ink: #ffb3a8;
    --edge-neutral: 0 4px 0 #15141c;
  }
}

@media (min-width: 768px) { :root { --gutter: var(--space-6); } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 600 17px/26px var(--font-sans);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal-text); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--teal-text); outline-offset: 4px;
}
.wrap { max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.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;
}

/* Display type: Bricolage Grotesque at width 87, weight 600 */
.display, .h2, .title-display {
  font-family: var(--font-display); font-weight: 600;
  font-stretch: 87%; font-variation-settings: "wdth" 87;
  margin: 0; text-wrap: balance;
}
.display { font-size: clamp(40px, 9vw, 56px); line-height: 1; letter-spacing: -0.01em; font-weight: 700; }
.h2 { font-size: 30px; line-height: 34px; }
@media (min-width: 768px) { .h2 { font-size: 36px; line-height: 40px; } }
.title { font: 800 20px/26px var(--font-sans); margin: 0; }
.small { font: 700 14px/20px var(--font-sans); color: var(--ink-muted); }

section { padding: var(--space-16) 0; }

/* ---------- 1. Hero ---------- */
.hero { padding-top: var(--space-8); padding-bottom: 100px; }
.hero__grid { display: grid; gap: var(--space-8); align-items: center; }
.hero__logo { width: 100%; max-width: 180px; height: auto; margin-bottom: var(--space-16); }
@media (max-width: 599px) { .hero__logo { max-width: 108px; } } /* 40% smaller on phones */
.hero__sub { margin: var(--space-4) 0 var(--space-8); max-width: 34em; }
/* Hero option 3: a second headline line */
.hero__tagline {
  margin: var(--space-3) 0 0; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-stretch: 87%; font-variation-settings: "wdth" 87;
  font-size: 26px; line-height: 30px;
}
/* The globe: below the form on phones, beside it from 960px (globe spec: 480–560px wide) */
.hero__art { display: flex; justify-content: center; }
.hero__art pm-globe { width: 100%; max-width: 560px; }
@media (max-width: 599px) { .hero__art pm-globe { width: 85%; } } /* about 15% smaller on phones */
@media (min-width: 960px) {
  .hero { padding-top: var(--space-12); }
  .hero__grid { grid-template-columns: 9fr 11fr; gap: var(--space-12); }
}

/* ---------- Waitlist form ---------- */
.signup { max-width: 480px; }
.hero .signup { max-width: 360px; }
.field-label { display: block; font: 800 15px/22px var(--font-sans); margin-bottom: var(--space-2); }
.signup__row { display: flex; flex-direction: column; gap: var(--space-3); }
.input {
  width: 100%; min-height: 52px; padding: 0 var(--space-4);
  font: 700 17px/1 var(--font-sans); color: var(--ink);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-md);
}
.input::placeholder { color: var(--ink-muted); opacity: 1; }
.input[aria-invalid="true"] { border-color: var(--coral-ink); }
.field-error { margin: var(--space-2) 0 0; font: 700 15px/22px var(--font-sans); color: var(--coral-ink); }
.field-error:empty { display: none; }

/* Primary button: apricot with its solid edge */
.btn {
  font: 900 14px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--radius-md);
  color: var(--ink-on-color); cursor: pointer; margin-bottom: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .08s ease, box-shadow .08s ease, background-color .08s ease;
}
.btn--primary { background: var(--apricot); box-shadow: var(--edge-apricot); }
.btn--primary:hover { background: #f8994c; }
.btn--primary:active { transform: translateY(4px); box-shadow: none; }
.btn[disabled] { background: var(--surface-sunken); color: var(--ink-muted); box-shadow: none; cursor: default; transform: none; }
.signup .btn { width: 100%; margin-top: var(--space-4); }
@media (min-width: 600px) { .signup .btn { width: auto; } }

.consent { margin: 20px 0 0; font-weight: 400; }
.form-error { margin: var(--space-3) 0 0; font: 700 15px/22px var(--font-sans); color: var(--coral-ink); }
.form-error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Success replaces the form in place */
.signup__done {
  display: flex; gap: var(--space-3); align-items: flex-start;
  background: var(--leaf-soft); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-6);
}
/* Once signed up, the panel sizes to its text so the thank-you sits on one line (the hero form itself is narrower). */
.signup:has(.signup__done) { max-width: none; }
.signup__done { width: fit-content; max-width: 100%; }
.signup__done:focus { outline: none; }
.signup__done:focus-visible { outline: 3px solid var(--teal-text); outline-offset: 4px; }
.signup__tick {
  flex: none; width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--leaf);
  display: grid; place-items: center; color: var(--ink-on-color); font: 900 20px/1 var(--font-sans);
}
.signup__done p { margin: 0; }
.signup__done strong { display: block; color: var(--leaf-ink); font: 800 20px/26px var(--font-sans); }

/* ---------- 2. Gameplay: the games library on an iPad ---------- */
.play { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 960px) { .play { grid-template-columns: 5fr 7fr; gap: var(--space-16); } }
.play .h2 { max-width: 12em; }

/* An iPad in landscape: ink bezel, paper screen */
.ipad {
  margin: 0; padding: 14px; background: #1d1b1a; border-radius: 32px; /* the bezel stays dark in dark mode too */
  box-shadow: 0 6px 0 #e0d6c8; rotate: 1.5deg;
}
@media (prefers-color-scheme: dark) { .ipad { box-shadow: 0 6px 0 #0d0c12; }
}
/* On phones it stays landscape: laid out at the desktop size, then shrunk to fit (waitlist.js sets the zoom) */
.ipad.is-fit { width: 640px; max-width: none; }
.ipad.is-fit .lib { grid-template-columns: repeat(3, 1fr); }
.ipad__screen { position: relative; background: #fffdfa; border-radius: 20px; padding: 20px 20px 22px; color: #1d1b1a; }
.ipad__screen::before {
  content: ""; position: absolute; left: 50%; top: -9px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: #6b625a;
}
.lib__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: 16px; }
.lib__title { margin: 0; font: 600 22px/26px var(--font-display); font-variation-settings: "wdth" 87; }
.lib__here { margin: 0; display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-pill); background: #e4f6da; color: #245f1e; font: 800 12px/1 var(--font-sans); white-space: nowrap; }
.lib__here i { width: 8px; height: 8px; border-radius: 50%; background: #7ccf5b; }

.lib { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .lib { grid-template-columns: repeat(3, 1fr); } }
.lib__card { background: #ffffff; border: 2px solid #e8e0d4; border-radius: 16px; padding: 10px 10px 12px; box-shadow: 0 4px 0 #e0d6c8; }
.lib__art { display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 10px; margin-bottom: 10px; }
.lib__art img { width: 46%; height: auto; max-height: 72%; }
.lib__art--letters { background: #fff6d6; grid-template-columns: repeat(3, 22px); grid-auto-rows: 22px; gap: 3px; place-content: center; place-items: stretch; }
.lib__art--letters b { display: grid; place-items: center; background: #ffffff; border: 1.5px solid #1d1b1a; border-radius: 5px; font: 900 12px/1 var(--font-sans); }
.lib__art--letters b:nth-child(-n+3) { background: #ffd24a; }
.pm-tag { display: inline-block; font: 900 12px/1 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: var(--radius-pill); color: #1d1b1a; }
.pm-tag--sky { background: var(--sky); } .pm-tag--apricot { background: var(--apricot); } .pm-tag--sun { background: var(--sun); } .pm-tag--berry { background: var(--berry); }
.lib__card .pm-tag { font-size: 10px; padding: 4px 8px; }
.lib__name { margin: 6px 0 0; font: 800 15px/19px var(--font-sans); }
.lib__meta { margin: 2px 0 0; font: 700 12px/16px var(--font-sans); color: #6b625a; }

/* ---------- Who it's for ---------- */
.who__grid { display: grid; gap: var(--space-8); align-items: center; }
@media (min-width: 960px) { .who__grid { grid-template-columns: 1fr 1fr; gap: var(--space-12); } }
.family, .langs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.family { gap: var(--space-4) var(--space-2); margin-top: var(--space-6); }
.family li { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); width: 64px; font: 700 14px/18px var(--font-sans); text-align: center; }
.who-face { display: block; width: 56px; height: 56px; }
.who-face svg, .who-av svg { display: block; width: 100%; height: 100%; border-radius: var(--radius-pill); outline: 2px solid var(--ink); outline-offset: -1px; }
.langs { gap: var(--space-2); margin-top: var(--space-6); }
.langs li {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px var(--space-3) 6px var(--space-2); border: 2px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); font: 700 15px/20px var(--font-sans);
}
.flag { display: block; width: 24px; height: 16px; }

/* The story card: one family inviting another member and starting a game */
.story { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.story__label { margin: 0 0 var(--space-4); font: 900 13px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.story__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); min-height: 248px; align-content: start; }
.story__row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--bg);
  opacity: 0; translate: 0 8px; transition: opacity .44s ease-out, translate .44s ease-out;
}
.story__row.is-on { opacity: 1; translate: none; }
.story.is-leaving .story__row { opacity: 0; transition-duration: .5s; }
.who-av { position: relative; flex: none; width: 44px; height: 44px; }
.who-av__flag { position: absolute; right: -6px; bottom: -3px; }
.who-av__flag .flag { width: 20px; height: 14px; }
.who-av__online { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: var(--radius-pill); background: var(--leaf); border: 2px solid var(--ink); }
.story__text { flex: 1; min-width: 0; }
.story__text p { margin: 0; line-height: 22px; }
.story__chip { flex: none; font: 900 12px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink); }
.story__chip--online { background: var(--leaf-soft); color: var(--leaf-ink); }
/* The game, as a round home-screen badge with the same plain ink outline as the avatars beside it */
.story__game { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-pill); border: 2px solid var(--ink); }
.story__game img { width: 28px; height: 28px; }
.story__pair { flex: none; display: flex; }
.story__pair .who-av { width: 32px; height: 32px; }
.story__pair .who-av + .who-av { margin-left: -8px; }
.story__dots { display: flex; justify-content: center; gap: 6px; margin-top: var(--space-4); }
.story__dots i { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--line); transition: background .33s ease-out, width .33s ease-out; }
.story__dots i.is-on { width: 18px; background: var(--ink-muted); }
@media (max-width: 420px) {
  .story { padding: var(--space-4); }
  .story__chip { display: none; }
}
@media (prefers-reduced-motion: reduce) { .story__row { opacity: 1; translate: none; } }

/* ---------- Who it's for, second version: family circle + notifications ---------- */
.loose__grid { display: grid; gap: var(--space-8); margin-top: var(--space-8); align-items: start; }
@media (min-width: 960px) { .loose__grid { grid-template-columns: 1fr 1fr; gap: var(--space-12); } }
/* The circles copy: notifications board hidden for now, family centred on its own */
.loose__grid[data-loose="rings"] { grid-template-columns: 1fr; }
.loose__grid[data-loose="rings"] .loose__panel { display: none; }
.loose__grid[data-loose="rings"] .loose__family { max-width: 480px; width: 100%; margin: 0 auto; }
/* Text on the left, the animation on the right */
@media (min-width: 960px) {
  .loose--side .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); align-items: center; }
  .loose--side .loose__grid { margin-top: 0; }
  .loose--side .loose__grid[data-loose="rings"] .loose__family { max-width: none; margin: 0; }
  .loose--side .loose__grid[data-loose="rings"] .loose__circle { max-width: none; }
}
.loose--side .loose__family > .loose__label { display: none; }
/* Invite, accept, play */
.loose__points { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: var(--space-4); counter-reset: step; }
.loose__points li { position: relative; padding-left: 44px; max-width: 34em; color: var(--ink-muted); }
.loose__points li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: var(--radius-pill);
  display: grid; place-items: center; background: var(--sky); color: var(--ink-on-color); font: 900 14px/1 var(--font-sans);
}
.loose__points b { display: block; color: var(--ink); font: 800 18px/26px var(--font-sans); }
.loose__label { margin: 0 0 var(--space-4); font: 900 13px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

/* The family: Mum and Dad in the middle, everyone they add around them */
.loose__circle { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1 / 1; margin: 0 auto; }
.loose__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.loose__lines path { fill: none; stroke: var(--ink-muted); stroke-width: 2.5; stroke-dasharray: 0 7; stroke-linecap: round; opacity: 0; transition: opacity .66s ease-out; }
.loose__lines path.is-on { opacity: 1; }
.loose__lines path.is-on.is-pending { opacity: .45; }   /* invited, not joined yet */
/* The mask that draws each line out from the middle */
.loose__lines .loose__reveal { fill: none; stroke: #fff; stroke-width: 12; stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); opacity: 1; }
.loose__lines .loose__reveal.is-drawn { stroke-dashoffset: 0; transition: stroke-dashoffset 1s var(--smooth); }
.loose__tag {
  position: absolute; translate: -50% -50%; pointer-events: none; /* centred with `translate` so `scale` grows it from its middle */
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: var(--radius-pill); background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink);
  box-shadow: 0 4px 0 var(--line-strong); /* the brand's hard edge */
  opacity: 0; scale: .5; transition: opacity .3s ease-out, scale .5s var(--spring), background-color .33s ease-out, border-color .33s ease-out, color .33s ease-out, box-shadow .33s ease-out;
}
.loose__tag.is-on { opacity: 1; scale: 1; }
.loose__tag svg { width: 30px; height: 30px; }
.loose__tag.is-done { background: var(--leaf-soft); border-color: var(--leaf-deep); color: var(--leaf-ink); box-shadow: 0 4px 0 var(--leaf-deep); animation: pm-pop .45s var(--spring); }
@keyframes pm-pop { from { scale: .8; } to { scale: 1; } } /* the envelope-to-tick swap pops rather than snapping */
/* The game moment (circles copy): a message to the guest, then an iPad on the line while they play */
/* The call: green circles sweep round, a green line fills from each end to meet at the phone */
.loose__ring.loose__green, .loose__halo.loose__halo--green { --arc: 0deg; }
.loose__ring.loose__green {
  border: 3px solid var(--leaf-deep); /* a solid green outline that covers the grey dashes */
  -webkit-mask: conic-gradient(from calc(0deg - var(--arc) / 2), #000 var(--arc), transparent 0);
  mask: conic-gradient(from calc(0deg - var(--arc) / 2), #000 var(--arc), transparent 0);
  transition: none;
}
.loose__ring.loose__green.is-on { --arc: 360deg; transition: --arc .8s var(--smooth); }
.loose__halo.loose__halo--green { border: 3px solid var(--leaf-deep); }
.loose__halo.loose__halo--green { transition: none; }
.loose__person .loose__halo.loose__halo--green.is-on { --arc: 360deg; transition: --arc .8s var(--smooth); }
.loose__lines .loose__greenline {
  fill: none; stroke: var(--leaf-deep); stroke-width: 3.5; stroke-linecap: round; opacity: 1;
  stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len);
}
.loose__lines .loose__greenline.is-on { stroke-dashoffset: var(--half); transition: stroke-dashoffset .8s var(--smooth); } /* animates in only; resets instantly */
/* A finished call fades out before the next one starts */
.loose__halo.loose__halo--green.is-fading, .loose__ring.loose__green.is-fading, .loose__lines .loose__greenline.is-fading { opacity: 0; transition: opacity .4s ease-out; }
.loose__tag--call { background: var(--leaf-soft); border-color: var(--leaf-deep); color: var(--leaf-ink); box-shadow: 0 4px 0 var(--leaf-deep); z-index: 2; }
/* Just the Join call button, centred on the bottom edge of the guest's circle */
.loose__msgbubble {
  position: absolute; z-index: 2; translate: -50% -50%; white-space: nowrap; pointer-events: none;
  opacity: 0; scale: .6; transition: opacity .3s ease-out, scale .5s var(--spring);
}
.loose__msgbubble.is-on { opacity: 1; scale: 1; }
.loose__from { margin: 0; font: 800 12px/16px var(--font-sans); color: var(--ink-muted); }
.loose__say { margin: 2px 0 var(--space-2); font: 800 16px/22px var(--font-sans); }
.loose__call {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-md);
  background: var(--apricot); box-shadow: 0 3px 0 var(--apricot-deep); color: var(--ink-on-color);
  font: 900 12px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase;
  transition: transform .1s ease-out, box-shadow .1s ease-out;
}
.loose__call.is-pressed { transform: translateY(3px); box-shadow: none; }
.loose__playing {
  position: absolute; z-index: 2; width: 128px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transform: translate(-50%, -50%) scale(.7); opacity: 0; transition: opacity .4s ease-out, transform .6s var(--spring); pointer-events: none;
}
.loose__playing.is-on { opacity: 1; transform: translate(-50%, -50%); }
.loose__ipad { display: block; width: 100%; padding: 5px; background: var(--ink); border-radius: 12px; }
/* The game being played, as a round badge of its home-screen art, ringed in the call's green */
.loose__gameart { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-pill); border: 3px solid var(--leaf-deep); box-shadow: 0 4px 0 var(--leaf-deep); }
.loose__gameart img { width: 40px; height: 40px; }
.loose__ipad img { display: block; width: 100%; height: auto; border-radius: 7px; }
.loose__cap { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface); border: 2px solid var(--teal-text); font: 900 11px/1.2 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.loose__grid.is-leaving :is(.loose__msgbubble, .loose__playing) { opacity: 0; }
.loose__grid.is-leaving .loose__tag { opacity: 0; }
/* The circles copy's way out: everything eases out (no spring overshoot), and each account keeps its
   dashed circle while it fades rather than losing it in a snap */
.loose__grid.is-exiting .loose__person { transition: opacity .5s ease-out, transform .5s var(--smooth); }
.loose__grid.is-exiting .loose__person.is-out .loose__halo { --arc: 360deg; }
.loose__grid.is-exiting .loose__playing { transition: opacity .45s ease-out, transform .5s var(--smooth); }
.loose__grid.is-exiting .loose__lines path { transition: opacity .5s ease-out; }
.loose__person {
  position: absolute; width: 96px; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: opacity .44s ease-out, transform .55s var(--spring);
}
.loose__person.is-out { opacity: 0; transform: translate(-50%, -50%) scale(.6); }   /* not added yet */
.loose__person.is-invited { opacity: .4; }                                           /* invited, not joined */
.loose__person.is-dim { opacity: .35; }                                              /* not in this game */
.loose__person.is-active { transform: translate(-50%, -50%) scale(1.08); }
/* In the circles copy the people on a call stay their size, so the lines keep meeting their circles exactly */
.loose__grid[data-loose="rings"] .loose__person.is-active { transform: translate(-50%, -50%); }
.loose__person--home { width: 140px; }
/* A dashed circle round an account (the copy with data-loose="rings"), centred on it */
.loose__halo { position: absolute; left: 50%; top: 50%; width: 124px; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border: 2px dashed var(--line-strong); border-radius: var(--radius-pill); pointer-events: none; }
/* It draws itself in: a sweep that opens both ways round from where the line arrives (--from). */
@property --arc { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
.loose__halo {
  --arc: 360deg;
  -webkit-mask: conic-gradient(from calc(var(--from, 0deg) - var(--arc) / 2), #000 var(--arc), transparent 0);
  mask: conic-gradient(from calc(var(--from, 0deg) - var(--arc) / 2), #000 var(--arc), transparent 0);
  transition: --arc .8s var(--smooth);
}
.loose__person.is-out .loose__halo { --arc: 0deg; transition: none; }
.loose__person--home .loose__name { line-height: 18px; }
.loose__ring { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border: 2px dashed var(--line-strong); border-radius: var(--radius-pill); pointer-events: none; }
.loose__face { position: relative; display: flex; justify-content: center; height: 64px; margin-bottom: 6px; }
.loose__one { display: block; width: 64px; height: 64px; }
.loose__face--pair .loose__one { width: 52px; height: 52px; margin-top: 12px; }
.loose__face--pair .loose__one + .loose__one { margin-left: -14px; }
.loose__face--pair .loose__online { right: calc(50% - 45px); }
.loose__face svg, .loose__icon svg { display: block; width: 100%; height: 100%; border-radius: var(--radius-pill); outline: 2px solid var(--ink); outline-offset: -1px; }
.loose__online { position: absolute; right: calc(50% - 32px); bottom: 1px; width: 16px; height: 16px; border-radius: var(--radius-pill); background: var(--leaf); border: 2.5px solid var(--ink); transform: scale(0); transition: transform .44s ease-out; }
.loose__person.is-online .loose__online { transform: scale(1); }
/* Offline: just the status dot turns grey */
.loose__online { transition: transform .44s ease-out, background-color .5s ease-out; }
.loose__person.is-offline .loose__online { background: var(--line); }
.loose__name { display: inline-flex; align-items: center; gap: 5px; font: 800 15px/19px var(--font-sans); }
.loose__name .flag { width: 16px; height: 11px; }
.loose__role { min-height: 17px; font: 700 12px/17px var(--font-sans); color: var(--ink-muted); }
.loose__role.is-host { color: var(--teal-text); }

/* The notifications */
.loose__panel { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.loose__steps { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-2); }
.loose__steps li {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 6px;
  border: 2px solid var(--line); border-radius: var(--radius-pill); font: 800 14px/1 var(--font-sans); color: var(--ink-muted);
  transition: border-color .33s ease-out, color .33s ease-out, background-color .33s ease-out;
}
.loose__num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--surface-sunken); font-size: 12px; color: var(--ink); transition: background-color .33s ease-out; }
.loose__steps li[hidden] { display: none; }
.loose__steps li.is-done { color: var(--ink); }
.loose__steps li.is-done .loose__num { background: var(--leaf); }
.loose__steps li.is-on { border-color: var(--teal-text); color: var(--ink); }
.loose__steps li.is-on .loose__num { background: var(--sky); }
.loose__feed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); min-height: 328px; align-content: start; }
.loose__note {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
  background: var(--bg); border: 2px solid var(--line); border-radius: var(--radius-md);
  opacity: 0; translate: 0 8px; transition: opacity .44s ease-out, translate .44s ease-out;
}
.loose__note.is-on { opacity: 1; translate: none; }
.loose__grid.is-leaving .loose__note { opacity: 0; transition-duration: .5s; }
.loose__grid.is-leaving .loose__person { opacity: .35; transition-duration: .5s; }
.loose__grid.is-leaving .loose__lines path { opacity: 0; transition-duration: .5s; }
.loose__icon { position: relative; flex: none; min-width: 44px; height: 44px; display: flex; align-items: center; }
.loose__mini { position: relative; display: block; width: 44px; height: 44px; }
.loose__mini svg { display: block; width: 100%; height: 100%; border-radius: var(--radius-pill); outline: 2px solid var(--ink); outline-offset: -1px; }
.loose__stack { display: flex; }
.loose__stack .loose__mini { width: 32px; height: 32px; }
.loose__stack .loose__mini + .loose__mini { margin-left: -10px; }
.loose__stack .loose__dot { width: 11px; height: 11px; }
.loose__icon img { display: block; width: 100%; height: 100%; object-fit: cover; border: 2.5px solid var(--ink); border-radius: 10px; }
.loose__dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: var(--radius-pill); background: var(--leaf); border: 2px solid var(--ink); }
.loose__msg { flex: 1; min-width: 0; }
.loose__title, .loose__body { margin: 0; line-height: 22px; }
.loose__body { font-size: 15px; color: var(--ink-muted); }
.loose__flag .flag { width: 24px; height: 16px; }
.loose__pill { flex: none; font: 900 12px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: var(--radius-pill); background: var(--apricot); color: var(--ink-on-color); box-shadow: 0 3px 0 var(--apricot-deep); transition: background-color .33s ease-out, box-shadow .33s ease-out, color .33s ease-out; }
.loose__pill.is-done { background: var(--leaf-soft); color: var(--leaf-ink); box-shadow: none; }

@media (max-width: 599px) {
  .loose__person { width: 72px; }
  .loose__person--home { width: 104px; }
  .loose__tag { width: 42px; height: 42px; }
  .loose__tag svg { width: 24px; height: 24px; }
  .loose__person--home .loose__name { font-size: 12px; }
  .loose__ring { width: 35%; }
  .loose__face { height: 46px; margin-bottom: 4px; }
  .loose__one { width: 46px; height: 46px; }
  .loose__face--pair .loose__one { width: 38px; height: 38px; margin-top: 8px; }
  .loose__online { right: calc(50% - 23px); }
  .loose__face--pair .loose__online { right: calc(50% - 31px); }
  .loose__name { font-size: 13px; line-height: 16px; }
  .loose__role { font-size: 11px; line-height: 15px; }
  .loose__panel { padding: var(--space-4); }
  .loose__steps li { font-size: 12px; gap: 4px; padding: 0 4px; }
  .loose__num { width: 18px; height: 18px; font-size: 11px; }
  .loose__feed { min-height: 440px; } /* room for all four, so the page below doesn't shift */
  /* The family circles a little smaller, and the rows further apart, so nothing overlaps */
  .loose__circle { aspect-ratio: 4 / 5; }
  .loose__halo { width: 100px; }
  .loose__ring { width: 30%; }
  .loose__face { height: 42px; }
  .loose__one { width: 42px; height: 42px; }
  .loose__face--pair .loose__one { width: 34px; height: 34px; }
  .loose__online { right: calc(50% - 21px); }
  .loose__face--pair .loose__online { right: calc(50% - 28px); }
  .loose__gameart { width: 42px; height: 42px; border-width: 2px; } /* the same size as the call chip */
  .loose__gameart img { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .loose__person, .loose__note, .loose__online, .loose__pill, .loose__steps li, .loose__lines path { transition: none; }
  .loose__lines .loose__reveal.is-drawn { transition: none; }
  .loose__tag, .loose__playing { transition: none; }
  .loose__tag.is-done { animation: none; }
  .loose__green, .loose__lines .loose__greenline { transition: none; }
  .loose__halo { transition: none; }
}

/* ---------- 3. Early learning specialists ---------- */
.card {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-6);
}
@media (min-width: 768px) { .card { padding: var(--space-12); } }
/* Centred, with three rounded chips: a round icon tile, then the words */
.experts { text-align: center; }
.experts .lead { margin-inline: auto; max-width: 38em; }
.experts__chips { list-style: none; margin: var(--space-12) auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); }
.experts__chips li {
  display: inline-flex; align-items: center; gap: var(--space-4); padding: var(--space-2) var(--space-6) var(--space-2) var(--space-2);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-pill); box-shadow: var(--edge-neutral);
  font: 600 22px/26px var(--font-display); font-stretch: 87%; font-variation-settings: "wdth" 87;
}
.experts__chips .calm-tile { width: 64px; height: 64px; margin: 0; }
.experts__chips .calm-tile svg { width: 36px; height: 36px; }

/* ---------- 4. Low-stimulation ---------- */
.lead { margin: var(--space-3) 0 0; font-size: 19px; line-height: 30px; color: var(--ink-muted); max-width: 34em; }
/* Low-stimulation: a band of warm paper with a hand-cut edge and four cards, each with a round
   logo-colour tile holding a black-marker icon (brand: Iconography) */
/* A band: warm paper with a hand-cut wavy edge top and bottom (How it works, Low-stimulation) */
.band { position: relative; background: var(--surface-sunken); margin: var(--space-12) 0; padding: 96px 0; }
.band__wave { position: absolute; left: 0; width: 100%; height: 24px; fill: var(--surface-sunken); }
.band__wave--top { bottom: calc(100% - 1px); }
.band__wave--bottom { top: calc(100% - 1px); rotate: 180deg; }
.calm-band { text-align: center; padding-block: 136px; }
.calm-band .lead { margin-inline: auto; }
.calm-grid { list-style: none; margin: var(--space-12) 0 0; padding: 0; display: grid; gap: var(--space-6) var(--space-4); text-align: left; }
.calm-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--edge-neutral); }
/* A round tile in a logo colour with a slight hand-placed tilt */
.calm-tile {
  position: relative; display: grid; place-items: center; width: 88px; height: 88px; margin: 4px 0 var(--space-6);
  border-radius: var(--radius-pill); color: var(--ink-on-color);
}
.calm-tile svg { width: 48px; height: 48px; stroke-width: 3.4; }
.calm-tile--sky { background: var(--sky); }
.calm-tile--apricot { background: var(--apricot); }
.calm-tile--tilt-l { rotate: -3deg; }
.calm-tile--tilt-r { rotate: 2.5deg; }
.calm-card__title { margin: 0 0 var(--space-2); font: 600 22px/26px var(--font-display); font-stretch: 87%; font-variation-settings: "wdth" 87; }
.calm-card p { margin: 0; font-size: 17px; font-weight: 600; line-height: 25px; color: var(--ink-muted); }
@media (min-width: 640px) { .calm-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .calm-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 5. Every culture ---------- */
.cultures { display: grid; gap: var(--space-8); align-items: center; }
.cultures p { margin: var(--space-3) 0 0; max-width: 30em; font-size: 19px; line-height: 30px; }
@media (min-width: 768px) { .cultures { grid-template-columns: 1fr 1fr; gap: var(--space-12); } }
.hellos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hellos li {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2); font-size: 19px;
}
.hellos li:nth-child(odd) { transform: rotate(-2deg); }
.hellos li:nth-child(3n) { transform: rotate(2deg); }
.hellos i { width: 32px; height: 32px; border-radius: var(--radius-pill); flex: none; }

/* ---------- 6. Questions ---------- */
/* Each question opens on its own; a plus turns into a minus */
.faq { display: grid; gap: var(--space-8); justify-items: center; text-align: center; }
.faq__list { display: grid; gap: var(--space-3); width: 100%; max-width: 760px; text-align: left; }
.faq__item { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-md); }
.faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) var(--space-6); cursor: pointer; list-style: none;
  font-size: 19px; font-weight: 800; line-height: 26px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--radius-pill); background: var(--sky); color: var(--ink-on-color);
  font: 600 24px/1 var(--font-sans);
}
.faq__item[open] summary::after { content: "\2212"; background: var(--apricot); }
.faq__item summary:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; border-radius: var(--radius-md); }
.faq__item p { margin: 0; padding: 0 var(--space-6) var(--space-6); font-size: 17px; line-height: 27px; color: var(--ink-muted); max-width: 40em; }


/* ---------- 7. Footer ---------- */
/* The footer sits on the same paper band, with only the top edge cut */
.footer.band { margin: var(--space-16) 0 0; padding: 128px 0 var(--space-12); }
/* The second sign-up opens the footer, above a line; the logo, links and credits sit below it */
.footer__signup {
  display: grid; gap: var(--space-6); align-items: start;
  position: relative; padding-bottom: 96px; margin-bottom: var(--space-8);
}
.footer__signup::after { /* the dividing line, as wide as the content */
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; height: 2px; background: var(--line);
}
@media (min-width: 960px) { .footer__signup { grid-template-columns: 1fr 1fr; } }
.footer__signup .btn[disabled] { background: var(--surface); } /* the usual disabled fill is the band's own colour */
.footer--doc.band { padding-top: var(--space-16); } /* the privacy, terms and credits pages: no sign-up above the base */
.footer__base { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; }
.footer__base img { width: 120px; height: auto; }
.footer__base p { margin: 0; }
.footer__base a { color: var(--ink-muted); }
.footer__base .credits { flex-basis: 100%; font-size: 12px; line-height: 18px; } /* image credits, on their own line */

/* ---------- Gentle entry motion (only with JS, only without reduced motion) ----------
   Brand motion: ~330ms eased fades, an 8px rise, no bounce. `translate` is used rather than
   `transform` so tilted items (the hello chips) keep their rotation. */
@media (prefers-reduced-motion: no-preference) {
  /* Hero: each part follows the one before it on load */
  @keyframes pm-enter { from { opacity: 0; translate: 0 8px; } }
  .js .hero__logo, .js .hero h1, .js .hero__tagline, .js .hero__sub, .js .hero .signup, .js .hero__art {
    animation: pm-enter .33s ease-out both;
    animation-delay: calc(var(--i, 0) * 99ms);
  }
  .js .hero h1 { --i: 1; }
  .js .hero__tagline { --i: 2; }
  .js .hero__sub { --i: 2; }
  .js .hero .signup { --i: 3; }
  .js .hero__art { --i: 4; animation-duration: .66s; }

  /* Sections fade in as they reach the screen */
  .js .fade { opacity: 0; translate: 0 8px; transition: opacity .33s ease-out, translate .33s ease-out; }
  .js .fade.is-in { opacity: 1; translate: none; }

  /* ...and the items inside them follow one after another */
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li {
    opacity: 0; translate: 0 8px;
    transition: opacity .33s ease-out, translate .33s ease-out;
  }
  .js .fade.is-in :is(.lib, .calm-grid, .hellos, .family, .langs) > li { opacity: 1; translate: none; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(1) { transition-delay: 132ms; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(2) { transition-delay: 198ms; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(3) { transition-delay: 264ms; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(4) { transition-delay: 330ms; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(5) { transition-delay: 396ms; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(6) { transition-delay: 462ms; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(7) { transition-delay: 528ms; }
  .js .fade :is(.lib, .calm-grid, .hellos, .family, .langs) > li:nth-child(8) { transition-delay: 594ms; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Privacy page ---------- */
.doc { max-width: 680px; padding: var(--space-8) 0 var(--space-12); }
.doc h1 { margin: var(--space-8) 0 var(--space-4); }
.doc h2 { font: 800 20px/26px var(--font-sans); margin: var(--space-8) 0 var(--space-2); }
.doc p, .doc li { margin: 0 0 var(--space-3); }
.doc ul { padding-left: 1.2em; }

/* ---------- 404: "This piece is missing" ---------- */
body:has(> .nf) { min-height: 100vh; display: flex; flex-direction: column; } /* footer at the bottom of the window */
.nf { flex: 1; width: 100%; display: flex; flex-direction: column; padding-block: var(--space-8) var(--space-12); }
.nf__logo { align-self: flex-start; } /* top left, where it sits on the other pages */
.nf__body { flex: 1; display: grid; align-content: center; justify-items: center; text-align: center; }
.nf__tiles { display: flex; gap: clamp(12px, 3vw, 24px); margin: var(--space-12) 0 var(--space-8); }
.nf__tile, .nf__slot { width: clamp(80px, 22vw, 120px); aspect-ratio: 1; border-radius: 14px; }
.nf__tile {
  display: grid; place-items: center; border: 5px solid; color: var(--ink-on-color);
  font: 700 clamp(48px, 13vw, 76px)/1 var(--font-display); font-stretch: 87%; font-variation-settings: "wdth" 87;
}
.nf__tile--sky { background: var(--sky); border-color: var(--sky-deep); box-shadow: 7px 8px 0 var(--sky-deep); }
.nf__tile--apricot { background: var(--apricot); border-color: var(--apricot-deep); box-shadow: 7px 8px 0 var(--apricot-deep); }
.nf__tiles > .nf__tile:first-child { rotate: -3deg; }
.nf__tiles > .nf__tile:last-child { rotate: 2.5deg; }
/* The empty place the 0 slipped out of, and the 0 itself, only just out of place */
.nf__slot { position: relative; border: 3px dashed var(--line-strong); }
.nf__tile--loose { position: absolute; inset: -5px; translate: 6% 10%; rotate: 6deg; animation: nf-wobble 6s ease-in-out infinite; }
@keyframes nf-wobble { 50% { rotate: 3deg; translate: 5% 8%; } }
@media (prefers-reduced-motion: reduce) { .nf__tile--loose { animation: none; } }
.nf__title { margin: var(--space-12) 0 var(--space-3); }
.nf__lead { max-width: 30em; margin: 0 0 var(--space-8); }
.nf__actions { display: flex; flex-direction: column; gap: var(--space-4); align-items: center; }
.nf__actions .btn { text-decoration: none; }
.nf__link { font-weight: 800; color: var(--ink); }
