/* Home: a short pet-first stack (hero, the pet's picks, one friends card, an Around town link list). */

/* ---------- Hero ---------- */
.home-hero { background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.hero-scene {
  position: relative; min-height: 270px; display: grid; grid-template-columns: minmax(0, 440px) 1fr; align-items: end; gap: 0 12px;
  padding: 18px clamp(14px, 3vw, 32px) 0; background: linear-gradient(120deg, var(--land-from), var(--land-to));
}
.hero-scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-scene::before { /* keeps the text side readable over the plaza */
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, color-mix(in oklab, var(--land-from) 92%, transparent) 0 36%, color-mix(in oklab, var(--land-from) 55%, transparent) 50%, transparent 64%);
}
.hero-pet, .hero-text { position: relative; z-index: 2; }
.hero-pet { justify-self: center; display: block; line-height: 0; margin-bottom: -4px; filter: drop-shadow(0 6px 0 color-mix(in srgb, var(--ink) 18%, transparent)); }
.hero-text { align-self: center; padding-bottom: 12px; }
.hero-text h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); margin-bottom: .35em; }
.hero-text .speech { background: #fff; max-width: 400px; box-shadow: var(--shadow-sm); }
.hero-text .speech::before { left: auto; right: -11px; border: 10px solid transparent; border-left-color: var(--ink); border-right: 0; } /* the pet stands to the right */
.hero-lede { font-weight: 700; font-size: 1.1rem; max-width: 34ch; }

.hero-foot { padding: 14px clamp(14px, 3vw, 32px) 16px; border-top: var(--line) solid var(--ink); }

/* Word + bar rows, in the pet hero */
.hero-meters { display: grid; gap: 6px; margin: 0; font-size: var(--fs-sm); }
.hero-meters > div { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; }
.hero-meters dt { font-weight: 800; }
.hero-meters dd { margin: 0; text-align: right; color: var(--muted); font-weight: 700; }
.hero-meters .stat-bar { grid-column: 1 / -1; }

/* ---------- Home stack: pet, picks, friends, Around town ---------- */
.home-stack { display: grid; gap: var(--gap); max-width: 880px; margin-inline: auto; grid-template-columns: minmax(0, 1fr); }
.home-stack > .card { margin: 0; }
.home-stack h2 { font-size: 1.25rem; margin-bottom: 8px; }
.tile-more { font-weight: 700; margin-bottom: 0; }
@media (max-width: 560px) { .tile-more { text-align: center; } } /* the card's "more" link sits under its centred title */
.tile-count { margin: 0 0 6px; }
.home-stack .tile-more { margin-top: 12px; }

/* The pet's picks: one big tap row each */
.pick-list, .around-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pick-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; color: var(--ink); text-decoration: none;
  background: var(--hi-soft); border: 2px solid var(--ink); border-radius: var(--r-sm); }
.pick-list a > span:last-child { display: grid; min-width: 0; }
.pick-list small { color: var(--muted); font-weight: 700; }
.pick-list .done a { background: var(--tint); }
.pick-list .done b { text-decoration: line-through; text-decoration-thickness: 2px; }
.pick-list .goal-tick { flex: none; }

/* Around town: plain links with a status word on the right */
.around-list { gap: 0; }
.around-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 4px; font-weight: 700;
  border-bottom: 2px dashed var(--rule); text-decoration: none; }
.around-list li:last-child a { border-bottom: 0; }
.around-list small { color: var(--muted); font-weight: 700; text-align: right; }
@media (min-width: 768px) { .around-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } .around-list li:nth-last-child(2):nth-child(odd) a { border-bottom: 0; } }

@media (max-width: 767px) {
  .hero-foot { display: none; } /* the header strip shows the same three bars on phones */
  .hero-scene { min-height: 0; grid-template-columns: 1fr; padding-top: 14px; }
  .hero-pet svg { width: 130px; height: 130px; }
  .hero-scene::before { background: linear-gradient(180deg, color-mix(in oklab, var(--land-from) 85%, transparent) 0 55%, transparent 80%); }
  .hero-text { padding-bottom: 12px; text-align: center; }
  .hero-scene:not(:has(.hero-pet)) .hero-text { padding-bottom: 96px; } /* no pet: leave the plaza showing */
  .hero-text .speech { margin-inline: auto; }
  .hero-text .speech::before { display: none; }
  .hero-pet { justify-self: center; }
}

/* ---------- Landing (visitors): parade hero, live bits, species gallery, things to do, map, a day, closing sign-up ---------- */
.landing { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 56px); }
.landing section > h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: .3em; }
.sec-lede { max-width: 62ch; margin: 0 0 16px; }
.splash {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px 32px; align-items: center;
  background: linear-gradient(135deg, var(--card) 0%, color-mix(in oklab, var(--land-from) 60%, var(--card)) 100%);
  border: var(--line) solid var(--ink); border-radius: var(--r-card); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 44px);
}
.splash-tagline { margin: 0 0 6px; font: 600 1.25rem var(--display); color: var(--price); letter-spacing: .01em; }
.splash h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.2rem); }
.splash-tagline + h1 { margin-top: 0; }
.splash-count { margin: 14px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.splash-count b { color: var(--ink); font-family: var(--display); font-size: 1.1rem; }
.parade { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 0; justify-items: center; }
.parade li { animation: hop .7s cubic-bezier(.3, 1.8, .5, 1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
.parade li:nth-child(even) { translate: 0 14px; }
.parade li:last-child:nth-child(4n + 1) { grid-column: 1 / -1; }
.parade svg { width: 100%; max-width: 120px; height: auto; }
@keyframes hop { from { transform: translateY(40px) scale(.6); opacity: 0; } }

/* Live bits */
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.live-card { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; transition: translate .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.live-card:hover { translate: -2px -2px; box-shadow: var(--shadow-lift); }
.live-card svg { flex: none; width: 80px; height: 80px; }
.live-card > span { display: grid; gap: 2px; }
.live-card small { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--price); }
.live-card b { font-family: var(--display); font-size: 1.15rem; line-height: 1.25; }
.live .ticker { margin: 0; }

/* Species gallery */
.species-grid { --cols: 4; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); } /* 13 species: the odd one out sits centred on the last row */
.species-grid > li { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); min-width: 0; }
.species-card { display: grid; justify-items: center; text-align: center; align-content: start; gap: 6px; }
.species-card img { width: 140px; height: 140px; }
.species-card h3 { margin: 0; font-size: 1.2rem; }
.species-card h3 small { display: block; font-family: var(--body); font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.species-card p { margin: 0; font-size: var(--fs-sm); }
.paints { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: auto; padding-top: 6px; }
.paint {
  width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer;
  background: linear-gradient(135deg, var(--a), var(--b) 55%, var(--c)); transition: scale .15s var(--ease-out);
}
.paint:hover { scale: 1.12; }
.paint[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--pink); }
.paint:focus-visible { outline: 3px solid var(--sky); outline-offset: 5px; }

/* Things to do */
.doings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--gap); }
.doing { overflow: hidden; }
.doing .scene > svg { aspect-ratio: 2.6; min-height: 0; }
.doing h3 { margin: 0 0 4px; }
.doing p { margin: 0; }
.doing-fact { margin-top: 10px !important; font-weight: 800; font-size: var(--fs-sm); color: var(--price); }

/* A day in Glimmeria: a row of timestamped cards, one column on phones */
.day { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); counter-reset: none; }
.day li { display: grid; gap: 6px; align-content: start; }
.day svg { width: 56px; height: 56px; }
.day time { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--grape); }
.day p { margin: 0; font-size: var(--fs-sm); }

/* Closing sign-up */
.splash-end { grid-template-columns: minmax(0, 1fr) auto; }
.splash-end h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); margin: 0 0 .2em; }
.end-pets { display: flex; align-items: end; }

/* Sections fade up once as they scroll in (native scroll timeline; browsers without it just show them). */
@supports (animation-timeline: view()) {
  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  @keyframes reveal { from { opacity: 0; translate: 0 30px; } }
}
.reduce-motion .reveal, .reduce-motion .parade li { animation: none; }

@media (max-width: 980px) { .species-grid { --cols: 3; } }
/* 13 species never fill 2 or 3 columns: the odd card out becomes a full-width row (art left, text right) instead of a stranded half-width card */
@media (min-width: 768px) and (max-width: 980px) { .species-grid > li:last-child:nth-child(3n + 1) { flex-basis: 100%; } .species-grid > li:last-child:nth-child(3n + 1) { grid-template-columns: auto 1fr; justify-items: center; align-items: center; } .species-grid > li:last-child:nth-child(3n + 1) img { grid-row: 1 / span 4; } }
@media (max-width: 767px) { .species-grid > li:last-child:nth-child(odd) { flex-basis: 100%; } .species-grid > li:last-child:nth-child(odd) { grid-template-columns: auto 1fr; justify-items: center; align-items: center; } .species-grid > li:last-child:nth-child(odd) img { grid-row: 1 / span 4; } }
/* tablets: the hero stacks (a half-width h1 wrapped to five lines), centred, with the parade in two rows of six and the two sign-up buttons side by side */
@media (max-width: 1024px) {
  .splash { grid-template-columns: minmax(0, 1fr); }
  .splash-copy { text-align: center; }
  .splash .btn-row { justify-content: center; }
  .splash .btn-row .btn { flex: 1 1 200px; max-width: 280px; }
  .parade { grid-template-columns: repeat(6, 1fr); }
  .live-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .live-card { flex-direction: column; align-items: flex-start; } /* art above the text: a long username fits the card width instead of breaking mid-word */
  .live-card svg { width: 64px; height: 64px; }
  .live-card > span { min-width: 0; overflow-wrap: break-word; }
  /* swatches get a 44px hit area around the same 28px dot, three across so six wrap 3 + 3 */
  .species-card { padding-inline: 8px; }
  .paints { gap: 0; max-width: 140px; margin-inline: auto; }
  .paint { position: relative; width: 44px; height: 44px; background: none; border: 0; }
  .paint::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(135deg, var(--a), var(--b) 55%, var(--c)); }
  .paint[aria-pressed="true"] { box-shadow: none; }
  .paint[aria-pressed="true"]::before { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--pink); }
}
@media (max-width: 767px) {
  .splash, .splash-end { grid-template-columns: minmax(0, 1fr); }
  .parade { grid-template-columns: repeat(4, 1fr); }
  .splash .btn-row .btn { max-width: none; }
  .end-pets { justify-content: center; }
  .end-pets svg { width: 100px; height: 100px; }
  .species-grid { --cols: 2; gap: var(--gap-sm); }
  .species-grid > li { flex-basis: calc((100% - var(--gap-sm)) / 2); }
  .species-card img { width: 110px; height: 110px; }
}

/* Desktop bento: every tile is a column, so tiles that share a row with a taller neighbour spend the spare height instead of leaving a blank
   block. The footer link sits on the tile's bottom edge; the list, wallet figures or pet card in the middle stretches or centres. */
@media (min-width: 1180px) {
  .bento > .card { display: flex; flex-direction: column; }
  .bento .tile-more, .goals-card > p:last-child { margin-top: auto; padding-top: 12px; }
  .tile-pets .mini-pets { flex: 1; grid-auto-rows: 1fr; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .mini-pet { align-content: center; }
  .wallet dd { font-size: 1.6rem; }
  .wallet > div { display: grid; gap: 4px; }
  .goals-card .goal-list { flex: 1; display: grid; align-content: space-evenly; }
  .tile-quest .quests, .tile-games .game-list, .tile-market .tile-list, .tile-mail .tile-list { flex: 1; align-content: space-evenly; }
}

/* One-tap feed and the nap note under the pet's speech bubble. */
.hero-nap { margin: 8px 0 0; max-width: 400px; font-size: var(--fs-sm); background: color-mix(in srgb, #fff 80%, transparent); border-radius: var(--r-sm); padding: 6px 10px; }
.hero-feed-form { margin: 10px 0 0; }
.hero-feed { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; }
.hero-feed-form .hero-feed { margin-top: 0; }
