/* The home page is one day. Scroll is the clock, the sky follows it, and the day ring fills as doses pass. */
.day {
  --marigold: #FFB547; --ink: #2B1B4D; --clay-ink: #2B1B4D; --paper: #FFF6E4; --purple: #5C40D8;
  --teal: #5FC9B4; --mustard: #E9B949; --sage: #A9C39A; --pink: #EFAFA8; --given: #3FD6C1; --on-given: #06302A;
  background: var(--marigold); color: var(--ink); font-size: 1.25rem; line-height: 1.4; overflow-x: clip;
}
.day h1, .day h2 { font-family: var(--display); font-weight: 400; }
.day img { height: auto; }
.day :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
/* The sky gets its own layer, so turning it never repaints the page. */
.sky { position: fixed; top: 0; left: 0; right: 0; height: 100lvh; z-index: -1; background: var(--marigold); transform: translateZ(0); }

/* The day ring, once the morning has started. */
.ring {
  position: fixed; z-index: 30; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  width: 96px; height: 96px; transition: opacity var(--motion-duration-emphasis) var(--motion-easing-standard);
}
.ring.is-away { opacity: 0; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring text { font: 400 15px var(--display); fill: var(--clay-ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.stamp-dot {
  fill: #FFFFFF44; stroke: var(--clay-ink); stroke-width: 2.5; transform-box: fill-box; transform-origin: center;
  transition: transform var(--motion-duration-bump) var(--motion-easing-standard);
}
.stamp-dot.on { fill: var(--given); stroke: var(--on-given); transform: scale(var(--motion-scale-bump)); }

/* Morning: Obi boops Steve as the page lands. The ledge carries the pitch, so the first screen answers without a scroll. */
.morning { position: relative; }
.morning-pin { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: linear-gradient(var(--marigold) 58%, var(--purple) 58%); }
#film { position: absolute; inset: 0; width: 100%; height: 100%; }
.pitch {
  position: absolute; z-index: 2; left: 0; right: 0; top: 40%; color: #fff; /* day.js sets top from the ledge */
  display: grid; gap: 18px; align-items: end;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.pitch .wordmark { display: inline-block; margin-bottom: 8px; color: var(--marigold); }
.pitch .wordmark span { color: #fff; }
.pitch .tagline { margin-bottom: 6px; opacity: 0.85; }
.morning h1 { font-size: clamp(2.5rem, 5vw, 5.4rem); line-height: 0.98; }
.morning h1 span { display: block; white-space: nowrap; }
.lede { margin-top: 10px; max-width: 34ch; line-height: 1.25; }
@media (min-aspect-ratio: 1/1) and (min-width: 820px) {
  .pitch { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; max-width: 1180px; margin-inline: auto; }
}

/* Waitlist. Same form on the ledge at dawn and under the moon at night. */
.join-label { display: block; font-weight: 600; margin-bottom: 6px; line-height: 1.2; text-wrap: balance; }
.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1 1 0; min-width: 0; min-height: 56px; padding: 0 12px;
  border: 0; border-radius: var(--r-button); background: #fff; color: var(--clay-ink); font: 400 1rem var(--body);
}
.join-row input::placeholder { color: #6B6577; }
.join-row input[aria-invalid='true'] { box-shadow: inset 0 0 0 3px var(--marigold); }
.nose-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 56px; padding: 0 16px 0 8px;
  border: 0; border-radius: var(--r-button); background: var(--marigold); color: var(--clay-ink);
  font: 400 1.2rem/1 var(--display); cursor: pointer; box-shadow: inset 0 -5px 0 #0000002a;
  transition: transform var(--motion-duration-enter) var(--motion-easing-enter);
}
.nose-btn:active { transform: scale(0.97); }
.nose { width: 40px; height: auto; transform-origin: 50% 100%; transition: transform var(--motion-duration-enter) var(--motion-easing-enter); }
/* The press answers at once: the nose squashes like the app's boop and stays pressed while the list hears it. */
.nose-btn:active .nose, .nose-btn.is-booping .nose { transform: scale(1.12, 0.82); }
.nose-btn.is-booping { cursor: progress; }
.join-msg { margin-top: 8px; font-size: 1.0625rem; line-height: 1.25; min-height: 1.25em; }
.join-msg.is-error { font-weight: 600; }
.join-msg.is-error::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%;
  background: var(--marigold); vertical-align: 0.05em;
}
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Steve's answer takes the form's place. The tail points up and back toward him. */
.bubble {
  position: relative; display: inline-block; max-width: 30ch; padding: 14px 20px; border-radius: 22px;
  background: var(--paper); color: var(--clay-ink); font: italic 400 1.375rem/1.3 var(--body);
}
.bubble::before {
  content: ''; position: absolute; left: 26px; top: -11px; width: 22px; height: 14px; background: inherit;
  clip-path: path('M0 14 C 6 12, 9 6, 6 0 C 12 6, 18 11, 22 14 Z');
}
.joined .bubble { transform-origin: 34px -8px; }
.joined .bubble:focus { outline: none; }
.joined .bubble .w { opacity: 0; }
.joined .bubble .w.on { opacity: 1; }
.joined-note { margin-top: 12px; font-size: 1.0625rem; }
.text-btn {
  padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}

/* The paw stamp that flies from the button to Steve's nose. */
.stamp {
  position: fixed; left: 0; top: 0; z-index: 40; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; background: var(--given); color: var(--on-given);
  display: grid; place-items: center; box-shadow: 0 6px 8px rgb(0 0 0 / 0.26); pointer-events: none;
}
.stamp svg { width: 24px; height: 24px; }

/* The carved break: squash on enter, then one springy release (the app's 1.12 × 0.82). */
@keyframes boop {
  0% { transform: none; animation-timing-function: var(--motion-easing-enter); }
  30% { transform: scale(1.12, 0.82); animation-timing-function: ease-out; }
  58% { transform: scale(0.96, 1.05); animation-timing-function: ease-in-out; }
  80% { transform: scale(1.02, 0.98); animation-timing-function: ease-in-out; }
  100% { transform: none; }
}
.nap.is-booped { animation: boop calc(var(--motion-duration-enter) + var(--motion-duration-bump)) both; }
@keyframes grow {
  0% { opacity: 0; transform: scale(0.2); animation-timing-function: var(--motion-easing-enter); }
  60% { opacity: 1; transform: scale(1.04); animation-timing-function: ease-in-out; }
  100% { opacity: 1; transform: none; }
}
.joined .bubble.is-growing { animation: grow var(--motion-duration-bump) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(calc(var(--motion-distance-enter) * -0.5)); } }
.joined-note.is-entering { animation: rise var(--motion-duration-enter) var(--motion-easing-enter) both; }

/* The stack, made of clay slabs with open sky between them, and a pet on top. */
.stack {
  max-width: 1180px; margin: 0 auto; display: grid; gap: max(28vh, 270px); /* the gap clears the tallest pet standing on a card */
  /* The top padding clears the peek's full height, so the pets never rise over the first screen's words. */
  padding: max(12vh, clamp(180px, 25vw, 320px) * .52) max(16px, env(safe-area-inset-right, 0px)) 16vh max(16px, env(safe-area-inset-left, 0px));
}
.slab { --ink: var(--clay-ink); position: relative; color: var(--clay-ink); }
.slab-1 { --c: var(--teal); }
.slab-2 { --c: var(--mustard); }
.slab-3 { --c: var(--pink); }
.slab-4 { --c: var(--sage); }
.slab-in {
  position: relative; min-height: min(66vh, 560px); border-radius: 46px 52px 44px 50px; padding: clamp(22px, 4vw, 52px);
  background: url(/img/grain-specks.webp), var(--c); display: grid; gap: 24px; align-items: center;
  box-shadow: inset 0 -10px 0 #0000001c, inset 0 6px 0 #ffffff55, 0 26px 40px -18px #1b104a77;
}
@media (min-width: 820px) { .slab-in { grid-template-columns: 1fr 1fr; } }
.slab-copy { position: relative; z-index: 1; min-width: 0; }
.clock { font: 1.5rem/1.2 var(--hand); }
.slab h2 { font-size: clamp(2.1rem, 4.4vw, 3.7rem); line-height: 1.02; margin: 4px 0 12px; }
.slab p { max-width: 34ch; }
.peek { position: absolute; z-index: 2; bottom: 100%; width: clamp(180px, 25vw, 320px); margin-bottom: -16px; pointer-events: none; }
.peek-l { left: 7%; }
.peek-r { right: 8%; }
.peek-one { width: clamp(96px, 11vw, 140px); }
/* The chase runs along the top of the last card as it rises. day.js moves the two across; held still, they stand mid-stride. */
.chase { position: absolute; z-index: 2; left: calc(50% - 50vw); width: 100vw; bottom: 100%; margin-bottom: -6px; overflow-x: clip; pointer-events: none; }
.runner { position: absolute; bottom: 0; width: clamp(104px, 15vw, 190px); will-change: transform; }
.runner-obi { left: 54%; }
.runner-steve { left: 18%; }
.demo { position: relative; z-index: 1; min-width: 0; display: grid; gap: 10px; justify-items: center; }
.aside { font: 1.2rem/1.2 var(--hand); text-align: center; }
.note {
  width: min(340px, 100%); background: var(--paper); border-radius: 26px; padding: 16px 18px;
  box-shadow: inset 0 -5px 0 #0000001a, 0 8px 12px -6px #0005; transform: rotate(-1.5deg);
}
.note b { display: block; font-weight: 600; }
.note .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.note .row span { padding: 4px 12px; border-radius: 14px; background: #E5DDF9; font-size: 1.05rem; }
.note .row span:first-child { background: var(--given); color: var(--on-given); }
.phone { width: min(230px, 62%); border-radius: 30px; border: 7px solid var(--clay-ink); transform: rotate(3deg); }
.pet-art { width: min(390px, 100%); border-radius: 34px; }
.free-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.free-list li { padding: 4px 14px; border-radius: 16px; background: var(--given); color: var(--on-given); font-weight: 600; box-shadow: inset 0 -3px 0 #0000001f; }
.slab strong { font-weight: 600; }

/* Five minutes. The scroll is the wait. */
.wait { height: 220vh; position: relative; }
.wait-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; place-items: center; text-align: center; padding-inline: 16px;
}
.wait-say { position: relative; z-index: 1; }
.wait h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.count { font: 400 clamp(5.5rem, 21vw, 16rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.after { font: 1.6rem/1.2 var(--hand); }
.wait-why { margin: 10px auto 0; max-width: 32ch; line-height: 1.25; }
.float { position: absolute; will-change: transform; }
.line {
  background: var(--paper); color: var(--clay-ink); padding: 12px 20px; border-radius: 22px; font-size: 1.15rem; line-height: 1.25;
  box-shadow: inset 0 -5px 0 #0000001a; max-width: 15em;
}
.float-cheese { left: 6%; top: 18%; width: clamp(90px, 14vw, 190px); }
.line-brave { right: 7%; top: 16%; }
.line-phone { left: 9%; bottom: 14%; }
/* The real Live Activity, cropped from the Lock Screen; the radius hides the wallpaper in its corners. */
.live { display: block; width: 100%; height: auto; margin-bottom: 10px; border-radius: 3% / 13%; }
.float-steve { right: 4%; bottom: 6%; width: clamp(150px, 24vw, 320px); }

/* Night. */
.night {
  min-height: 150vh; position: relative; display: grid; align-content: end; justify-items: center; text-align: center; gap: 22px; color: #fff;
  padding: 20vh max(16px, env(safe-area-inset-right, 0px)) 6vh max(16px, env(safe-area-inset-left, 0px)); overflow: hidden;
}
.moon { position: absolute; top: 0; left: 62%; width: 110px; will-change: transform; }
.moon img { display: block; width: 170px; max-width: none; margin: -30px; }
.moon::before { content: ''; position: absolute; left: 52%; bottom: 96%; height: 80vh; border-left: 2px solid #ffffff66; }
.night h2 { font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 1; }
.night p { max-width: 36ch; color: #DAD5F2; }
.nap { width: min(620px, 92%); margin-bottom: -40px; position: relative; z-index: 1; transform-origin: 50% 100%; }
.night-ledge { width: min(820px, 100%); height: 40px; border-radius: 20px; background: url(/img/grain-specks.webp), var(--purple); box-shadow: inset 0 -6px 0 #0003; }
.night .join { width: min(520px, 100%); text-align: left; }
.night .join-msg, .night .joined-note { color: #DAD5F2; max-width: none; }
.night .bubble { max-width: 30ch; color: var(--clay-ink); }
.promise { display: grid; gap: 8px; margin-top: 18px; }
.promise p { font-size: 1.0625rem; line-height: 1.3; max-width: 44ch; }

.day .foot { margin-top: 0; color: #DAD5F2; font-size: 1.0625rem; }
.day .foot a { color: #DAD5F2; }
.day .foot a:hover { color: #fff; }

@media (max-width: 640px) {
  .ring { width: 74px; height: 74px; }
  .peek { width: 150px; }
  .peek-one { width: 96px; }
  .stack { gap: max(24vh, 190px); }
  .float-cheese { top: 7%; }
  .line-brave { top: 16%; right: 5%; }
  .line-phone { bottom: 5%; left: 4%; max-width: 11em; }
  .float-steve { bottom: 3%; right: 1%; }
}

@media (prefers-reduced-motion: reduce) {
  .ring, .stamp-dot, .nose-btn, .nose { transition: none; }
  .nose-btn:active .nose, .nose-btn.is-booping .nose { transform: none; }
  .nap.is-booped { animation: none; }
  .joined .bubble.is-growing, .joined-note.is-entering { animation: fade var(--motion-duration-enter) var(--motion-easing-enter) both; }
  .joined .bubble .w { opacity: 1; }
  .runner { will-change: auto; } /* day.js leaves them at their stylesheet pose */
}
