/* Hallmark · shape: Split Studio (draw bafbad) · genre: playful · theme: brand · redesign: full
 * paper: oklch(95% 0.02 118) · accent: oklch(84% 0.15 82) · display: Pixelify Sans · body: Nunito · hero: Counter · nav: slab bar · footer: letter close · signature: Pip holding up the day's note in a window that follows your sky, with a weather switcher that wipes the window pixel by pixel
 * axes: light/pixel/warm · posture: hard-offset pixel shadow, square corners · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4 · weakest: P, a calm app page has little to argue; it argues by refusing streaks and scores, set as the nudge's own line */
/* Hallmark · waive 26b · the four weather radios are never disabled and the page has no other form control · nothing on the page can be unavailable */
/* Hallmark · answered F19 · four weights because the brand's type ramp (app tokens.ts) uses Pixelify 500 for titles and 600 for display */
:root {
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 144px;
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5625rem;
  --text-2xl: 1.953rem;
  --text-3xl: 2.441rem;
  --text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem);
  --text-display: clamp(3.5rem, 6vw + 1rem, 6.5rem);
  --text-section: clamp(2rem, 2.5vw + 1rem, 3.25rem);
  --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem);
  --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 420ms;
  --color-error: oklch(52% 0.19 27);
  --color-success: oklch(50% 0.12 150);
  --container: 1240px;
  --gutter: 64px;
  --gap-columns: 32px;
  --section-gap-s: 120px;
  --section-gap: 144px;
  --section-gap-l: 176px;
  --z-base: 1;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-sticky-nav: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* Brand: the Penpot "Design system v2" day theme (same values as the app's src/ui/tokens.ts). */
  --color-paper: #edf1e1;
  --color-paper-2: #dfe7d5;
  --color-paper-3: #a2d3d7;
  --color-ink: #0b2828;
  --color-ink-2: #0b2828;
  --color-muted: #296568;
  --color-rule: #0b2828;
  --color-shadow: #0b2828;
  --color-accent: #fbc64d;
  --color-accent-ink: #0b2828;
  --color-press: #fa8754;
  --color-focus: #31777a;
  --color-link: #94402f;
  --color-sill: #a57648;
  --font-display: "Pixelify Sans", ui-monospace, monospace;
  --font-body: "Nunito", ui-sans-serif, system-ui, sans-serif;
  --font-outlier: var(--font-body);
  --display-weight: 600;
  --radius-card: 0;
  --radius-pill: 0;
  --rule-hair: 2px;
  --shadow-card: 0 4px 0 var(--color-shadow);
  --tracking-display: -0.01em;
  --px: 4px; /* one art pixel at the 4 pt scale */
  color-scheme: light;
}

/* Night: the v2 Dusk theme. data-theme comes from the system or the header button (inline line in each <head>, theme.js). */
:root[data-theme="dark"] {
  --color-paper: #1e203d;
  --color-paper-2: #463252;
  --color-paper-3: #203e5f;
  --color-ink: #f6e7cf;
  --color-ink-2: #f6e7cf;
  --color-muted: #a9a2c4;
  --color-rule: #a9a2c4;
  --color-shadow: #fa8754;
  --color-accent: #fbc64d;
  --color-accent-ink: #0d0c29;
  --color-press: #ef6146;
  --color-focus: #48adc8;
  --color-link: #fa8754;
  --color-sill: #702f4f;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  overflow-x: clip;
}
html {
  scrollbar-color: var(--color-muted) var(--color-paper);
  scroll-padding-top: var(--space-3xl);
}
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--color-accent);
}
::selection {
  background: color-mix(in oklab, var(--color-accent) 22%, transparent);
  color: var(--color-ink);
}
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight, 700);
  font-synthesis: none;
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  overflow-wrap: break-word;
  min-width: 0;
  text-wrap: balance;
}
h1 {
  max-width: 20ch;
  font-size: var(--text-display);
}
h2 {
  max-width: 30ch;
  font-size: var(--text-section);
}
h3 {
  max-width: 40ch;
  font-size: var(--text-title);
  line-height: 1.2;
}
.lead {
  font-size: var(--text-lead);
  line-height: 1.45;
  max-width: 52ch;
}
p {
  margin: 0;
  text-wrap: pretty;
}
p:not([class]) {
  max-width: 65ch;
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
svg {
  display: block;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  box-sizing: border-box;
}
.num,
.figure,
td.num {
  font-variant-numeric: tabular-nums;
}
.email {
  white-space: nowrap; /* never break at the hyphen in the-sill.com */
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 60rem) {
  :root {
    --gutter: 24px;
    --section-gap-s: 80px;
    --section-gap: 96px;
    --section-gap-l: 120px;
  }
}
@media (max-width: 40rem) {
  :root {
    --gutter: 16px;
    --section-gap-s: 56px;
    --section-gap: 72px;
    --section-gap-l: 96px;
    --gap-columns: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *:not(.keep-motion),
  *:not(.keep-motion)::before,
  *:not(.keep-motion)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Fonts are self-hosted in fonts/: never load from Google. */
@font-face {
  font-family: "Pixelify Sans";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/pixelify-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Pixelify Sans";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/pixelify-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/nunito-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-weight: 700;
  font-display: swap;
  src: url("fonts/nunito-latin-700-normal.woff2") format("woff2");
}

.night {
  display: none;
}
:root[data-theme="dark"] .day {
  display: none;
}
:root[data-theme="dark"] .night {
  display: block;
}

html {
  background: var(--color-paper);
}
body {
  font-size: var(--text-md);
}
img {
  image-rendering: pixelated;
}
a {
  color: var(--color-link);
}
main a:not([class]):hover {
  text-decoration-thickness: 3px; /* inline links: the underline thickens */
}
h3 {
  font-weight: 500;
}
.lead {
  color: var(--color-ink);
}
.meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.skip {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  z-index: var(--z-modal);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 700;
}
.skip:focus-visible {
  top: var(--space-md);
}

/* Chrome: shared by every page. */
header,
footer,
main {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-block: var(--space-md);
}
header > a:first-child {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-right: auto;
  color: var(--color-ink);
  text-decoration: none;
  font: 600 1.5rem var(--font-display);
}
header > a:first-child::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: url("img/icon.png") center / cover;
}
footer {
  padding-block: 0 var(--space-2xl);
  font-size: var(--text-sm);
}
footer nav {
  padding-top: var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
}
footer a {
  display: inline-block;
  padding-block: 6px; /* 34px tap targets */
  color: var(--color-ink);
}
footer a:hover {
  color: var(--color-link);
}
main {
  padding-block: var(--space-lg) var(--space-2xl);
}
main:not(.home) {
  max-width: calc(40rem + 2 * var(--gutter));
  margin-left: max(0px, calc((100% - var(--container)) / 2));
} /* text pages (Impressum, Privacy, …) */
main:not(.home) h1 {
  font-size: var(--text-display-s);
  margin-bottom: var(--space-lg);
}
main:not(.home) h2 {
  font-size: var(--text-2xl);
  margin-block: var(--space-xl) var(--space-sm);
}
main:not(.home) h3 {
  margin-block: var(--space-lg) var(--space-xs);
}
main:not(.home) p {
  margin-bottom: var(--space-sm);
}
main:not(.home) pre {
  white-space: pre-wrap; /* body clips overflow-x, so long license lines must wrap */
  font-size: var(--text-xs);
}
main:not(.home) li,
main:not(.home) pre {
  overflow-wrap: anywhere; /* long URLs */
}

/* Apple's App Store badge: the artwork stays as supplied (no border or shadow); it only lifts. */
.badge {
  display: inline-block;
  line-height: 0;
  transition: transform var(--dur-micro) steps(2);
}
.badge:hover {
  transform: translateY(calc(-1 * var(--px)));
}
.badge:active {
  transform: translateY(0);
}
/* The logo: the app icon pops up on its own pixel shadow. */
header > a:first-child::before {
  transition:
    transform var(--dur-micro) steps(2),
    box-shadow var(--dur-micro) steps(2);
}
header > a:first-child:hover::before {
  transform: translateY(calc(-1 * var(--px)));
  box-shadow: 0 var(--px) 0 var(--color-shadow);
}

/* Controls: the pixel press. Square, 2px border, a hard 4px shadow that the press swallows. */
.btn,
.nav-action,
.theme-toggle,
.lang,
.weather span {
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--dur-micro) steps(2),
    box-shadow var(--dur-micro) steps(2),
    background-color var(--dur-micro);
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: 700 var(--text-md)/1.2 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}
.nav-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 700;
  text-decoration: none;
}
.theme-toggle {
  padding: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--color-paper-2);
  color: inherit;
  cursor: pointer;
}
.lang {
  padding: 0 var(--space-sm);
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--color-paper-2);
  color: var(--color-ink);
  font-weight: 700;
  text-decoration: none;
}
.theme-toggle img {
  width: 26px;
  height: 26px;
}
.btn:hover,
.nav-action:hover,
.theme-toggle:hover,
.lang:hover {
  transform: translateY(calc(-1 * var(--px) / 2));
  box-shadow: 0 6px 0 var(--color-shadow);
}
.btn:hover,
.nav-action:hover {
  background: var(--color-press);
}
.btn:active,
.nav-action:active,
.theme-toggle:active,
.lang:active {
  transform: translateY(var(--px));
  box-shadow: 0 0 0 var(--color-shadow);
}
.btn:focus-visible,
.nav-action:focus-visible,
.theme-toggle:focus-visible,
.lang:focus-visible,
a:focus-visible {
  outline: var(--px) solid var(--color-focus);
  outline-offset: 2px;
}

/* Home: a Split Studio. Text on the left, the window on the right, all the way down. */
.home {
  padding-block: 0;
}
.home > section {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
  padding-block: var(--section-gap-s);
}
.home h2 {
  margin-bottom: var(--space-md);
}

/* Hero (Counter): the download beside the window. One reveal, the two halves 80ms apart. */
.hero {
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: calc(100dvh - 76px);
  padding-block: var(--space-lg) var(--space-2xl) !important;
}
.hero .copy {
  display: grid;
  gap: var(--space-lg);
  justify-items: start;
}
.hero h1 {
  font-size: var(--text-display);
  line-height: 0.95;
}
.hero .intro {
  max-width: 44ch;
}
.hero .lead {
  font-size: var(--text-xl);
  line-height: 1.35;
  max-width: 24ch;
}
.hero .copy,
.hero .stage {
  animation: arrive var(--dur-long) var(--ease-out) both;
}
.hero .stage {
  animation-delay: 80ms;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(var(--space-xs));
  }
}

/* The window scene: SVG art from Penpot (102 x 100 cells); Pip stands on the sill. */
.scene {
  position: relative;
  aspect-ratio: 102 / 100;
}
.scene > img {
  width: 100%;
  height: 100%;
}
.pip {
  position: absolute;
  left: 34.3%;
  top: 61%;
  width: 31.4%;
}
.pip img {
  width: 100%;
}
.stage .pip,
.sky-stage .pip {
  animation: bob 2.4s steps(1) infinite;
}
@keyframes bob {
  50% {
    transform: translateY(1%);
  }
}

/* Nudge bubble (v2): Pip speaks from above, so the stepped pixel tail points up at him. */
.stage {
  display: grid;
  gap: 28px;
  width: 100%;
  max-width: 500px;
  justify-self: center;
}
.bubble {
  position: relative;
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
}
.bubble p {
  font: 500 var(--text-title)/1.2 var(--font-display);
}
/* Three stacked steps (12, 28, 44 px wide), drawn as border and fill layers like the Penpot tail. */
.bubble::before,
.bubble::after {
  content: "";
  position: absolute;
  left: calc(50% - 22px);
  width: 44px;
  height: 26px;
}
.bubble::before {
  top: -28px;
  background:
    linear-gradient(var(--color-rule) 0 0) 16px 0 / 12px 10px no-repeat,
    linear-gradient(var(--color-rule) 0 0) 8px 8px / 28px 10px no-repeat,
    linear-gradient(var(--color-rule) 0 0) 0 16px / 44px 10px no-repeat;
}
.bubble::after {
  top: -26px;
  height: 28px;
  background:
    linear-gradient(var(--color-paper-2) 0 0) 18px 0 / 8px 10px no-repeat,
    linear-gradient(var(--color-paper-2) 0 0) 10px 8px / 24px 10px no-repeat,
    linear-gradient(var(--color-paper-2) 0 0) 2px 16px / 40px 12px no-repeat;
}

/* How it works (Pinned): the window holds still while the three moments scroll past it. */
.how {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start !important;
  padding-block-start: var(--space-2xl) !important; /* the hero already ends in air */
}
.moments {
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
  counter-reset: moment;
}
.moments li {
  counter-increment: moment;
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-xl) 0 var(--space-xl) var(--space-lg);
  border-left: var(--px) solid var(--color-paper-2);
  min-height: 40vh;
  align-content: center;
  transition: border-color var(--dur-short);
}
.moments li.is-active {
  border-left-color: var(--color-ink);
}
.moments h3::before {
  content: counter(moment) ". ";
  color: var(--color-muted);
}
.moments h3 {
  font-size: var(--text-2xl);
}
.moments p {
  color: var(--color-muted);
  font-size: var(--text-lead);
  line-height: 1.45;
  max-width: 34ch;
}
.moment-art {
  display: none;
  height: 96px;
  width: auto;
}
.how-stage {
  position: sticky;
  top: var(--space-2xl);
}
.how-stage .scene {
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
  background: var(--color-paper-2);
}
.how-stage .pose {
  display: none;
}
.how-stage[data-state="1"] .pose[data-pose="1"],
.how-stage[data-state="2"] .pose[data-pose="2"],
.how-stage[data-state="3"] .pose[data-pose="3"] {
  display: block;
}
.scene > .sill-trinket {
  position: absolute;
  height: auto;
  left: 70%;
  top: 85.2%;
  width: 9.8%;
  transition:
    opacity var(--dur-micro),
    transform var(--dur-short) steps(3);
}
.js .how-stage:not([data-state="2"]) .scene > .sill-trinket {
  opacity: 0;
  transform: translateY(-40%);
} /* without script the trinket simply sits on the sill */

/* His window (Switcher): four real states behind radio buttons, so it works with scripting off. */
.sky {
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
}
.weather {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  max-width: 26rem;
  margin: var(--space-xl) 0 0;
  padding: 0;
  border: 0;
}
.weather label {
  position: relative;
  min-width: 0;
}
/* The radio is drawn transparent over its whole tile, so the tile carries its focus ring. */
.weather input {
  position: absolute;
  inset: 0;
  z-index: var(--z-raised);
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  cursor: pointer;
}
.weather input:focus-visible {
  outline: var(--px) solid var(--color-focus);
  outline-offset: 2px;
}
.weather span {
  display: grid;
  justify-items: center;
  gap: var(--space-2xs);
  min-height: 48px;
  padding: var(--space-2xs) var(--space-2xs) var(--space-xs);
  background: var(--color-paper);
  font: 500 var(--text-lg) var(--font-display);
}
.weather label:hover span {
  transform: translateY(calc(-1 * var(--px) / 2));
  box-shadow: 0 6px 0 var(--color-shadow);
}
.weather span img {
  width: 100%;
  height: auto;
}
@media (max-width: 40rem) {
  .weather {
    gap: var(--space-xs);
  }
  .weather span {
    font-size: var(--text-sm);
  }
}
.weather input:checked + span {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  transform: translateY(var(--px));
  box-shadow: 0 0 0 var(--color-shadow);
}
.sky-stage {
  display: grid;
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
  background: var(--color-paper-2);
}
.window {
  grid-area: 1 / 1;
  position: relative;
  aspect-ratio: 102 / 100;
  visibility: hidden;
}
.window > img {
  width: 100%;
  height: 100%;
}
.window[data-weather="clear"] {
  visibility: visible;
}
.sky:has(input:checked) .window {
  visibility: hidden;
}
.sky:has(input[value="clear"]:checked) [data-weather="clear"],
.sky:has(input[value="cloudy"]:checked) [data-weather="cloudy"],
.sky:has(input[value="rain"]:checked) [data-weather="rain"],
.sky:has(input[value="snow"]:checked) [data-weather="snow"] {
  visibility: visible;
  z-index: var(--z-raised);
  animation: wipe 480ms steps(12) both;
}
.sky:has(input:checked) .window.is-prev {
  visibility: visible;
}
/* The signature: the new sky arrives in twelve hard steps, a pixel blind rolling down. */
@keyframes wipe {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
.sky:not(.is-ready) .window {
  animation: none !important;
}

/* Private by design: the bouquet the gift ideas grow into. */
.private {
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
}
.ticks {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0 0;
  display: grid;
  gap: var(--space-sm);
}
.ticks li {
  display: flex;
  gap: var(--space-sm);
  align-items: baseline;
}
.ticks li::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background: var(--color-link);
  box-shadow: inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0
    color-mix(in oklab, var(--color-ink) 25%, transparent);
}
.bouquet {
  position: relative;
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.bouquet > img {
  width: 100%;
}
.bouquet .flowers {
  position: absolute;
  left: 38%;
  bottom: 14%;
  width: 24%;
}

/* Close: no window this time. The card itself is the sill, and Pip waves on its ledge beside
   the note and the bouquet you tucked away. Sprites keep one art-pixel size (--cell). */
.hello {
  --cell: 5px;
  --pad: var(--space-2xl);
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  grid-template-areas:
    "copy say"
    "copy shelf"
    "plank plank";
  row-gap: 0 !important;
  margin-block-end: var(--space-2xl);
  padding: var(--space-3xl) var(--pad) 0 !important;
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
}
.hello-copy {
  grid-area: copy;
  align-self: center;
  padding-bottom: var(--space-2xl);
}
.hello-copy .lead {
  font-size: var(--text-xl);
  line-height: 1.35;
  max-width: 24ch;
}
.hello .badge,
.hello .btn {
  margin-top: var(--space-lg);
}
/* Pip says the headline: the hero's bubble, with its stepped tail turned down at him. */
.say {
  grid-area: say;
  justify-self: center;
  align-self: end;
  margin-bottom: var(--space-xl);
}
.say h2 {
  max-width: none;
  margin: 0 !important;
  font-size: var(--text-3xl);
}
.say::before {
  top: auto;
  bottom: -28px;
  background:
    linear-gradient(var(--color-rule) 0 0) 0 0 / 44px 10px no-repeat,
    linear-gradient(var(--color-rule) 0 0) 8px 8px / 28px 10px no-repeat,
    linear-gradient(var(--color-rule) 0 0) 16px 16px / 12px 10px no-repeat;
}
.say::after {
  top: auto;
  bottom: -26px;
  background:
    linear-gradient(var(--color-paper-2) 0 0) 2px 0 / 40px 12px no-repeat,
    linear-gradient(var(--color-paper-2) 0 0) 10px 10px / 24px 10px no-repeat,
    linear-gradient(var(--color-paper-2) 0 0) 18px 18px / 8px 10px no-repeat;
}
.say {
  --color-paper-2: var(--color-paper); /* the bubble reads lighter than the card it sits on */
}
/* Pip stands in the middle; the trinkets lean in from either side. */
.shelf {
  grid-area: shelf;
  align-self: end;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: calc(4 * var(--cell));
}
.shelf > .note {
  justify-self: end;
}
.shelf > .flowers {
  justify-self: start;
}
.shelf > :only-child {
  grid-column: 2; /* 404: Pip alone, still in the middle */
}
.shelf img {
  height: auto;
}
/* The shelf copies of the note paint its fold and shadow in the plank-top colour: the app's shade
   is the card colour here, so the corner looked cut off. The shadow row now sits on the plank. */
.note img {
  width: calc(10 * var(--cell));
}
.wave {
  width: calc(32 * var(--cell));
  animation: bob 2.4s steps(1) infinite;
}
.flowers img {
  width: calc(24 * var(--cell));
}

/* Play: tap a trinket to read what was tucked away, tap Pip and he jumps. */
.keepsake,
.pip-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  line-height: 0;
  cursor: pointer;
}
.keepsake img,
.pip-btn {
  transition: translate var(--dur-micro) steps(2);
}
.keepsake[data-open] img {
  translate: 0 calc(-1 * var(--cell));
}
.tag {
  position: absolute;
  bottom: calc(100% + var(--space-sm));
  z-index: var(--z-raised);
  width: max-content;
  max-width: 20ch;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule);
  box-shadow: var(--shadow-card);
  color: var(--color-ink);
  font: 500 var(--text-md) / 1.2 var(--font-display);
  text-align: left;
  opacity: 0;
  translate: 0 var(--px);
  transition:
    opacity var(--dur-micro) steps(2),
    translate var(--dur-short) steps(2);
  pointer-events: none;
}
/* Labels open away from Pip, so they never cover his face. */
.note .tag {
  right: 0;
}
.flowers .tag {
  left: 0;
}
.keepsake:focus-visible .tag,
.keepsake[data-open] .tag {
  opacity: 1;
  translate: 0 0;
}
/* Hover only where there is a real pointer, so a tap on a phone does not leave the label stuck open. */
@media (hover: hover) {
  .keepsake:hover img,
  .pip-btn:hover {
    translate: 0 calc(-1 * var(--cell));
  }
  .keepsake:hover .tag {
    opacity: 1;
    translate: 0 0;
  }
}
.pip-btn {
  transform-origin: 50% 100%;
}
.pip-btn.is-jumping {
  animation: jump 560ms steps(2);
}
.pip-btn.is-jumping .wave {
  animation: none;
}
@keyframes jump {
  0% {
    transform: translateY(0) scale(1.08, 0.9);
  }
  20% {
    transform: translateY(calc(-5 * var(--cell)));
  }
  45% {
    transform: translateY(calc(-7 * var(--cell)));
  }
  70% {
    transform: translateY(calc(-2 * var(--cell)));
  }
  85% {
    transform: translateY(0) scale(1.1, 0.88);
  }
  100% {
    transform: none;
  }
}
/* The ledge: a pale lip, the wood, a row of grain dashes. Same build as the sill in the art. */
.plank {
  grid-area: plank;
  height: 36px;
  margin-inline: calc(-1 * var(--pad));
  border-top: var(--rule-hair) solid var(--color-rule);
  background:
    repeating-linear-gradient(
        90deg,
        transparent 0 28px,
        color-mix(in oklab, var(--color-sill) 55%, var(--color-ink)) 28px 56px,
        transparent 56px 112px
      )
      0 22px / 100% 4px no-repeat,
    linear-gradient(color-mix(in oklab, var(--color-sill) 35%, var(--color-paper)) 0 0) 0 0 / 100% 12px no-repeat,
    var(--color-sill);
}

/* 404: the same card, Pip alone on an empty sill. */
.notfound .hello {
  margin-block-start: var(--space-lg);
}
.notfound h1 {
  font-size: var(--text-section);
  margin-bottom: var(--space-md);
}

@media (min-width: 60.01rem) {
  .moments li > .moment-art {
    display: none !important;
  }
}
@media (max-width: 60rem) {
  .home > section {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--space-xl);
    padding-block: var(--section-gap-s);
  }
  .hero {
    min-height: 0;
  }
  .stage {
    justify-self: center;
  }
  .how-stage {
    display: none;
  }
  .moments li {
    min-height: 0;
    padding-block: var(--space-lg);
  }
  .moment-art {
    display: block;
  }
  :root:not([data-theme="dark"]) .moment-art.night,
  :root[data-theme="dark"] .moment-art.day {
    display: none;
  }
  .hello {
    --cell: 4px;
    --pad: var(--space-lg);
    padding: var(--space-xl) var(--pad) 0 !important;
  }
  .hello {
    grid-template-areas: "copy" "say" "shelf" "plank";
  }
  .hello-copy {
    padding-bottom: var(--space-xl);
  }
}
@media (max-width: 40rem) {
  .nav-action {
    display: none;
  }
  /* No room beside the trinkets on a phone: the label takes the bubble's place while it is open. */
  .shelf {
    position: relative;
  }
  .keepsake {
    position: static;
  }
  .note .tag,
  .flowers .tag {
    left: 0;
    right: 0;
    bottom: calc(100% + var(--space-xl));
    margin-inline: auto;
    font-size: var(--text-lg);
  }
  .hello:has(.keepsake[data-open], .keepsake:focus-visible) .say {
    visibility: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage .pip,
  .sky-stage .pip,
  .shelf .wave {
    animation: none;
  }
  @view-transition {
    navigation: none;
  }
}

/* Between pages: the header holds still, the page underneath swaps in four hard steps. */
@view-transition {
  navigation: auto;
}
header {
  view-transition-name: chrome;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--dur-short);
  animation-timing-function: steps(4);
}

/* Text pages: Pip keeps you company beside the title, on a little ledge of his own. */
@media (min-width: 75rem) {
  body:has(main:not(.home))::after {
    content: "";
    position: absolute;
    top: 140px;
    right: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
    width: 220px;
    height: 158px;
    pointer-events: none;
    image-rendering: pixelated;
    background:
      url("img/art/pip-holding-a-note.svg") 50% calc(100% - 26px) / 128px 128px no-repeat,
      linear-gradient(var(--color-rule) 0 0) 0 calc(100% - 28px) / 100% 2px no-repeat,
      linear-gradient(color-mix(in oklab, var(--color-sill) 35%, var(--color-paper)) 0 0) 0
        calc(100% - 16px) / 100% 12px no-repeat,
      linear-gradient(var(--color-sill) 0 0) 0 100% / 100% 16px no-repeat;
  }
}
