:root {
  --bg: #f9f9f9;
  --text: #1f1f1f;
  --muted: #7a7a7a;
  --rule: #e6e6e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* One screen, no scrolling: the sky fills it from behind, the panel sits in the middle, and the ground runs
   along the bottom, so rain from a clicked cloud can be watched all the way down to the flowers it waters.
   (On a screen too short for it all, the page grows and scrolls rather than overlap.) */
:root {
  --sky: clamp(88px, 21vh, 260px);        /* sky above the panel's content */
  --ground: clamp(156px, 24vh, 260px);    /* height of the ground band */
}
body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* The sky sits behind the page and scrolls away with it. */
#sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

#content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 628px;
  margin: 0 auto;
  padding: var(--sky) 16px calc(var(--ground) - 24px);   /* the ground's top rows are open air */
}

/* The ground (src/ground.js): pale green tiles with the crayon meadow growing on top. It is see-through
   above the grass, so the sky's rain shows through it. */
#ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: block;
  width: 100%;
  height: var(--ground);
  z-index: 0;
  pointer-events: none;
}

a { color: inherit; }

/* Selected text takes the crayon palette: a mustard highlight with navy ink. */
::selection { background: #f4d27c; color: #2d3a68; }

/* While a press that began outside the text plays with the rain (src/sky.js), dragging across the panel
   doesn't select anything. */
html.playing, html.playing * { -webkit-user-select: none; user-select: none; }

/* The panel holds the tabs and whichever view is open; the sky draws its soft card around it (src/sky.js). */
.panel { position: relative; }
.views { position: relative; }
.view { display: flow-root; }
.view[hidden] { display: none; }
.view > .intro:first-child > :first-child { padding-right: 126px; }   /* the greeting clears the tabs */

/* The greeting (src/hello.js): a big navy "kia ora!" whose letters drop in and wave when hovered, and a crayon
   highlighter swash behind the name. */
.hi { margin: 0 0 14px; font-size: 27px; line-height: 34px; font-weight: 650; letter-spacing: -.025em; color: #2d3a68; cursor: default; }
.hi .ch { display: inline-block; transform-origin: 50% 90%; }
.intro .hi + p { position: relative; z-index: 0; font-size: 16px; }   /* the swash sits under all of this line's text */
.name { position: relative; white-space: nowrap; font-weight: 600; color: #2d3a68; }
.name canvas { position: absolute; z-index: -1; left: -5px; top: 30%; width: calc(100% + 10px); height: 80%; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.intro p:last-child { margin-bottom: 0; }
.soon { color: var(--muted); }

/* Frosted glass tabs, top right of the panel. A frosted track; the selected tab sits under a thick clear lens
   that refracts what's beneath its rim (src/tabs.js draws the refraction map; Chromium bends, other browsers
   blur). The lens slides, squeezes and wobbles between tabs, and can be dragged. */
.tabs {
  position: absolute; z-index: 2; top: -7px; right: -6px;   /* centred on the greeting's line */
  display: flex; gap: 10px; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  box-shadow:
    inset 0 1px 2px rgba(45, 58, 104, .14), inset 0 -1px 0 rgba(255, 255, 255, .8),
    0 0 0 .5px rgba(45, 58, 104, .12), 0 0 0 1px rgba(255, 255, 255, .5),
    0 8px 22px -6px rgba(40, 80, 130, .22);
  touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
.tab {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 46px; height: 40px; padding: 0;
  border: 0; border-radius: 999px; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab:focus-visible { outline: 2px solid #2d3a68; outline-offset: 1px; }
/* hovering a tab raises a faint bubble of frost under it */
.tab::before {
  content: ""; position: absolute; inset: 3px; border-radius: inherit; background: rgba(255, 255, 255, .7);
  box-shadow: 0 0 0 .5px rgba(45, 58, 104, .08);
  opacity: 0; transform: scale(.6); transition: opacity .25s, transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.tab[aria-selected="false"]:hover::before { opacity: 1; transform: none; }
/* hovering a tab floats its doodle up with a springy pop and a soft shadow beneath; pressing squashes it */
.tab .doodle { position: relative; width: 30px; height: 30px; margin: 0; transform-origin: 50% 85%;
  transition: translate .5s cubic-bezier(.3, 1.8, .45, 1), scale .5s cubic-bezier(.3, 1.8, .45, 1), filter .3s; }
.tab .doodle canvas { width: 30px; height: 30px; }
.tab:hover .doodle, .tab:focus-visible .doodle { translate: 0 -2.5px; scale: 1.14; filter: drop-shadow(0 3px 2px rgba(45, 58, 104, .16)); }
.tab:active .doodle { translate: 0 1px; scale: .84 .78; filter: none; transition-duration: .12s; }
.tab .doodle.hop { animation: hop .55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes hop {
  0% { transform: scale(.84, .78); }
  35% { transform: translateY(-5px) scale(.94, 1.1); }
  65% { transform: translateY(0) scale(1.08, .92); }
  100% { transform: none; }
}

.lens { position: absolute; z-index: 2; left: 0; top: 4px; height: 40px; width: 46px; pointer-events: none; will-change: transform, width; }
.lens-body {
  position: absolute; inset: 0; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(.4px) saturate(1.3) brightness(1.05); backdrop-filter: blur(.4px) saturate(1.3) brightness(1.05);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .95),        /* top rim catching the light */
    inset 0 0 0 1px rgba(255, 255, 255, .6),          /* edge of the glass */
    inset 0 -3px 5px rgba(45, 58, 104, .12),          /* thickness at the bottom */
    inset 3px 0 6px -2px rgba(255, 255, 255, .55), inset -3px 0 6px -2px rgba(255, 255, 255, .55),
    0 5px 14px rgba(40, 70, 110, .2), 0 1px 3px rgba(40, 70, 110, .16);
}
/* specular highlight near the top, and a soft caustic glow along the bottom */
.lens-body::before { content: ""; position: absolute; left: 14%; right: 30%; top: 8%; height: 32%; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0)); filter: blur(.5px); }
.lens-body::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 5%; height: 24%; border-radius: 999px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0)); }

/* One little label under the tabs, tinted to match the tab's doodle. It bounces up when you hover a tab and hops
   across, taking the next tab's tint, when you move to the other one. */
.tip {
  --x: 0px; --y: 52px; --w: 60px; --nub: 50%; --tint: #fff;
  position: absolute; z-index: 3; top: var(--y); left: var(--x); width: var(--w);
  padding: 2px 0 3px; border-radius: 999px; text-align: center; pointer-events: none;
  background: var(--tint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 .5px rgba(45, 58, 104, .16), 0 5px 12px -5px rgba(45, 58, 104, .35);
  opacity: 0; transform: translateY(-5px) scale(.5); transform-origin: var(--nub) -6px;
  transition: opacity .15s, transform .25s cubic-bezier(.3, 1.5, .5, 1), left .4s cubic-bezier(.3, 1.4, .5, 1),
    width .4s cubic-bezier(.3, 1.4, .5, 1), background-color .3s;
}
.tip.show { opacity: 1; transform: none; transition: opacity .15s, transform .5s cubic-bezier(.3, 1.8, .5, 1),
  left .4s cubic-bezier(.3, 1.4, .5, 1), width .4s cubic-bezier(.3, 1.4, .5, 1), background-color .3s; }
.tip.snap { transition: opacity .15s, transform .5s cubic-bezier(.3, 1.8, .5, 1), background-color .3s; }
.tip::before {   /* a tiny nub, pointing up at the tab */
  content: ""; position: absolute; top: -3px; left: calc(var(--nub) - 4px); width: 8px; height: 8px; border-radius: 2px 0 0 0;
  background: inherit; transform: rotate(45deg); transition: left .4s cubic-bezier(.3, 1.4, .5, 1);
}
.tip.snap::before { transition: none; }
.tip-text { position: relative; display: inline-block; white-space: nowrap; font-size: 11.5px; font-weight: 600; line-height: 1.3;
  letter-spacing: .01em; color: #2d3a68; }
@media (prefers-reduced-motion: reduce) {
  .tab .doodle, .tab::before, .tip, .tip.show, .tip::before { transition: none; }
  .tab .doodle.hop { animation: none; }
}

.intro p { margin: 0 0 20px; }
.intro a { font-weight: 500; text-underline-offset: 3px; }

.collections { margin-top: 20px; }   /* with the greeting's margin, "kia ora", the line under it and the links sit about evenly apart */
.collections ul { list-style: none; padding: 0; margin: 0; }
/* each row is one link: icon, name, then a leader line that fills in on hover */
.collections li { font-size: 14px; }
.collections li a { display: flex; align-items: center; gap: 14px; padding: 5px 0; text-decoration: none; border-radius: 6px; }
.collections li a:focus-visible { outline: 2px solid #2d3a68; outline-offset: 4px; }

/* Crayon icons beside each link (src/doodles.js). They tip and lift a little on hover. */
.doodle {
  flex: none;
  width: 44px; height: 44px;
  margin: -3px 0 -3px -4px;
  transform-origin: 50% 90%;
  transition: transform .45s cubic-bezier(.3, 1.7, .45, 1);
}
.doodle canvas { display: block; width: 44px; height: 44px; }
.collections li:hover .doodle,
.collections li:focus-within .doodle { transform: translateY(-2px) rotate(-5deg); }
@media (prefers-reduced-motion: reduce) { .doodle { transition: none; } }
.rule { flex: 1; height: 12px; min-width: 24px; }
.rule canvas { display: block; width: 100%; height: 12px; }

