/*
 * Upsy's site (upsy-app.bysourav.com). The app's own tokens (src/design/tokens.ts): warm sand, deep sea for the one
 * primary action, sunny highs and kelp-green lows. Fredoka for display, the system font for reading. Light and dark
 * follow the device. Motion is small and stops under Reduce Motion.
 */
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f1e7;
  --surface: #ffffff;
  --ink: #2e2320;
  --ink-soft: #4e423c;
  --muted: #6f6259;
  --line: rgba(46, 35, 32, 0.1);
  --primary: #1c6a80;
  --on-primary: #ffffff;
  --tint: #e1eff3;
  --accent: #17627a;
  --high-soft: #fff2d6;
  --high-ink: #8a5a00;
  --low-soft: #e4efe2;
  --low-ink: #3f6b44;
  --sea: #a9d3e0;
  --shadow: 0 1px 2px rgba(46, 35, 32, 0.06), 0 12px 32px rgba(46, 35, 32, 0.08);

  --display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --s-xs: 6px;
  --s-s: 12px;
  --s-m: 16px;
  --s-l: 24px;
  --s-xl: 40px;
  --s-xxl: 72px;
  --r-s: 14px;
  --r-m: 20px;
  --r-l: 28px;
  --page: 1080px;
  --measure: 66ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a1f;
    --surface: #1b252c;
    --ink: #f3ede4;
    --ink-soft: #d9cfc4;
    --muted: #a89d92;
    --line: rgba(243, 237, 228, 0.12);
    --primary: #8dcbdd;
    --on-primary: #10191e;
    --tint: #1e333b;
    --accent: #9dd5e5;
    --high-soft: #3a3020;
    --high-ink: #ffc970;
    --low-soft: #1f3324;
    --low-ink: #9ccb9f;
    --sea: #2b4f5c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  /* The page reaches behind the Dynamic Island and the browser's bottom bar (viewport-fit=cover), so the same sand
     shows there and when you pull past either end. */
  background: var(--bg);
  /* Upsy's bob rotates her a hair past the edge on a phone: never let the page slide sideways. */
  overflow-x: clip;
}
body {
  margin: 0;
  /* Drifting otters and Upsy's bob reach a little past the edge on a phone: the page never slides sideways. (On
     html alone, clip doesn't stop the viewport scrolling; on body, which spans the screen, it does.) */
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img,
svg {
  display: block;
  max-width: 100%;
}
/* Links in text: a soft underline at rest, firm on hover, so they read as links without shouting. */
a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  transition:
    color 180ms ease-out,
    text-decoration-color 180ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-color: currentColor;
  }
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}
/* Small line icons (Lucide paths) beside link text. */
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* "Read our privacy promise" and the like: a bold link whose arrow leans forward on hover. */
.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font: 600 17px/1.2 var(--display);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .more:hover .icon {
    translate: 4px 0;
  }
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
h1 {
  font-size: clamp(36px, 6vw, 60px);
}
h2 {
  font-size: clamp(26px, 3.6vw, 36px);
}
h3 {
  font-size: 21px;
}
p {
  margin: 0;
  text-wrap: pretty;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: var(--s-m);
  top: var(--s-m);
  background: var(--surface);
  padding: var(--s-xs) var(--s-s);
  z-index: 10;
}

/* ---------- Frame ---------- */
.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 max(var(--s-l), env(safe-area-inset-right, 0px)) 0 max(var(--s-l), env(safe-area-inset-left, 0px));
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-m);
  padding: var(--s-m) 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 44px;
}
.top {
  min-height: 64px;
}
.brand {
  text-decoration: none;
}
.brand img {
  transition: rotate 320ms cubic-bezier(0.2, 0.9, 0.25, 1.3);
}
@media (hover: hover) and (pointer: fine) {
  .brand:hover img {
    rotate: -10deg;
  }
}
/* The nav: soft pills that tint on hover; the page you're on is marked. */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font: 500 15px/1 var(--body);
  text-decoration: none;
  transition:
    background-color 180ms ease-out,
    color 180ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover {
    background: var(--tint);
    color: var(--accent);
  }
}
.nav a[aria-current='page'] {
  color: var(--ink);
  background: color-mix(in srgb, var(--tint) 75%, transparent);
}
footer {
  margin-top: var(--s-xxl);
  /* Clear of the home indicator and the browser's bottom bar, which the page scrolls behind. */
  padding: var(--s-xl) 0 calc(var(--s-xl) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-m) var(--s-l);
  justify-content: space-between;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-m);
}
footer nav a {
  color: var(--muted);
  text-decoration-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  footer nav a:hover {
    color: var(--ink);
    text-decoration-color: currentColor;
  }
}
footer nav a[aria-current='page'] {
  color: var(--ink);
}
/* The maker credit: quiet, but where people look for who made something (as on Daisy's site). */
.maker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.maker .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.maker-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.maker-link .icon {
  color: var(--accent);
  width: 0.95em;
  height: 0.95em;
}
@media (hover: hover) and (pointer: fine) {
  .maker-link:hover .icon {
    translate: 2px -2px;
  }
}

/* ---------- Pieces ---------- */
.button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  min-height: 52px;
  padding: 0 var(--s-l);
  border-radius: 999px;
  border: 0;
  background: var(--primary);
  color: var(--on-primary);
  font: 600 18px/1 var(--display);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease-out;
}
.button.quiet {
  background: var(--tint);
  color: var(--accent);
}
.button:active {
  transform: scale(0.97);
}
@media (hover: hover) and (pointer: fine) {
  .button:hover {
    transform: translateY(-1px);
  }
}
.soon {
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  padding: var(--s-xs) var(--s-s);
  border-radius: 999px;
  background: var(--tint);
  color: var(--accent);
  font: 600 15px/1.2 var(--display);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: var(--s-l);
  box-shadow: var(--shadow);
}
.eyebrow {
  font: 600 13px/1 var(--body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Small spacers instead of inline styles (the CSP allows no inline style). */
.gap-top {
  margin-top: var(--s-m);
}
.flush {
  margin-top: 0 !important;
}
.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--ink-soft);
  max-width: 44ch;
}

/* ---------- Home ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: var(--s-xl);
  padding: var(--s-xl) 0 var(--s-xxl);
}
.hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-s);
  margin-top: var(--s-l);
}
.hero-art {
  position: relative;
  aspect-ratio: 1;
}
/* Upsy floats inside a round patch of sea, which rounds off her water instead of ending it in a straight cut. */
.hero-art .sea {
  position: absolute;
  inset: 4% 2% 2% 6%;
  border-radius: 50%;
  background: var(--tint);
  overflow: hidden;
}
.hero-art .sea .still {
  position: absolute;
  left: 62%;
  bottom: 0;
  width: 132%;
  max-width: none;
  transform: translateX(-50%);
}
@keyframes bob {
  50% {
    transform: translate(-50%, -8px) rotate(-1deg);
  }
}
.day {
  position: absolute;
  left: -6%;
  bottom: 4%;
  width: min(260px, 62%);
  padding: var(--s-s);
  border-radius: var(--r-m);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: var(--s-xs);
  font-size: 15px;
  line-height: 1.35;
}
.day .entry {
  display: none;
  gap: var(--s-xs);
}
.day .entry.on {
  display: grid;
}
.motion .day .entry.on {
  animation: turn 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes turn {
  from {
    opacity: 0;
    transform: translateY(8px) rotateX(-12deg);
  }
}
.day .who {
  font: 600 15px/1.2 var(--display);
}
.half {
  border-radius: var(--r-s);
  padding: 8px 12px;
}
.half b {
  display: block;
  font: 600 12px/1.4 var(--body);
  letter-spacing: 0.04em;
}
.half.high {
  background: var(--high-soft);
}
.half.high b {
  color: var(--high-ink);
}
.half.low {
  background: var(--low-soft);
}
.half.low b {
  color: var(--low-ink);
}

section {
  padding: var(--s-xl) 0;
}
.feature {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: var(--s-xl);
}
.feature.flip {
  grid-template-columns: 1.2fr 0.8fr;
}
.feature.flip .art {
  order: 2;
}
.feature .art {
  max-width: 360px;
  justify-self: center;
}
.feature .art > img {
  width: 100%;
}
.feature .words {
  display: grid;
  gap: var(--s-s);
}
.feature .words p {
  color: var(--ink-soft);
  max-width: 52ch;
}
.note {
  color: var(--muted);
  font-size: 15px;
  margin-top: var(--s-m);
}

/* ---------- Closing ---------- */
.closing {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: var(--s-xl);
}
.closing-art {
  display: grid;
  justify-items: center;
  gap: var(--s-m);
}
.closing-art img {
  width: min(280px, 70%);
}

/* ---------- Scroll scenes (js/motion.js) ----------
 * Apple-style scenes, all scrubbed by scroll position (never on a timer), and only when the script runs with Reduce
 * Motion off (it adds .motion). Without it every scene is laid out in full, at rest.
 *   [data-pin]: taller than the screen; its .pin-inner stays put while you scroll through, --p 0 to 1 across it.
 *   [data-scrub]: --p 0 to 1 as it rises from the bottom of the screen to the middle.
 *   .reveal: floats up once, as it comes into view.  .split: a headline surfacing word by word. */
.motion .pin {
  position: relative;
}
.motion .pin-inner {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}
.motion .pin-inner > .wrap {
  width: 100%;
}

.motion .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 800ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms),
    transform 1000ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms);
}
.motion .reveal.in {
  opacity: 1;
  transform: none;
}

/* Headlines surface a word at a time. */
.motion .split .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em) rotate(3deg);
  transition:
    opacity 600ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i) * 70ms + 120ms);
}
.motion .split.in .w {
  opacity: 1;
  transform: none;
}

/* The hero: the words and Upsy arrive on load; Upsy rises out of her sea. */
.motion .hero-copy.enter {
  animation: rise-in 1000ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.motion .hero-art.enter {
  animation: rise-in 1100ms 150ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
/* The day card waits until Upsy has walked on and settled (The catwalk). */
.motion .hero-art .day {
  animation: rise-in 900ms calc(var(--cw-d) + var(--cw-t) * 0.86) cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
}

/* ---------- The catwalk ----------
 * Upsy struts in along the water line as if it were a runway: four steps with her hips swaying and a little rise on
 * each, arms swinging, head held level. She stops, pops a hip and winks as two cameras flash, then sinks into the water
 * with a squash and a ripple, and the waving picture takes over (and bobs from then on). One clock for every piece:
 * --cw-t long, starting after --cw-d. Steps are 12.5% each (0 to 50%), the pose 50 to 70%, the settle 70 to 100%. */
.walker,
.flash {
  display: none;
}
/* Her canvas exactly, where the waving picture draws her (330 tall, centred at 62%), so the pieces line up with it. */
.hero-art .walker {
  position: absolute;
  left: 62%;
  bottom: 0;
  height: 330px;
  aspect-ratio: 400 / 440;
  transform: translateX(-50%);
  pointer-events: none;
}
.walker .travel,
.walker .hips,
.walker .part {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hips {
  transform-origin: 50% 89%;
}
.walker .head {
  transform-origin: 50% 45.45%;
}
.walker .arm-r {
  transform-origin: 32.5% 65.45%;
}
.walker .arm-l {
  transform-origin: 67.5% 65.45%;
}
.walker .ring {
  position: absolute;
  left: 50%;
  top: 89%;
  width: 52%;
  aspect-ratio: 3;
  translate: -50% -50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0;
}
.motion .hero-art {
  --cw-t: 4.8s;
  --cw-d: 0.7s;
}
.motion .walker {
  display: block;
  animation: cw-out var(--cw-t) var(--cw-d) linear both;
}
.motion .walker .travel {
  animation: cw-travel var(--cw-t) var(--cw-d) both;
}
.motion .walker .hips {
  animation: cw-hips var(--cw-t) var(--cw-d) ease-in-out both;
}
.motion .walker .head {
  animation: cw-head var(--cw-t) var(--cw-d) ease-in-out both;
}
.motion .walker .head.walk {
  animation:
    cw-head var(--cw-t) var(--cw-d) ease-in-out both,
    cw-look var(--cw-t) var(--cw-d) linear both;
}
.motion .walker .head.pose {
  animation:
    cw-head var(--cw-t) var(--cw-d) ease-in-out both,
    cw-wink var(--cw-t) var(--cw-d) linear both;
}
.motion .walker .arm-r {
  animation: cw-arm-r var(--cw-t) var(--cw-d) ease-in-out both;
}
.motion .walker .arm-l {
  animation: cw-arm-l var(--cw-t) var(--cw-d) ease-in-out both;
}
.motion .walker .ring {
  animation: cw-ring var(--cw-t) var(--cw-d) ease-out both;
}
.motion .hero-art .sea .still {
  animation:
    cw-in var(--cw-t) var(--cw-d) linear both,
    bob 4.8s calc(var(--cw-t) + var(--cw-d)) ease-in-out infinite;
}
/* Two cameras at the end of the runway. */
.motion .flash {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.flash::before,
.flash::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 16% 26%, #fff 0, rgba(255, 255, 255, 0.55) 22%, transparent 62%);
  animation: cw-flash var(--cw-t) var(--cw-d) linear both;
}
.flash::after {
  background: radial-gradient(circle at 86% 20%, #fff 0, rgba(255, 255, 255, 0.5) 20%, transparent 58%);
  animation-delay: calc(var(--cw-d) + 0.38s);
}
@keyframes cw-travel {
  0% {
    translate: -82% 0;
    animation-timing-function: linear;
  }
  44% {
    translate: -9% 0;
    animation-timing-function: cubic-bezier(0.2, 0.6, 0.3, 1);
  }
  50%,
  100% {
    translate: 0 0;
  }
}
@keyframes cw-hips {
  0% { rotate: -4deg; translate: 0 0; }
  6.25% { translate: 0 -3%; }
  12.5% { rotate: 4deg; translate: 0 0; }
  18.75% { translate: 0 -3%; }
  25% { rotate: -4deg; translate: 0 0; }
  31.25% { translate: 0 -3%; }
  37.5% { rotate: 4deg; translate: 0 0; }
  43.75% { translate: 0 -3%; }
  50% { rotate: 0deg; translate: 0 0; }
  56% { rotate: 4deg; }
  70% { rotate: 4deg; translate: 0 0; scale: 1 1; }
  78% { rotate: 0deg; translate: 0 3%; scale: 1.03 0.96; }
  87% { translate: 0 -1.2%; scale: 0.99 1.02; }
  94% { translate: 0 0.4%; scale: 1 1; }
  100% { rotate: 0deg; translate: 0 0; scale: 1 1; }
}
/* The head stays level against the sway, tilts for the pose, and ends at the waving picture's tilt. */
@keyframes cw-head {
  0% { rotate: 3.5deg; }
  12.5% { rotate: -3.5deg; }
  25% { rotate: 3.5deg; }
  37.5% { rotate: -3.5deg; }
  50% { rotate: 0deg; }
  56%,
  70% { rotate: -9deg; }
  82% { rotate: -2deg; }
  100% { rotate: -4deg; }
}
@keyframes cw-look {
  0%,
  52% { opacity: 1; }
  55%,
  100% { opacity: 0; }
}
@keyframes cw-wink {
  0%,
  52% { opacity: 0; }
  55%,
  100% { opacity: 1; }
}
@keyframes cw-arm-r {
  0% { rotate: 14deg; }
  12.5% { rotate: -14deg; }
  25% { rotate: 14deg; }
  37.5% { rotate: -14deg; }
  50%,
  100% { rotate: 0deg; }
}
@keyframes cw-arm-l {
  0% { rotate: -14deg; }
  12.5% { rotate: 14deg; }
  25% { rotate: -14deg; }
  37.5% { rotate: 14deg; }
  50% { rotate: 0deg; }
  56%,
  70% { rotate: -34deg; }
  80%,
  100% { rotate: 0deg; }
}
@keyframes cw-flash {
  0%,
  55% { opacity: 0; }
  56% { opacity: 0.8; }
  60%,
  100% { opacity: 0; }
}
@keyframes cw-ring {
  0%,
  76% { opacity: 0; scale: 0.2; }
  80% { opacity: 0.9; }
  100% { opacity: 0; scale: 1.6; }
}
@keyframes cw-out {
  0%,
  88% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes cw-in {
  0%,
  88% { opacity: 0; }
  100% { opacity: 1; }
}
/* Bubbles drifting up through her sea. */
.bubble {
  display: none;
}
.motion .bubble {
  display: block;
  position: absolute;
  bottom: 12%;
  width: var(--s, 10px);
  height: var(--s, 10px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.25);
  animation: bubble 7s linear infinite;
  opacity: 0;
}
.bubble.b1 { left: 22%; --s: 12px; animation-delay: 1.2s; }
.bubble.b2 { left: 34%; --s: 8px; animation-delay: 3.4s; }
.bubble.b3 { left: 70%; --s: 14px; animation-delay: 2.2s; }
.bubble.b4 { left: 80%; --s: 7px; animation-delay: 5s; }
.bubble.b5 { left: 48%; --s: 10px; animation-delay: 6.1s; }
@keyframes bubble {
  10% {
    opacity: 1;
  }
  80% {
    opacity: 0.8;
  }
  to {
    opacity: 0;
    transform: translate(10px, -330px);
  }
}
/* As you scroll on, the hero's words lift away and Upsy's scene comes toward you. */
.motion .hero-pin {
  height: 170vh;
}
.motion .hero-pin .hero-copy {
  opacity: calc(1 - var(--p, 0) * 1.7);
  translate: 0 calc(var(--p, 0) * -70px);
}
.motion .hero-pin .hero-art {
  scale: calc(1 + var(--p, 0) * 0.18);
  translate: 0 calc(var(--p, 0) * -30px);
  opacity: calc(1.25 - var(--p, 0) * 1.1);
}

/* The statement: each word lights up in turn as you scroll through it. */
.statement {
  font: 600 clamp(36px, 6.4vw, 84px) / 1.08 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-align: center;
  max-width: 16ch;
  margin: 0 auto;
  padding: var(--s-xxl) 0;
}
.motion .statement-pin {
  height: 260vh;
}
.motion .statement .w {
  opacity: clamp(0.14, calc(var(--p, 0) * (var(--n) + 3) - var(--i) - 0.4), 1);
  transition: opacity 120ms linear;
}

/* Pictures have depth: they drift a little slower than the page, and come into focus as they arrive. */
.motion [data-scrub] .depth {
  translate: 0 calc((0.6 - var(--p, 1)) * 70px);
  scale: calc(0.86 + min(var(--p, 1), 1) * 0.14);
  opacity: min(1, calc(var(--p, 1) * 2.2));
}

/* "fine", crossed out in crayon as you scroll in. */
.fine {
  position: relative;
  display: inline-block;
}
.fine svg {
  position: absolute;
  left: -6%;
  top: 18%;
  width: 112%;
  height: 70%;
  overflow: visible;
  fill: none;
  stroke: #e8836b;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.motion .fine svg path {
  stroke-dashoffset: calc(1 - min(1, max(0, (var(--p, 1) - 0.35) * 2.4)));
}

/* A high and a low float out beside Upsy. */
.why-art {
  position: relative;
}
.chip {
  position: absolute;
  font-size: 15px;
  line-height: 1.3;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.chip.high {
  top: 18%;
  right: -4%;
}
.chip.low {
  bottom: 22%;
  left: -6%;
}
.motion .chip {
  opacity: min(1, max(0, calc((var(--p, 1) - 0.55) * 4)));
  translate: 0 calc((1 - min(1, max(0, (var(--p, 1) - 0.55) * 3))) * 24px);
}
.motion .chip.low {
  opacity: min(1, max(0, calc((var(--p, 1) - 0.7) * 4)));
}

/* The pebble, passed along an arc as you scroll (positions from js/motion.js). */
#table {
  position: relative;
}
.pebble {
  display: none;
}
.motion .pebble {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff 0 12%, #a8b4bb 13% 100%);
  box-shadow: 0 0 0 3px #6f7f88, 0 10px 18px rgba(46, 35, 32, 0.18);
  translate: var(--px, 0) var(--py, 0);
  rotate: var(--pr, 0deg);
  opacity: var(--po, 0);
  pointer-events: none;
}

/* The raft's words arrive once the paws have met. */
.motion .apart-pin {
  height: 220vh;
}
.motion .apart-words {
  opacity: min(1, max(0, calc((var(--p, 1) - 0.5) * 3.2)));
  translate: 0 calc((1 - min(1, max(0, (var(--p, 1) - 0.5) * 3.2))) * 30px);
}

/* The frosted bar and its reading line. */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}
.reading {
  position: relative;
  height: 3px;
}
.reading .line {
  position: absolute;
  inset: 0;
  background: var(--sea);
  transform-origin: left center;
  transform: scaleX(var(--read, 0));
}
.reading .swimmer {
  display: none;
}
.motion .reading .swimmer {
  display: block;
  position: absolute;
  top: -11px;
  left: calc(var(--read, 0) * 100% - 11px);
  width: 22px;
  height: 24px;
  opacity: min(1, calc(var(--read, 0) * 30));
}

/* ---------- Phones: the bar becomes a floating pill (as on Daisy's site and bysourav.com) ----------
 * The page runs edge to edge behind the Dynamic Island and the browser's bottom bar (viewport-fit=cover). The bar
 * itself goes clear, and its contents float as a frosted pill just under the island. Once the page has scrolled, a
 * frosted strip fills the space behind the island so text never runs under the clock. That fade is scroll-driven
 * (CSS only, every page); where a browser can't do it, or under Reduce Motion, the strip simply stays on. */
@media (max-width: 719px) {
  .bar {
    padding: max(10px, env(safe-area-inset-top, 0px)) 0 8px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  .bar::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    /* Down behind the pill's middle, with a soft edge, so nothing peeks between the island and the pill. */
    height: calc(max(10px, env(safe-area-inset-top, 0px)) + 30px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-mask-image: linear-gradient(#000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(#000 calc(100% - 16px), transparent);
    pointer-events: none;
  }
  @supports (animation-timeline: scroll()) {
    .bar::before {
      animation: strip-in linear both;
      animation-timeline: scroll(root);
      animation-range: 0 48px;
    }
  }
  .bar > .wrap {
    position: relative;
    width: calc(100% - 2 * max(12px, env(safe-area-inset-left, 0px)));
    padding: 4px 4px 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    box-shadow:
      inset 0 0 0 1px var(--line),
      0 10px 30px -14px rgba(46, 35, 32, 0.35);
  }
  /* Inside the pill everything is one 44px row, 4px from the edge, so the links' own pills sit concentric with it. */
  .bar .top {
    min-height: 44px;
    padding: 0;
  }
  .bar .brand {
    font-size: 21px;
  }
  .bar .brand img {
    width: 32px;
    height: 35px;
  }
  .bar .nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
  }
  /* The reading line runs along the pill's lower edge, inside its rounded ends; Upsy swims just below it. */
  .reading {
    position: absolute;
    left: calc(max(12px, env(safe-area-inset-left, 0px)) + 22px);
    right: calc(max(12px, env(safe-area-inset-right, 0px)) + 22px);
    bottom: 8px;
    height: 2px;
    border-radius: 2px;
    overflow: visible;
  }
  .motion .reading .swimmer {
    top: -4px;
    width: 18px;
    height: 20px;
  }
}
/* The narrowest phones: the links tighten so the brand keeps its name. */
@media (max-width: 374px) {
  .bar .nav a {
    padding: 0 8px;
  }
}
@keyframes strip-in {
  from {
    opacity: 0;
  }
}

/* ---------- The raft drifting together (js/reveal.js sets --apart, 1 far apart to 0 holding paws) ----------
 * Four layers of one drawing: the three otters and the water on top, so stacked they are exactly the raft. Without
 * the script, or under Reduce Motion, --apart stays 0 and they simply hold paws. */
.raft-scene {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1038 / 440;
  justify-self: center;
}
.raft-scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.raft-scene .o0 {
  transform: translate(calc(var(--apart, 0) * -12%), calc(var(--apart, 0) * -8px))
    rotate(calc(var(--apart, 0) * -6deg));
}
.raft-scene .o1 {
  transform: translateY(calc(var(--apart, 0) * -4px));
}
.raft-scene .o2 {
  transform: translate(calc(var(--apart, 0) * 12%), calc(var(--apart, 0) * -10px))
    rotate(calc(var(--apart, 0) * 6deg));
}
/* The sea reaches past the raft, so drifting otters always float in it. */
.raft-scene .water {
  transform: scaleX(1.24);
}
.raft-scene .otter {
  transform-origin: 50% 80%;
  will-change: transform;
}

/* ---------- Text pages (privacy, terms, support) ---------- */
.page {
  max-width: calc(var(--measure) + 2 * var(--s-l));
  padding-top: var(--s-l);
}
.page header {
  display: grid;
  gap: var(--s-s);
  margin-bottom: var(--s-xl);
}
.page header img {
  width: 96px;
}
.page h2 {
  font-size: 24px;
  margin: var(--s-xl) 0 var(--s-s);
}
.page h3 {
  margin: var(--s-l) 0 var(--s-xs);
}
.page p,
.page li {
  color: var(--ink-soft);
}
.page p + p {
  margin-top: var(--s-s);
}
.page ul {
  padding-left: 1.2em;
  margin: var(--s-s) 0;
}
.page li + li {
  margin-top: var(--s-xs);
}
.page .updated {
  color: var(--muted);
  font-size: 15px;
}
.page .box {
  margin: var(--s-l) 0;
  padding: var(--s-m) var(--s-l);
  border-radius: var(--r-m);
  background: var(--tint);
  color: var(--ink);
}
.page details {
  border-bottom: 1px solid var(--line);
  padding: var(--s-s) 0;
}
.page summary {
  cursor: pointer;
  font: 600 18px/1.4 var(--display);
  color: var(--ink);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.page details p {
  margin-top: var(--s-xs);
}

/* ---------- Invite ---------- */
.invite {
  max-width: 520px;
  margin: 0 auto;
  padding-top: var(--s-l);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: var(--s-m);
}
.invite .art {
  width: min(320px, 80%);
}
.code {
  display: inline-flex;
  align-items: center;
  gap: var(--s-s);
  padding: var(--s-s) var(--s-m);
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
  font: 600 26px/1 var(--display);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.code button {
  font: 600 15px/1 var(--display);
  min-height: 40px;
  padding: 0 var(--s-s);
  border-radius: 999px;
  border: 0;
  background: var(--tint);
  color: var(--accent);
  cursor: pointer;
}
.invite ol {
  text-align: left;
  color: var(--ink-soft);
  margin: 0;
  padding-left: 1.3em;
  display: grid;
  gap: var(--s-xs);
}

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .hero,
  .feature,
  .feature.flip,
  .closing {
    grid-template-columns: 1fr;
  }
  .feature.flip .art {
    order: 0;
  }
  .hero-art {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
  }
  .nav a {
    padding: 8px 10px;
    font-size: 14px;
  }
}
@media (max-width: 420px) {
  .wrap {
    padding: 0 var(--s-m);
  }
  .day {
    left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
