/* Petick website. Colours are sampled from the app icon and the Nimbus (light) theme. */
:root {
  --page: #f0f9ff;
  --sky: #cdecfd;
  --mint: #d5f4ef;
  --hill: #d0f1be;
  --hill-edge: #a9dc8e;
  --grass-ink: #2c5519;
  --sun: #fedf97;
  --teal: #5eabb0;
  --bark: #511f0f; /* the pets' outline colour */
  --ink: #1e293b;
  --soft: #526077;
  --line: #d8e2ef;
  --blue: #0284c7;
  --blue-edge: #075985;
  --focus: #0ea5e9;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pet: 272px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--body);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: .5rem; }
h1, h2, h3 { font-family: var(--round); color: var(--bark); margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.75rem); line-height: 1.08; letter-spacing: -.01em; font-weight: 800; }
h3 { font-size: 1.25rem; line-height: 1.25; font-weight: 700; }
p { margin: 0; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.narrow { max-width: 40rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding-block: 1.25rem; }
.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  font: 800 1.4rem/1 var(--round); color: var(--bark); text-decoration: none;
}
.brand img { border-radius: 22.5%; }
.top-link { font-weight: 600; color: var(--soft); text-decoration: none; padding: .4rem .2rem; }
.top-link:hover { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: 2rem 4rem; align-items: center;
  padding-block: 2rem 5.5rem;
}
h1 {
  font-size: clamp(2.75rem, 1.4rem + 5.4vw, 5rem);
  line-height: .98; letter-spacing: -.02em; font-weight: 800;
}
.lede { margin-top: 1.5rem; max-width: 33rem; font-size: 1.1875rem; color: var(--soft); }

/* App Store button: chunky, pressable, like the buttons in the app. */
.store {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  margin-top: 2rem; padding: .7rem 1.75rem .8rem;
  border-radius: 1.1rem; background: var(--blue); color: #fff;
  font: 800 1.5rem/1.1 var(--round); text-decoration: none;
  box-shadow: 0 5px 0 var(--blue-edge);
  transition: transform .08s, box-shadow .08s, background-color .15s;
}
.store small { font: 600 .8125rem/1.3 var(--body); letter-spacing: .01em; }
.store:hover { background: #0590d6; }
.store:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-edge); }

/* Habitat: the app icon's sky and hill, with a live pet standing in it. */
.habitat {
  position: relative; overflow: hidden;
  border: 3px solid #fff; border-radius: 2.75rem;
  background:
    radial-gradient(circle at 80% 13%, rgba(94, 171, 176, .8) 0 6%, rgba(94, 171, 176, 0) 11%),
    radial-gradient(circle at 62% 15%, var(--sun) 0 11%, rgba(254, 223, 151, 0) 25%),
    linear-gradient(var(--sky), var(--mint));
  box-shadow: 0 6px 0 #b9dcf0;
  text-align: center;
}
.session {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-top: 1.5rem; padding: .5rem 1rem;
  border-radius: 99rem; background: #fff; box-shadow: 0 3px 0 var(--line);
  font-size: .9375rem; font-weight: 600; color: var(--ink);
}
.session time { font: 600 .9375rem/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--blue-edge); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: #22c55e; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.perch { position: relative; z-index: 1; width: var(--pet); margin: .75rem auto -3.25rem; }
.perch::before { /* ground shadow under the feet */
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 1.5%; height: 8%;
  border-radius: 50%; background: rgba(44, 85, 25, .22);
}
.pet {
  position: relative; display: block; width: var(--pet); height: var(--pet); padding: 0;
  border: 0; border-radius: 2rem; background: url(assets/sylva/idle-3.webp) 0 0 / 500% 400% no-repeat;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: idle 4s step-end infinite;
}
/* Sprite sheet: 5 x 4 cells at 8 fps. Cells 0-15 loop; 16-18 swap in on every second pass so the pet blinks. */
@keyframes idle{0%{background-position:0% 0%}3.125%{background-position:25% 0%}6.25%{background-position:50% 0%}9.375%{background-position:75% 0%}12.5%{background-position:100% 0%}15.625%{background-position:0% 33.3333%}18.75%{background-position:25% 33.3333%}21.875%{background-position:50% 33.3333%}25%{background-position:75% 33.3333%}28.125%{background-position:100% 33.3333%}31.25%{background-position:0% 66.6667%}34.375%{background-position:25% 66.6667%}37.5%{background-position:50% 66.6667%}40.625%{background-position:75% 66.6667%}43.75%{background-position:100% 66.6667%}46.875%{background-position:0% 100%}50%{background-position:0% 0%}53.125%{background-position:25% 0%}56.25%{background-position:50% 0%}59.375%{background-position:75% 0%}62.5%{background-position:100% 0%}65.625%{background-position:25% 100%}68.75%{background-position:50% 100%}71.875%{background-position:75% 100%}75%{background-position:75% 33.3333%}78.125%{background-position:100% 33.3333%}81.25%{background-position:0% 66.6667%}84.375%{background-position:25% 66.6667%}87.5%{background-position:50% 66.6667%}90.625%{background-position:75% 66.6667%}93.75%{background-position:100% 66.6667%}96.875%{background-position:0% 100%}}
/* Tap: closed-eyes cell (bottom right) and a hop. */
.pet.happy { background-position: 100% 100%; animation: hop .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes hop { 35% { transform: translateY(-9%) scale(1.03, .98); } 70% { transform: translateY(0) scale(.99, 1.01); } }

.ground {
  position: relative; padding: 4.25rem 1.5rem 1.5rem;
  background: var(--hill); border-radius: 50% 50% 0 0 / 3.25rem 3.25rem 0 0;
}
.ground-label { font-size: .875rem; font-weight: 600; color: var(--grass-ink); }
.stages { position: relative; display: flex; justify-content: space-between; margin-top: .75rem; }
.stages::before, .stages::after { /* track, and the part already walked */
  content: ""; position: absolute; top: calc(1.75rem - 3px); left: 1.75rem; height: 6px; border-radius: 3px;
}
.stages::before { right: 1.75rem; background: rgba(255, 255, 255, .75); }
.stages::after { width: calc((100% - 3.5rem) * var(--p)); background: var(--blue); transition: width .3s ease; }
.stage {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem;
  width: 3.5rem; padding: 0; border: 0; background: none; cursor: pointer;
  font: 700 .8125rem/1.2 var(--round); color: var(--grass-ink); -webkit-tap-highlight-color: transparent;
}
.stage img {
  width: 3.5rem; height: 3.5rem; padding: .3rem; border-radius: 50%;
  background: #fff; border: 3px solid #fff; box-shadow: 0 3px 0 var(--hill-edge);
  transition: transform .15s;
}
.stage:hover img { transform: translateY(-2px); }
.stage[aria-pressed="true"] img { border-color: var(--blue); box-shadow: 0 3px 0 var(--blue-edge); }
.stage-note { margin-top: 1rem; font-size: .9375rem; font-weight: 600; color: var(--grass-ink); }

/* Facts */
.facts { background: #fff; padding-block: 5rem; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 4rem; margin-top: 2.75rem; }
.fact-grid p { margin-top: .4rem; color: var(--soft); max-width: 30rem; }
.extras { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--line); color: var(--soft); }

/* Support */
.support { background: #fff; padding-block: 1rem 6rem; scroll-margin-top: 1rem; }
.support .wrap > * { max-width: 40rem; }
.support p { margin-top: .9rem; color: var(--soft); }
.mail {
  display: inline-block; margin-block: 1.25rem 2rem;
  font: 800 clamp(1.35rem, 1rem + 1.6vw, 1.75rem)/1.2 var(--round);
}
details { border-top: 2px solid var(--line); }
details:last-of-type { border-bottom: 2px solid var(--line); }
summary { padding: 1rem 0; font-weight: 600; cursor: pointer; }
details p { margin: 0 0 1.1rem; }

/* Meadow: closing call, with the footer on the same ground. */
.meadow {
  margin-top: -3rem; padding-top: 3.5rem;
  background: var(--hill); border-radius: 50% 50% 0 0 / 3rem 3rem 0 0;
  text-align: center; color: var(--grass-ink);
}
.parade {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(.25rem, 1.5vw, 1.25rem);
  list-style: none; margin: 0 0 1.5rem; padding: 0;
}
.parade img { width: clamp(4rem, 11vw, 7rem); }
.meadow p { margin-top: .75rem; font-size: 1.125rem; }
.meadow .store { align-items: center; margin-top: 1.75rem; }
footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem;
  margin-top: 4.5rem; padding-block: 1.5rem 2rem; border-top: 2px solid var(--hill-edge);
  font-size: .9375rem; font-weight: 600; text-align: left;
}
footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
footer a { color: var(--grass-ink); }

/* Privacy and Terms */
.doc { padding-block: 2rem 5rem; }
.doc h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.25rem); max-width: none; }
.doc h2 { margin-top: 2.5rem; font-size: 1.35rem; letter-spacing: 0; }
.doc p { margin-top: .8rem; color: var(--soft); }
.doc .meta { margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: 1rem; background: #fff; box-shadow: 0 3px 0 var(--line); }
.doc .meta p { margin: 0; color: var(--ink); font-size: .9375rem; }
.plain-footer { margin-top: 0; border-top-color: var(--line); color: var(--soft); }
.plain-footer a { color: var(--soft); }

@media (max-width: 54rem) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 1rem 4rem; }
  .habitat { width: min(100%, 26rem); margin: 1.5rem auto 0; }
  .fact-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .facts { padding-block: 3.5rem; }
}
@media (max-width: 24rem) {
  :root { --pet: 224px; }
  .ground { padding-inline: 1rem; }
  .stage, .stage img { width: 3rem; }
  .stage img { height: 3rem; }
  .stages::before, .stages::after { top: calc(1.5rem - 3px); left: 1.5rem; }
  .stages::before { right: 1.5rem; }
  .stages::after { width: calc((100% - 3rem) * var(--p)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pet, .dot { animation: none; }
  .pet.happy { animation: none; }
  .stages::after, .stage img, .store { transition: none; }
}
