/* SillyLearn: Gus the goose and the wordmark. Pure CSS, no images. Light mode only.

   Uses the token names from docs/redesign/tokens.css (--card, --ink, --sun, ...) when the page has them, and the
   same hex values as fallbacks when it doesn't, so this file also works on its own.

   ---- GUS -------------------------------------------------------------------------------------------------
   Paste this markup. Gus is decorative (his page already says what it needs to), so he is hidden from screen readers.

     <span class="gus" aria-hidden="true"><span class="g-tuft"></span><span class="g-head"></span><span class="g-cheek"></span><span class="g-cheek g-r"></span><span class="g-eye"></span><span class="g-eye g-r"></span><span class="g-beak"></span></span>

   Size: Gus is a square. Set `font-size` on him (or on a parent), or set `--gus-size` (any length) on .gus or
   a parent. Everything inside scales with it, from 24px to 220px and beyond.
       <span class="gus" style="--gus-size:96px" ...>

   Modifiers go on .gus (combine one of each group):
     stage      (none = Gus the goose)  .gus--gosling  .gus--egg
     mood       (none = happy)          .gus--wow (a win)  .gus--wink (home greeting)  .gus--sleepy (waiting, queued)
     accessory  (none)                  .gus--crown  .gus--rainbow  .gus--partyhat     (worn when a child picks that magic)
   The egg has no face, so mood and accessory do nothing on it.

   Level picker (replaces the three emoji): Little = egg, Middle = gosling, Big = Gus. Ages are small captions.
       <span class="gus-level">
         <span class="gus-pick"><span class="gus gus--egg" aria-hidden="true">...same seven spans...</span></span>
         <span class="gus-cap">Little<small>ages 2 to 3</small></span>
       </span>
   .is-on is a visual state only: pair it with aria-checked (role="radio", named with aria-labelledby pointing at the
   .gus-cap id, since Gus is aria-hidden) or aria-pressed. The page also provides the focus style for .gus-pick.
   The same seven spans go inside every .gus, whatever the stage.

   Rules for Gus (from the redesign): he reacts, never asks. He never begs a child to keep playing, never looks
   sad when they leave, isn't a prize, and doesn't talk. So: no sad mood, no speech bubbles, no "come back" copy.

   ---- WORDMARK ----------------------------------------------------------------------------------------------
   Lowercase "sillylearn" in Jost 800, -3.5% tracking. The i is a dotless ı with a Sun circle for its dot. The
   wrapper carries the accessible name; the pieces inside are hidden from screen readers.

     <span class="wordmark" role="img" aria-label="SillyLearn">s<span class="wm-i" aria-hidden="true">ı<span class="wm-dot"></span></span>llylearn</span>

   Size it with font-size. Needs the Jost font (weight 800) loaded by the page.

   Header lockup (Gus 40px + wordmark 30px):

     <a class="lockup" href="/"><span class="gus" aria-hidden="true">...</span><span class="wordmark" role="img" aria-label="SillyLearn">...</span></a>
*/

.gus {
  --u: calc(var(--gus-size, 1em) / 180);                 /* one design pixel of the 180px reference */
  --gus-head: var(--card, #FFFDF8);
  --gus-ink: var(--ink, #23243A);
  --gus-beak: var(--apricot, #EC8D38);
  --gus-beak-d: var(--apricot-d, #954D18);
  --gus-cheek: #F6B8C9;
  --gus-gold: var(--sun, #FCBF3C);
  --gus-gold-d: var(--sun-d, #9D6810);
  position: relative;
  display: inline-block;
  flex: none;
  vertical-align: middle;
  width: var(--gus-size, 1em);                      /* the page sets --gus-size, or just the font-size */
  height: var(--gus-size, 1em);
  line-height: 0;
  isolation: isolate;
}
.gus > span { position: absolute; display: block; box-sizing: border-box; }

/* the head, the tuft, the cheeks */
.g-head {
  inset: 0; border-radius: 50%; background: var(--gus-head);
  box-shadow: inset 0 calc(var(--u) * -4) 0 rgba(35, 36, 58, .06), 0 calc(var(--u) * 6) calc(var(--u) * 14) calc(var(--u) * -8) rgba(35, 36, 58, .5);
}
.g-tuft {
  left: 43%; top: -8%; width: 15%; height: 22%; border-radius: 50%; background: var(--gus-head);
  transform: rotate(-24deg); box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 6) calc(var(--u) * -3) rgba(35, 36, 58, .35);
}
.g-cheek { left: 10%; top: 55%; width: 16%; height: 10%; border-radius: 50%; background: var(--gus-cheek); }
.g-cheek.g-r { left: 74%; }

/* eyes: open, with a shine */
.g-eye { left: 26%; top: 32%; width: 14%; height: 16%; border-radius: 50%; background: var(--gus-ink); }
.g-eye.g-r { left: 60%; }
.g-eye::after { content: ""; position: absolute; left: 22%; top: 16%; width: 36%; height: 32%; border-radius: 50%; background: var(--card, #FFFDF8); }

/* the beak: a smile */
.g-beak {
  left: 31%; top: 52%; width: 38%; height: 17%; border-radius: 999px; background: var(--gus-beak);
  box-shadow: inset 0 calc(var(--u) * -3) 0 rgba(149, 77, 24, .35);
}

/* moods */
.gus--wow .g-beak { left: 39%; top: 52%; width: 22%; height: 22%; border-radius: 50%; box-shadow: none; }
.gus--wow .g-beak::after { content: ""; position: absolute; inset: 26%; border-radius: 50%; background: var(--gus-beak-d); }
.gus--wink .g-eye.g-r,
.gus--sleepy .g-eye { left: 24%; top: 40%; width: 18%; height: 5%; border-radius: 999px; }
.gus--wink .g-eye.g-r,
.gus--sleepy .g-eye.g-r { left: 58%; }
.gus--wink .g-eye.g-r::after,
.gus--sleepy .g-eye::after { display: none; }

/* gosling: a smaller, yellower Gus */
.gus--gosling { --gus-head: #FBE08C; }
.gus--gosling .g-head { box-shadow: inset 0 calc(var(--u) * -4) 0 rgba(157, 104, 16, .16), 0 calc(var(--u) * 6) calc(var(--u) * 14) calc(var(--u) * -8) rgba(35, 36, 58, .5); }
.gus--gosling .g-tuft { box-shadow: none; }

/* egg: no face, just the shell (Little) */
.gus--egg .g-tuft, .gus--egg .g-cheek, .gus--egg .g-eye, .gus--egg .g-beak { display: none; }
.gus--egg .g-head {
  inset: 0 auto 0 10.9%; width: 78.3%; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  box-shadow: inset calc(var(--u) * -4) calc(var(--u) * -6) 0 rgba(35, 36, 58, .08), 0 calc(var(--u) * 4) calc(var(--u) * 10) calc(var(--u) * -4) rgba(35, 36, 58, .5);
}

/* accessories ride on the .gus pseudo-elements, so there is no extra markup */
.gus--crown::before, .gus--crown::after, .gus--partyhat::before, .gus--partyhat::after, .gus--rainbow::before {
  content: ""; position: absolute; z-index: 1; display: block;
}
/* crown: band (::before) and three points (::after: one circle plus two box-shadow copies) */
.gus--crown::before {
  left: 27%; top: -10%; width: 46%; height: 15%; background: var(--gus-gold);
  border-radius: calc(var(--u) * 4) calc(var(--u) * 4) calc(var(--u) * 7) calc(var(--u) * 7);
  box-shadow: inset 0 calc(var(--u) * -3) 0 rgba(157, 104, 16, .35);
}
.gus--crown::after {
  left: 28%; top: -17%; width: 13%; height: 13%; border-radius: 50%; background: var(--gus-gold);
  box-shadow: calc(var(--u) * 27.9) calc(var(--u) * -7.2) 0 var(--gus-gold), calc(var(--u) * 55.8) 0 0 var(--gus-gold);
}
/* rainbow: behind the head */
.gus--rainbow::before {
  z-index: -1; left: -2%; top: -31%; width: 104%; height: 52%;
  background: radial-gradient(ellipse 50% 100% at 50% 100%, transparent 0 47%, var(--cobalt, #4175DA) 47% 57%, var(--meadow, #48A059) 57% 67%, var(--sun, #FCBF3C) 67% 77%, var(--tomato, #E3634A) 77% 87%, transparent 87%);
}
/* party hat: cone and pom-pom */
.gus--partyhat::before { left: 35%; top: -34%; width: 30%; height: 40%; background: var(--rose, #DC6292); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.gus--partyhat::after { left: 44.5%; top: -41%; width: 11%; height: 11%; border-radius: 50%; background: var(--gus-gold); }

/* ---- level picker ---- */
.gus-level { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.gus-pick {
  display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  background: var(--card, #FFFDF8); box-shadow: 0 6px 0 rgba(35, 36, 58, .16);
}
.gus-pick .gus { --gus-size: 56px; }
.gus-pick .gus--gosling { --gus-size: 44px; }
.gus-pick .gus--egg { --gus-size: 46px; }
.gus-pick.is-on, .gus-pick[aria-checked="true"] { box-shadow: 0 0 0 4px var(--card, #FFFDF8), 0 0 0 8px var(--cobalt, #4175DA); }
.gus-cap { font: 600 14px/1.25 var(--font-play, "Jost", "Trebuchet MS", system-ui, sans-serif); text-align: center; color: var(--ink, #23243A); }
.gus-cap small { display: block; font-weight: 500; color: var(--ink-2, #58596D); }

/* ---- wordmark ---- */
.wordmark {
  display: inline-block; font: 800 1em/.9 var(--font-play, "Jost", "Trebuchet MS", system-ui, sans-serif);
  letter-spacing: -.035em; color: var(--ink, #23243A); white-space: nowrap;
}
.wm-i { position: relative; display: inline-block; }
.wm-dot { position: absolute; left: 50%; top: .03em; width: .2em; height: .2em; margin-left: -.1em; border-radius: 50%; background: var(--sun, #FCBF3C); }

/* lockup: Gus 40px + wordmark 30px */
.lockup { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap-grown, 48px); text-decoration: none; color: inherit; }
.lockup .gus { --gus-size: 40px; }
.lockup .wordmark { font-size: 30px; }

/* Windows high-contrast: keep the dot's colour */
@media (forced-colors: active) { .wm-dot { forced-color-adjust: none; } }
