/* Mallow's website. Every page shares this: the main page (a rolling title, a wheel of
   his colours, the download), the features page and the privacy page. The sky behind
   everything changes colour and drifts. Moving between pages, the screen fills with
   jelly (drawn in site.js). */
:root {
  --lavender: #8c70f5;
  --lavender-deep: #6f54de;
  --pink: #ff9eeb;
  --ink: #2b2350;
  --text: #2b2350;
  --soft: rgba(43, 35, 80, 0.58);
  --rule: rgba(43, 35, 80, 0.16);
  --panel: rgba(255, 255, 255, 0.5);
  --no: rgba(43, 35, 80, 0.2);
  --p: 0;
  --sky-a: #ffdfd1;
  --sky-b: #cdd9ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Fredoka", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--sky-b);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- the sky ---- */
/* Its two colours are set from how far down the page you are (site.js), and three soft
   lights drift and swell with the scroll (--p goes 0 to 1). A fourth light takes the
   colour picked on the wheel. */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: linear-gradient(calc(150deg + var(--p) * 110deg), var(--sky-a), var(--sky-b)); }
.sky i { position: absolute; width: 80vmax; height: 80vmax; left: -40vmax; top: -40vmax; border-radius: 50%; will-change: transform; }
.sky .warm { background: radial-gradient(closest-side, rgba(255, 244, 214, 0.95), transparent); transform: translate3d(calc(14vw + var(--p) * 76vw), calc(20vh + var(--p) * 70vh), 0) scale(calc(1.05 - var(--p) * 0.4)); }
.sky .mint { background: radial-gradient(closest-side, rgba(186, 244, 230, 0.92), transparent); transform: translate3d(calc(90vw - var(--p) * 92vw), calc(74vh - var(--p) * 76vh), 0) scale(calc(0.7 + var(--p) * 0.75)); }
.sky .rose { background: radial-gradient(closest-side, rgba(255, 186, 230, 0.88), transparent); transform: translate3d(calc(-16vw + var(--p) * 96vw), calc(130vh - var(--p) * 124vh), 0) scale(calc(0.6 + var(--p) * 0.8)); }
.sky .tint { left: 50%; top: 50%; width: 36vmax; height: 36vmax; margin: -18vmax 0 0 -18vmax; background: var(--tint, transparent); filter: blur(46px); transform: scale(2); opacity: 0; transition: opacity 0.7s ease, background-color 0.7s ease; }
.tinting .sky .tint { opacity: 0.3; }

header, main, footer { position: relative; z-index: 1; }
header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 2.4vw, 26px) clamp(18px, 4vw, 44px);
}
/* On the right of the top bar: two quiet links, then the download button. */
header .right { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); }
header .links { display: flex; gap: clamp(12px, 1.8vw, 26px); font-weight: 500; }
header .links a { color: inherit; text-decoration: none; opacity: 0.7; transition: opacity 0.15s ease; }
header .links a:hover, header .links a:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 0.25em; }
.name { display: inline-flex; align-items: center; gap: 0.4em; font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; color: inherit; text-decoration: none; }

.btn {
  display: inline-block; padding: 0.62em 1.25em; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: #fff; background: var(--lavender);
  box-shadow: 0 0.35em 1em rgba(111, 84, 222, 0.35), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { background: var(--lavender-deep); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn.quiet { color: var(--text); background: var(--panel); box-shadow: 0 0 0 2px var(--rule) inset; }
.btn.small { padding: 0.48em 1.05em; font-size: 1rem; }
.btn.big { padding: 0.7em 1.5em; font-size: clamp(1.1rem, 1.8vw, 1.4rem); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- the rolling title ---- */
.hello { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 96px clamp(18px, 5vw, 60px) 80px; text-align: center; }
.hey { margin: 0; font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 500; color: var(--soft); }
.say { margin: 0.06em 0 0; font-size: clamp(2.7rem, 10vw, 8rem); font-weight: 600; line-height: 1; letter-spacing: -0.025em; color: var(--lavender-deep); min-height: 1.05em; }
.say .word { display: inline-block; white-space: nowrap; }
.say .ch { display: inline-block; will-change: transform, opacity; }
/* Letters arrive like jelly: up from below, a little squashed, then settle. */
.say.in .ch { animation: arrive 0.52s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(var(--i) * 24ms); }
.say.out .ch { animation: leave 0.24s ease-in both; animation-delay: calc(var(--i) * 9ms); }
@keyframes arrive {
  0% { opacity: 0; transform: translateY(0.6em) scale(1.12, 0.78); }
  55% { opacity: 1; transform: translateY(-0.07em) scale(0.96, 1.07); }
  100% { opacity: 1; transform: none; }
}
@keyframes leave { to { opacity: 0; transform: translateY(-0.4em) scale(0.94, 1.06); } }

/* ---- any colour: a row of colours, and he wears whichever is picked ---- */
.colours { min-height: 92svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6svh clamp(12px, 4vw, 44px) 10svh; text-align: center; overflow: hidden; }
.colours h2 { margin: 0; font-size: clamp(2rem, 6vw, 4.4rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; }
.colours > q { display: block; margin-top: 0.2em; quotes: "\201C" "\201D"; font-size: clamp(1.2rem, 2.6vw, 1.9rem); font-weight: 500; color: var(--lavender-deep); }

/* Always one even row of eight; on a narrow screen, two even rows of four. */
.dots { display: grid; grid-template-columns: repeat(8, auto); justify-content: center; gap: clamp(8px, 1.8vw, 24px); padding: 0; margin: clamp(22px, 6svh, 60px) 0 0; list-style: none; }
.dots li { display: flex; }
.dots button { width: clamp(40px, 8.2vw, 92px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; padding: 0; background: radial-gradient(circle at 34% 30%, #fff 0 8%, color-mix(in srgb, var(--c) 45%, #fff) 20%, var(--c) 62%, color-mix(in srgb, var(--c) 82%, #2b2350)); box-shadow: 0 0.5em 1.2em color-mix(in srgb, var(--c) 45%, transparent), 0 0 0 4px rgba(255, 255, 255, 0.75); transition: transform 0.15s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.2s ease; }
.dots button:hover { transform: scale(1.1); }
.dots button[aria-pressed="true"] { box-shadow: 0 0.5em 1.2em color-mix(in srgb, var(--c) 45%, transparent), 0 0 0 4px #fff, 0 0 0 8px var(--ink); }

/* ---- download: one big jelly button ---- */
.versions { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 74px clamp(14px, 5vw, 60px) 0; }
.pair { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 5vw, 76px); width: 100%; padding: 4svh 0 7svh; }
/* Each is a blob of him: thick at the bottom, a gloss on the shoulder, bubbles inside. */
.jelly {
  container-type: inline-size;
  position: relative; display: grid; place-content: center; justify-items: center;
  width: min(72vw, 430px, 56svh); aspect-ratio: 1;
  border-radius: 50%;
  color: #fff; text-decoration: none; text-align: center;
  background:
    radial-gradient(120% 90% at 30% 16%, rgba(255, 255, 255, 0.5), transparent 36%),
    radial-gradient(90% 70% at 72% 104%, rgba(255, 158, 235, 0.8), transparent 62%),
    linear-gradient(180deg, #ab96ff, var(--lavender) 46%, var(--lavender-deep));
  box-shadow: 0 -0.7em 1.4em rgba(60, 36, 150, 0.34) inset, 0 0.3em 0.5em rgba(255, 255, 255, 0.55) inset, 0 1.3em 2.4em -0.7em rgba(111, 84, 222, 0.6);
  font-size: clamp(0.95rem, 2vw, 1.45rem);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.jelly.free {
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 30% 16%, #fff, transparent 40%),
    radial-gradient(90% 70% at 72% 104%, rgba(255, 190, 236, 0.75), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(238, 231, 255, 0.86) 52%, rgba(204, 190, 255, 0.9));
  box-shadow: 0 -0.7em 1.4em rgba(140, 112, 245, 0.3) inset, 0 0.3em 0.5em #fff inset, 0 1.3em 2.4em -0.7em rgba(111, 84, 222, 0.4);
}
.jelly::before { content: ""; position: absolute; left: 20%; top: 13%; width: 22%; height: 11%; border-radius: 50%; background: rgba(255, 255, 255, 0.72); transform: rotate(-16deg); }
.jelly:hover { transform: translateY(-2.5%) scale(1.03); }
.jelly:active { transform: scale(0.975, 0.955); transition-duration: 0.12s; }
.jelly .kind { position: relative; font-size: clamp(1.45rem, 12.5cqw, 3.7rem); font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.jelly .cost { position: relative; margin-top: 0.3em; font-weight: 500; opacity: 0.82; }
.jelly .pop { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.jelly .pop i { position: absolute; left: var(--l); top: 100%; width: var(--d); aspect-ratio: 1; border-radius: 50%; border: max(1px, 0.6cqw) solid rgba(255, 255, 255, 0.5); animation: float var(--t) linear infinite; animation-delay: var(--w); }
.jelly.free .pop i { border-color: rgba(140, 112, 245, 0.38); }
.jelly .pop i:nth-child(1) { --l: 16%; --d: 4.5cqw; --t: 9.5s; --w: -2s; }
.jelly .pop i:nth-child(2) { --l: 46%; --d: 6.5cqw; --t: 7.2s; --w: -5s; }
.jelly .pop i:nth-child(3) { --l: 76%; --d: 3.6cqw; --t: 11s; --w: -8s; }
@keyframes float { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translateY(-92cqw); opacity: 0; } }

footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4em 2em; padding: 0 20px 44px; font-weight: 500; }
footer a { color: inherit; text-underline-offset: 0.2em; }
footer span { color: var(--soft); }

/* ---- stepping through the main page ---- */
/* With site.js running, each part is a full screen and they are stepped through one
   at a time: the part you leave glides away as the next glides in. Without it (or for
   people who ask for less motion) the page simply scrolls. */
html.paged, html.paged body { height: 100%; overflow: hidden; }
html.paged .part { position: fixed; inset: 0; min-height: 0; justify-content: safe center; overflow-x: hidden; overflow-y: auto; visibility: hidden; }
html.paged .part.on { visibility: visible; }
/* One plain move each way for the whole part: quick at first, easing to rest. No
   stretch, no bounce, and its pieces stay together. */
.part.enter-up, .part.enter-down { animation: come-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; will-change: transform, opacity; }
.part.enter-down { animation-name: come-down; }
.part.leave-up, .part.leave-down { animation: go-up 0.42s cubic-bezier(0.5, 0, 0.9, 0.4) both; will-change: transform, opacity; }
.part.leave-down { animation-name: go-down; }
@keyframes come-up { from { opacity: 0; transform: translate3d(0, 14vh, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes come-down { from { opacity: 0; transform: translate3d(0, -14vh, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes go-up { from { opacity: 1; transform: translate3d(0, 0, 0); } to { opacity: 0; transform: translate3d(0, -10vh, 0); } }
@keyframes go-down { from { opacity: 1; transform: translate3d(0, 0, 0); } to { opacity: 0; transform: translate3d(0, 10vh, 0); } }
/* The sky moves by itself between parts: each part has its own wash of colour that
   fades in, and the lights glide to their new places. */
.sky .wash { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; }
.sky .wash.on { opacity: 1; }
html.paged .sky i:not(.tint) { transition: transform 1.3s cubic-bezier(0.22, 1, 0.36, 1); }
/* Where you are among the parts, and a way to jump. */
.pager { position: fixed; right: clamp(4px, 1.4vw, 20px); top: 50%; z-index: 3; display: grid; gap: 2px; transform: translateY(-50%); }
.pager button { width: 26px; height: 26px; padding: 8px; border: 0; border-radius: 50%; cursor: pointer; background: rgba(43, 35, 80, 0.24); background-clip: content-box; transition: padding 0.25s cubic-bezier(0.3, 1.5, 0.5, 1), background-color 0.25s ease; }
.pager button:hover { background-color: rgba(43, 35, 80, 0.45); }
.pager button[aria-current="true"] { padding: 5px; background-color: var(--lavender-deep); }

/* ---- the features page ---- */
.all { max-width: 940px; margin: 0 auto; padding: clamp(110px, 18svh, 190px) clamp(18px, 6vw, 60px) 12svh; }
.all h1 { margin: 0 0 0.5em; font-size: clamp(2.6rem, 8vw, 6rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.025em; }
.all h2 { margin: 2.2em 0 0.35em; font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 600; color: var(--lavender-deep); }
.menu { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--text); }
.menu li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.3em 1.4em; padding: 0.55em 0 0.6em; border-bottom: 1px solid var(--rule); }
.menu span { font-size: clamp(1.25rem, 2.8vw, 2rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.012em; }
.menu q { quotes: "\201C" "\201D"; font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 500; color: var(--lavender-deep); text-align: right; }
.menu kbd { font: inherit; font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 500; color: var(--soft); text-align: right; }
/* Every website he can search, as a block of names. */
.sites { display: flex; flex-wrap: wrap; gap: 0.5em; margin: 1em 0 0; padding: 0; list-style: none; }
.sites li { padding: 0.3em 0.85em; border-radius: 999px; font-size: clamp(0.95rem, 1.5vw, 1.1rem); font-weight: 500; background: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8) inset; }
.all .back { margin-top: 3.2em; }
/* The privacy page: one screen, never scrolling. Everything on it is sized from one
   number, which starts as a guess from the height of the screen; site.js then nudges
   it down (--fit) until the whole page fits. */
.all.plain { max-width: 46rem; min-height: 100svh; display: flex; flex-direction: column; justify-content: safe center; padding: 76px clamp(18px, 6vw, 60px) 28px; font-size: var(--fit, clamp(0.8rem, calc((100svh - 104px) / 36), 1.2rem)); }
.all.plain h1 { margin: 0 0 0.2em; font-size: 3.2em; }
.plain dl { margin: 0; }
.plain dt { margin-top: 1.05em; font-size: 1.28em; font-weight: 600; letter-spacing: -0.01em; }
.plain dd { margin: 0.2em 0 0; line-height: 1.45; }
.plain dd a { color: inherit; text-underline-offset: 0.2em; }
.all.plain .back { align-self: flex-start; margin-top: 1.6em; font-size: 1em; }
html.fitted, html.fitted body { height: 100%; overflow: hidden; }
html.fitted .all.plain { height: 100svh; overflow: hidden; }

/* ---- the taskbar, and Mallow living on it ---- */
/* Both are made by site.js and stay on every page. Everything else leaves room for the
   bar at the bottom. */
:root { --bar: 48px; --pet-w: clamp(104px, 11vw, 200px); }
html.barred body { padding-bottom: var(--bar); }
html.barred.paged .part { bottom: var(--bar); }
html.barred .all.plain { min-height: calc(100svh - var(--bar)); }
html.barred.fitted .all.plain { height: calc(100svh - var(--bar)); }
.taskbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--bar); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 clamp(10px, 1.6vw, 18px); background: rgba(255, 255, 255, 0.74); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 -1px 0 rgba(43, 35, 80, 0.08); }
.tb-apps { grid-column: 2; display: flex; gap: 10px; }
.tb-apps i { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 50%, #fff), var(--c)); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 2px 5px color-mix(in srgb, var(--c) 35%, transparent); }
.tb-apps i:nth-child(1) { --c: #8c70f5; border-radius: 50%; }
.tb-apps i:nth-child(2) { --c: #ff73b8; }
.tb-apps i:nth-child(3) { --c: #45c7a8; border-radius: 50% 50% 8px 8px; }
.tb-apps i:nth-child(4) { --c: #ffc238; }
.tb-apps i:nth-child(5) { --c: #61a3fa; border-radius: 8px 50% 50% 8px; }
.tb-tray { grid-column: 3; justify-self: end; display: grid; text-align: right; font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--ink); }

/* He is one picture, drawn afresh every frame by his own program and moved to wherever
   he is. The grip is an unseen handle over him, for picking him up. */
.desk { position: fixed; inset: 0; z-index: 41; overflow: hidden; pointer-events: none; }
.live, .live-grip, .live-at, .live-dial { position: absolute; left: 0; top: 0; will-change: transform; }
.live { pointer-events: none; }
.live-grip { pointer-events: auto; cursor: grab; touch-action: none; border-radius: 50% 50% 42% 42%; -webkit-user-select: none; user-select: none; }
.live-grip.held { cursor: grabbing; }
/* The time left on the clock he turns into for a timer. */
.live-dial { opacity: 0; font-weight: 600; line-height: 1; color: #211a45; pointer-events: none; white-space: nowrap; }
/* What he says. --shift keeps the bubble on screen while its tail stays on him. */
.live-at { width: 0; height: 0; }
.live-say { position: absolute; left: 0; bottom: 10px; width: max-content; max-width: min(78vw, 17em); margin: 0; padding: 0.32em 0.8em 0.38em; border-radius: 1em; background: #fff; color: var(--ink); font-size: clamp(1rem, 1.6vw, 1.45rem); font-weight: 600; line-height: 1.25; text-align: center; box-shadow: 0 0.3em 1em rgba(43, 35, 80, 0.2); pointer-events: none; opacity: 0; transform: translateX(calc(-50% + var(--shift, 0px))) scale(0.5); transform-origin: calc(50% - var(--shift, 0px)) 100%; transition: transform 0.26s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.14s ease; }
.live-say::after { content: ""; position: absolute; left: calc(50% - var(--shift, 0px)); top: 100%; width: 12px; height: 12px; margin: -7px 0 0 -6px; border-radius: 2px; background: #fff; transform: rotate(45deg); }
.live-at.saying .live-say { opacity: 1; transform: translateX(calc(-50% + var(--shift, 0px))) scale(1); }

/* ---- the jelly that fills the screen between pages ---- */
#jelly { position: fixed; inset: 0; z-index: 60; width: 100vw; height: 100vh; pointer-events: none; display: none; }
#jelly.on { display: block; pointer-events: auto; }
/* A page reached through the jelly starts covered, before anything else is drawn. */
html.arriving::before { content: ""; position: fixed; inset: 0; z-index: 59; background: var(--lavender); }

@media (max-width: 560px) {
  .say { min-height: 2.05em; }
  .menu li { flex-direction: column; align-items: flex-start; }
  .menu q, .menu kbd { text-align: left; }
}
/* ---- phones ---- */
/* A slimmer taskbar, still his floor. The title runs to two big lines, and whatever sits at the bottom of a page stops above
   him instead of under him. */
@media (max-width: 700px) {
  :root { --bar: 44px; --pet-w: clamp(84px, 26vw, 112px); }
  .tb-apps { gap: 8px; }
  .tb-apps i { width: 24px; height: 24px; }
  .tb-tray { font-size: 11px; }
  /* The dots stay, small, tight against the right edge and clear of everything. */
  .pager { right: 2px; gap: 0; }
  .pager button { width: 22px; height: 22px; padding: 7px; }
  .pager button[aria-current="true"] { padding: 5px; }
  header { padding: 14px 20px; }
  .hello { padding-left: 24px; padding-right: 24px; }
  .hey { font-size: 1.25rem; }
  .say { font-size: clamp(2.6rem, 13.5vw, 4.6rem); line-height: 1.02; min-height: 2.1em; }
  .colours { padding-left: 20px; padding-right: 20px; }
  .colours h2 { font-size: clamp(2.2rem, 10vw, 3.2rem); }
  .dots { grid-template-columns: repeat(4, auto); gap: clamp(14px, 4.5vw, 22px); margin-top: clamp(26px, 6svh, 48px); }
  .dots button { width: clamp(50px, 15.5vw, 76px); }
  .versions { padding-left: 20px; padding-right: 20px; }
  .jelly { width: min(68vw, 46svh, 340px); }
  .pair { padding: 0 0 calc(var(--pet-w) * 0.5); }
  header .right { gap: 12px; }
  header .links { gap: 12px; font-size: 0.9rem; }
  .name { font-size: 1.3rem; }
  .all { padding-bottom: calc(var(--pet-w) * 0.74 + 24px); }
  .all.plain { padding: 70px 22px calc(var(--pet-w) * 0.74 + 14px); }
}
@media (max-width: 345px) {
  header .links a[href^="mailto"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .say.in .ch, .say.out .ch, .jelly .pop i { animation: none; }
  .jelly .pop i { opacity: 0; }
  .jelly { transition: none; }
  .sky i { transform: none; }
}
