/* wusel.pet: paper, ink and washes of colour, as in the app and its App Store pictures. */

@font-face {
  font-family: "Comic Neue";
  src: url("/assets/fonts/comic-neue-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Comic Neue";
  src: url("/assets/fonts/comic-neue-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fffbf2;
  --ink: #2b2320;
  --ink-soft: rgb(43 35 32 / 0.72);
  --peach: #f6d7b0;
  --sage: #cfe3c0;
  --lilac: #e6d3ee;
  --honey: #f7e3a8;
  --pebble: #d9d2c4;
  /* the app's handwriting: Chalkboard on a Mac, Comic Sans on Windows, and the nearest thing elsewhere */
  --hand: "Chalkboard SE", "Chalkboard", "Comic Sans MS", "Comic Neue", "Comic Sans", cursive;
  --text: ui-rounded, -apple-system, "Segoe UI", system-ui, sans-serif;
  --wide: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  /* animals are drawn at desktop size and shown smaller here */
  --s: 0.72;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  /* a little grain, like real paper */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.14 0 0 0 0 0.12 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--hand);
  font-size: clamp(17px, 1.05rem + 0.2vw, 20px);
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 6px; }

.wrap {
  width: min(var(--wide), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- top bar ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 22px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 1.5rem; text-decoration: none;
}
.brand img { width: 44px; height: 44px; }
.langs { display: flex; gap: 4px; font-size: 0.95rem; }
.langs a, .langs span {
  padding: 4px 10px; border-radius: 999px; text-decoration: none;
}
.langs [aria-current] { background: var(--ink); color: var(--paper); }
.langs a:hover { background: rgb(43 35 32 / 0.08); }

/* ---------- washes of colour, laid on by hand ---------- */

.washed { position: relative; isolation: isolate; }
.washed::before, .washed::after {
  content: ""; position: absolute; z-index: -1;
  background: var(--wash, var(--peach));
  opacity: 0.42;
  pointer-events: none;
}
/* two loose passes, slightly off register */
.washed::before {
  inset: var(--wash-inset, 4% -6% 0 -4%);
  border-radius: 48% 52% 44% 56% / 58% 46% 54% 42%;
  transform: rotate(-2deg);
}
.washed::after {
  inset: var(--wash-inset, 4% -6% 0 -4%);
  border-radius: 55% 45% 52% 48% / 44% 57% 43% 56%;
  transform: translate(1.5%, -2%) rotate(1.5deg);
}

/* ---------- headings and text ---------- */

h1, h2, h3 { font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.4rem, 1.4rem + 4.2vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.9rem); }
p { margin: 0; }
.lead { font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.45rem); color: var(--ink-soft); max-width: 38em; }

/* ---------- store buttons ---------- */

.stores {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 18px;
}
.stores a {
  display: block; line-height: 0; border-radius: 10px;
  transition: transform 0.18s ease;
}
.stores a:hover { transform: translateY(-2px) rotate(-1deg); }
.stores img { height: 54px; width: auto; }
.stores-note { font-size: 0.95rem; color: var(--ink-soft); text-align: center; }

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding-top: clamp(24px, 5vw, 56px);
  --wash: var(--peach);
  --wash-inset: -2% -10% 18% -10%;
}
.hero .lead { margin: 18px auto 30px; }
.hero .stores-note { margin-top: 14px; }
.hero .stage { margin-top: clamp(150px, 16vw, 190px); }

/* ---------- a screenshot in a hand-drawn frame ---------- */

.frame {
  position: relative;
  border-radius: 26px;
}
.frame > img {
  display: block; width: 100%; height: auto;
  border-radius: 24px;
  aspect-ratio: 16 / 10; object-fit: cover;
  background: #8fb3d8;
}
/* the ink line, a little shaky, and the soft shadow under it */
.frame::after, .frame::before {
  content: ""; position: absolute; border-radius: 28px; pointer-events: none;
  filter: url(#rough);
}
.frame::after { inset: -4px; border: 5px solid var(--ink); }
.frame::before { inset: -4px; background: var(--ink); opacity: 0.12; transform: translate(14px, 16px); z-index: -1; }

/* ---------- animals ---------- */

.pet {
  position: absolute;
  width: calc(var(--w) * var(--s));
  height: calc(var(--h) * var(--s));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  /* stand with the feet on the spot given by --at (from the left) and the parent's top edge */
  left: calc(var(--at, 50%) - var(--foot-x) * var(--s));
  bottom: calc(100% - var(--foot-y) * var(--s) + var(--lift, 0px));
  pointer-events: none;
  z-index: 2;
}
.pet.flip { transform: scaleX(-1); transform-origin: calc(var(--foot-x) * var(--s)) 100%; }
.film { background-size: calc(var(--strip) * var(--s)) 100%; }
.film.playing { animation: film var(--seconds) steps(var(--frames)) infinite; }
@keyframes film { to { background-position: calc(-1 * var(--strip) * var(--s)) 0; } }

/* a pet that walks: its wrapper moves, the pet inside plays the steps */
.walker {
  position: absolute; left: 0; bottom: 100%; width: 0; height: 0; z-index: 3;
  will-change: transform;
}
.walker .pet { --at: 0px; }

.zzz {
  position: absolute;
  width: calc(var(--w) * var(--s)); height: calc(var(--h) * var(--s));
  left: calc((var(--foot-x) + var(--x)) * var(--s));
  bottom: calc((var(--foot-y) + var(--y)) * var(--s));
  background-size: calc(var(--strip) * var(--s)) 100%;
  background-repeat: no-repeat;
  animation: film var(--seconds) steps(var(--frames)) infinite;
}

/* ---------- features ---------- */

.features { display: grid; gap: clamp(90px, 12vw, 150px); padding-block: clamp(110px, 14vw, 170px) 40px; }
.feature {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.feature:nth-child(even) { grid-template-columns: 1.25fr 1fr; }
.feature:nth-child(even) .copy { order: 2; }
.feature .copy { display: grid; gap: 14px; }
.feature .copy p { color: var(--ink-soft); font-size: 1.12rem; }
.feature .stage { --wash-inset: -14% -10% -12% -10%; }
.feature-windows { --wash: var(--sage); }
.feature-unique { --wash: var(--lilac); }
.feature-care { --wash: var(--honey); }

/* ---------- who can move in ---------- */

.residents { padding-block: clamp(100px, 12vw, 150px) 40px; text-align: center; }
.residents .lead { margin: 14px auto 0; }
.shelf {
  position: relative;
  display: grid; grid-template-columns: repeat(6, auto); justify-content: space-between; align-items: end;
  gap: 18px 12px;
  margin-top: clamp(40px, 6vw, 70px);
  padding-bottom: 52px;
  --s: 0.62;
}
/* the shelf they stand on, at their feet; the names go under it */
.shelf::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: 52px;
  border-top: 4px solid var(--ink); filter: url(#rough); border-radius: 4px;
}
.resident { position: relative; display: grid; justify-items: center; margin: 0; }
.resident .pet {
  position: relative; left: auto; bottom: auto;
  /* the feet at the bottom of the cell, which is the shelf */
  margin-bottom: calc(var(--foot-y) * var(--s) * -1 - 2px);
  transition: transform 0.25s ease;
  transform-origin: 50% 100%;
  pointer-events: auto;
}
.resident .pet.flip { transform: scaleX(-1); }
.resident:hover .pet { transform: translateY(-6px) rotate(-2deg); }
.resident:hover .pet.flip { transform: scaleX(-1) translateY(-6px) rotate(-2deg); }
.resident .name {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 16px; white-space: nowrap; font-size: 1rem; color: var(--ink-soft);
}

/* ---------- calm and considerate ---------- */

.calm {
  padding-block: clamp(150px, 16vw, 200px) clamp(60px, 8vw, 100px);
  --wash: var(--pebble);
  --wash-inset: -18% -6% -14% -6%;
}
.calm .inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 1.12rem; }
.ticks li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.ticks svg { width: 26px; height: 26px; margin-top: 2px; }
.calm .stage { position: relative; }

/* ---------- the end: one more time, the stores ---------- */

.finale { text-align: center; padding-block: clamp(120px, 14vw, 180px) 30px; --wash: var(--peach); --wash-inset: 12% 6% 6% 6%; }
.finale h2 { margin-bottom: 12px; }
.finale .lead { margin: 0 auto 30px; }
.finale .needs { margin-top: 16px; font-size: 0.95rem; color: var(--ink-soft); }
.bed { position: relative; height: 0; margin-top: clamp(120px, 12vw, 150px); }
.bed::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0;
  border-top: 4px solid var(--ink); filter: url(#rough);
}
.bed .pet { --s: 0.62; }

footer {
  padding-block: 28px 40px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center;
  font-size: 0.95rem; color: var(--ink-soft);
}
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- little doodles ---------- */

.doodle { position: absolute; color: var(--ink); opacity: 0.55; pointer-events: none; z-index: 1; }
.doodle svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* ---------- legal pages ---------- */

.legal { padding-block: 30px 80px; max-width: 46em; }
.legal h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: 26px; }
.legal h2 { font-size: 1.4rem; margin: 34px 0 10px; }
.legal p, .legal li { font-family: var(--text); line-height: 1.6; color: var(--ink-soft); }
.legal p + p { margin-top: 12px; }
.legal address { font-style: normal; font-family: var(--text); line-height: 1.6; }

/* ---------- smaller screens ---------- */

@media (max-width: 860px) {
  .feature, .feature:nth-child(even), .calm .inner { grid-template-columns: 1fr; }
  .feature:nth-child(even) .copy { order: 0; }
  .feature .stage, .calm .stage { margin-top: 90px; }
  .shelf { grid-template-columns: repeat(3, 1fr); justify-items: center; row-gap: 86px; padding-bottom: 52px; --s: 0.46; }
  /* a shelf for each row */
  .shelf::after { display: none; }
  .resident { width: 100%; }
  .resident .art-horse { --s: 0.34; }
  .resident::after {
    content: ""; position: absolute; left: -6px; right: -6px; bottom: -2px;
    border-top: 3.5px solid var(--ink); filter: url(#rough);
  }
}
@media (max-width: 560px) {
  :root { --s: 0.5; }
  .stores img { height: 48px; }
  .hero .stage { margin-top: 110px; }
  .doodle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film.playing, .zzz { animation: none; }
  .stores a, .resident .pet { transition: none; }
}
