@font-face {
  font-family: Raleway;
  src: url("assets/raleway-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Raleway;
  src: url("assets/raleway-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Registered so palette recolors can transition smoothly. */
@property --ink { syntax: '<color>'; inherits: true; initial-value: #525bff; }
@property --soft { syntax: '<color>'; inherits: true; initial-value: #e0e2fe; }
@property --background { syntax: '<color>'; inherits: true; initial-value: #f2f3ff; }

:root {
  transition: --ink 700ms ease, --soft 700ms ease, --background 700ms ease;
  --ink: #525bff;
  --background: #f2f3ff;
  --soft: #e0e2fe;
  color: var(--ink);
  background: var(--background);
  font-family: Raleway, Arial, sans-serif;
  font-weight: 500;
}

@font-face {
  font-family: Windward;
  src: url("assets/windward.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
body, h1, h2, p, ul { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.site {
  container-type: inline-size;
  max-width: 1680px;
  margin-inline: auto;
}

.nav-bar, .hero, main, .footer {
  --u: calc(100cqw / 1440);
  --edge: calc(32 * var(--u));
  --gap: calc(16 * var(--u));
}

.hero {
  position: relative;
  height: calc(590 * var(--u));
}

/* Sticky menu: a zero-height bar so it overlays the hero instead of pushing it
   down, and stays stuck for the whole page (its containing block is .site). */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 0;
}

.nav {
  display: flex;
  pointer-events: none;
  justify-content: space-between;
  padding: calc(31 * var(--u)) var(--edge) 0;
}

.nav .pill { pointer-events: auto; }

.nav-actions {
  display: flex;
  gap: calc(16 * var(--u));
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--ink);
  border: 0;
  padding: calc(9 * var(--u, 1px)) calc(28 * var(--u, 1px));
  border-radius: 100px;
  font-size: calc(24 * var(--u, 1px));
  line-height: calc(26 * var(--u, 1px));
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.pill-primary { background: var(--ink); color: white; }
.pill:hover { filter: brightness(0.94); }

.dragonfly {
  position: absolute;
  left: calc(149.5 * var(--u));
  top: calc(91 * var(--u));
  width: calc(364.95 * var(--u));
  transform: rotate(3.94deg);
}

.hero-title {
  position: absolute;
  left: calc(32.32 * var(--u));
  top: calc(184.03 * var(--u));
  width: calc(1374.04 * var(--u));
}

.hero-title img { width: 100%; }
main { position: relative; }

.panel {
  background: white;
  border-radius: calc(40 * var(--u));
  padding: calc(50 * var(--u)) var(--edge);
}

.statement {
  margin-inline: var(--edge);
  margin-bottom: var(--gap);
  min-height: calc(314 * var(--u));
}

.statement h2, .feature-label {
  font-size: calc(24 * var(--u));
  line-height: calc(26 * var(--u));
  letter-spacing: 0.01em;
  font-weight: 500;
}

.statement p {
  margin-top: calc(44 * var(--u));
  font-size: calc(46 * var(--u));
  line-height: calc(48 * var(--u));
  letter-spacing: -0.02em;
}

.about { min-height: calc(410 * var(--u)); }
#about, #contacts { scroll-margin-top: clamp(64px, 6.5vw, 110px); }

.feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  position: relative;
  padding-inline: var(--edge);
  margin-bottom: var(--gap);
}

.feature-card {
  min-height: calc(754 * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(34 * var(--u));
}

.feature:nth-of-type(1) { margin-bottom: calc(17 * var(--u)); }

.feature-right .feature-card { grid-column: 2; }

.feature-label {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.feature-content { display: grid; gap: calc(32 * var(--u)); }
.lettering {
  position: relative;
  height: calc(var(--title-height, 140) * var(--u));
}
.lettering :is(img, svg) {
  position: absolute;
  left: calc(var(--title-x) * var(--u));
  top: calc(var(--title-y) * var(--u));
  width: calc(var(--title-width) * var(--u));
}
.school-title {
  font-family: Windward, Raleway, sans-serif;
  font-size: calc(76 * var(--u));
  font-weight: 400;
  line-height: calc(70 * var(--u));
  letter-spacing: -0.01em;
}
.homework-title { --title-x: -4.56; --title-y: 7.24; --title-width: 448.78; }
.lunch-title { --title-x: -3.5; --title-y: 0.55; --title-width: 446.69; }
.activities-title { --title-x: -3.57; --title-y: 6.78; --title-width: 384.62; }
.holidays-title { --title-x: -2.05; --title-y: 7.16; --title-width: 430.73; --title-height: 70; }

.feature-copy {
  font-size: calc(28 * var(--u));
  line-height: calc(30 * var(--u));
  letter-spacing: 0.01em;
}

.feature-copy > * + * { margin-top: 1.08em; }
.school-list { padding-inline-start: 1.5em; }
.school-list li + li { margin-top: 1.08em; }

.art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: clip;
}

.art-piece {
  position: absolute;
  left: calc(var(--art-pad, 0px) + (var(--x) - var(--art-x, 0)) * var(--art-unit, var(--u)));
  top: calc((var(--y) - var(--art-y, 0)) * var(--art-unit, var(--u)));
  width: calc(var(--w) * var(--art-unit, var(--u)));
  max-width: none;
  transform: translate(-50%, -50%) rotate(var(--turn, 0deg));
}

.dog-orange { --x: 1051; --y: 260.09; --w: 309.93; --turn: -1.61deg; }
.dog-gray { --x: 990.95; --y: 555.07; --w: 419.94; --turn: 4.56deg; }
.dog-white { --x: 729.26; --y: 184.76; --w: 267.36; --turn: 6.02deg; }
.dog-brown { --x: 1210.58; --y: 327.2; --w: 337.4; --turn: -1.21deg; }
.protractor { --x: 182.23; --y: 191.64; --w: 301.97; --turn: -25.08deg; }
.palette { --x: 476.41; --y: 379.88; --w: 418.84; --turn: -1.3deg; }
.ruler { --x: 280.25; --y: 503.15; --w: 466.22; }
.mug { --x: 1266.81; --y: 278.97; --w: 219.32; --turn: -6.79deg; }
.pot { --x: 869.92; --y: 308.75; --w: 501.84; }
.bun { --x: 1210.78; --y: 504.11; --w: 221.99; --turn: 94.25deg; }
.sun { --x: 268.63; --y: 296.17; --w: 440; --turn: -16.15deg; }
.cloud-large { --x: 461.12; --y: 496.37; --w: 469.91; }
.cloud-small { --x: 354.68; --y: 572.39; --w: 251.5; }
.flowers { --x: 1059.5; --y: 399.14; --w: 556; }

.signup {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: start;
  min-height: calc(491 * var(--u));
  margin-top: calc(-16 * var(--u));
  padding-top: calc(325 * var(--u));
}

.rabbit {
  position: absolute;
  top: calc(135.5 * var(--u));
  left: calc(627.5 * var(--u));
  width: calc(209.26 * var(--u));
}

.signup .pill { z-index: 1; }

.footer {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap) var(--edge) calc(82 * var(--u));
  line-height: calc(30 * var(--u));
  font-size: calc(24 * var(--u));
  letter-spacing: -0.01em;
}

.footer-wordmark {
  font-family: Windward, Raleway, sans-serif;
  font-weight: 400;
  font-size: calc(52 * var(--u));
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin-bottom: calc(27 * var(--u));
}

.footer-contact { grid-column: 3; align-self: end; font-size: calc(26 * var(--u)); }

.footer-contact a { overflow-wrap: anywhere; }
.footer-contact a:not(:hover, :focus-visible) { text-decoration: none; }

.signup-dialog {
  width: min(90vw, 420px);
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  padding: 28px;
}

.signup-dialog::backdrop { background: #181e69a0; }
.signup-dialog p { margin: 16px 0 24px; }
.signup-dialog .pill { font-size: 16px; }

@media (max-width: 760px) {
  .nav-bar, .hero, main, .footer { --edge: 14px; --gap: 14px; }
  .hero { height: calc(62px + 38cqw); }
  .nav { padding-top: 14px; gap: 8px; }
  .nav-actions { gap: 7px; }
  .pill { padding: 8px clamp(9px, 3vw, 22px); font-size: 14px; line-height: 20px; }
  .dragonfly { left: 10%; top: calc(48px + 2.5cqw); width: 27%; }
  .hero-title { top: calc(53px + 10cqw); left: 3%; width: 94%; }
  .panel { border-radius: 26px; padding: 28px 20px; }
  .statement, .about { min-height: auto; }
  .statement h2, .feature-label { font-size: 16px; line-height: 1.25; }
  .statement p { margin-top: 23px; font-size: clamp(23px, 5.6vw, 37px); line-height: 1.1; }
  .feature { display: flex; flex-direction: column; gap: 0; }
  .feature:nth-of-type(1) { margin-bottom: var(--gap); }
  .feature-card { min-height: auto; gap: 33px; }
  .feature-content { gap: 20px; }
  .school-title { font-size: clamp(44px, 13.68vw, 70px); line-height: 0.92; }
  .lettering { height: auto; }
  .lettering :is(img, svg) { position: static; width: calc(var(--title-width) * clamp(0.58px, 0.18vw, 0.92px)); }
  .feature-copy { font-size: clamp(17px, 4.2vw, 24px); line-height: 1.22; }
  .desktop-break { display: none; }
  .art {
    --art-unit: calc((100cqw - 28px) / var(--art-grid, 810));
    --art-pad: var(--edge);
    position: relative;
    height: calc(var(--art-height) * var(--art-unit));
    /* Bleed to the viewport edge so pieces clip there, not at the gutter. */
    margin-inline: calc(-1 * var(--edge));
  }
  .school-art { --art-grid: 850; --art-x: 555; --art-y: 60; --art-height: 655; }
  .homework-art { --art-x: -4; --art-y: 32; --art-height: 665; }
  .lunch-art { --art-x: 585; --art-y: 62; --art-height: 610; }
  .activities-art { --art-x: -46; --art-y: -10; --art-height: 752; }
  .holidays-art { --art-x: 660; --art-y: 100; --art-height: 600; }
  .signup { min-height: auto; margin: 0; padding: 100px 0 64px; }
  .rabbit { width: 105px; left: calc(50% - 51px); top: 4px; }
  .footer { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 15px; line-height: 1.3; padding-bottom: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-wordmark { font-size: min(26px, calc((100cqw - 28px) / 12)); margin-bottom: 8px; }
  .footer-contact { grid-column: 1 / -1; font-size: inherit; }
}

/* ---------- Playful layer (play.js) ---------- */

svg.toy-svg { height: auto; overflow: visible; }
/* Art pieces: the holder keeps the layout centering transform; the SVG inside
   moves/tilts around its own centre so the grab point stays under the cursor. */
span.art-piece { display: block; }
span.art-piece > svg.toy-svg, .dog-walk > svg.toy-svg { width: 100%; }
/* Dogs walk on a scroll-driven timeline (keyframes generated in play.js). */
.dog-walk { display: block; }
@supports (view-timeline-name: --school-walk) and (animation-range: cover calc(50% - 100dvh) cover calc(50% + 100dvh)) {
  @media (prefers-reduced-motion: no-preference) {
    .school-art { view-timeline: --school-walk; }
    .dog-walk {
      animation-duration: auto;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --school-walk;
      animation-range: cover calc(50% - 100dvh) cover calc(50% + 100dvh);
    }
  }
}
.art, .toy { -webkit-user-select: none; user-select: none; }
.toy { pointer-events: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.toy * { pointer-events: visiblePainted; }
.toy .steam, .toy .steam * { pointer-events: none; }
.grabbable { cursor: grab; transition: scale 200ms cubic-bezier(.2, .8, .2, 1), filter 200ms ease; }
.grabbable:hover, .grabbable.is-held { will-change: translate, rotate; }
/* Subtle lift shadow; it's rasterised into the will-change layer once, so
   moving the piece doesn't recompute it. */
.grabbable.is-held { cursor: grabbing; scale: 1.05; filter: drop-shadow(0 12px 10px color-mix(in srgb, var(--ink) 18%, transparent)); }
.over-paint:not(.is-held) { cursor: pointer; }
.art.is-loose { overflow: visible; }
/* Particles, bubbles and thrown pieces clip at the page edges instead of
   growing the scrollable area. body clips itself (not via the viewport, since
   html isn't overflow: visible), and is the containing block for .blob/.bubble. */
html { overflow-x: clip; }
body { position: relative; overflow: clip; }

.hero-title svg { width: 100%; height: auto; overflow: visible; }
:where(.site) svg { display: block; }
.hero-title .letter { cursor: pointer; }
.dragonfly.toy { z-index: 1; will-change: translate, rotate; }
.flowers .bloom { cursor: pointer; }
.steam path { fill: none; stroke: color-mix(in oklab, var(--ink) 32%, white); stroke-width: 7; stroke-linecap: round; pointer-events: none; }

.bubble {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  padding: 8px 16px;
  border-radius: 999px 999px 999px 6px;
  background: white;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(16px, 1.6vw, 24px);
  white-space: nowrap;
  box-shadow: 0 0 0 3px var(--ink);
}

.blob { position: absolute; z-index: 20; pointer-events: none; }

.pill { transition: transform 160ms ease, filter 160ms ease; }
.pill:active { transform: scale(.95); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
