/* MichiTown front page.
   Layout rules: every gap and padding comes from the 8 px scale below, every
   card in a row shares one height, every picture sits in a fixed square box
   and is centred inside it. Animations only touch transform and opacity. */


@font-face { font-family: "MichiChewy"; src: url("fonts/MichiChewy.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-latin.woff2") format("woff2"); font-weight: 200 1000; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-latin-ext.woff2") format("woff2"); font-weight: 200 1000; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --r-lg: 24px; --r-md: 16px; --r-pill: 999px;
  --wrap: 1120px;
  --paper: #fbf6ec; --paper-2: #f3eadb; --card: #fffdf8;
  --ink: #4a3a32; --ink-soft: #7a6558; --line: #e8dccb;
  --terra: #c8735a; --terra-dk: #a65a43; --sage: #6f9a5b;
  --shadow: 0 1px 0 #fff inset, 0 8px 24px -12px #6b4a3a55;
  --font-display: "MichiChewy", "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  /* Season colours, set on body[data-season]. */
  --sky-1: #bfe2ee; --sky-2: #fdf1dc; --season: #e98fa5;
}
body[data-season="summer"] { --sky-1: #8fd0ec; --sky-2: #fff3c9; --season: #e9a93a; }
body[data-season="autumn"] { --sky-1: #e6c3a0; --sky-2: #fbe9d4; --season: #c8673a; }
body[data-season="winter"] { --sky-1: #c9d9ea; --sky-2: #f4f6fa; --season: #6f93c0; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--terra-dk); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; border-radius: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s3); }
.skip { position: absolute; left: var(--s2); top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: var(--s1) var(--s2); border-radius: var(--r-md); }
.skip:focus { top: var(--s2); }

/* Header */
.bar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.bar.is-stuck { border-bottom-color: var(--line); }
.bar__in { display: flex; align-items: center; gap: var(--s3); height: 64px; }
.brand { display: flex; align-items: center; gap: var(--s1); text-decoration: none; color: var(--ink); font: 1.5rem/1 var(--font-display); }
.brand img { width: 40px; height: 40px; transition: transform .4s var(--spring); }
.brand:hover img { transform: rotate(-10deg) scale(1.08); }
.nav { display: flex; gap: var(--s1); margin-left: auto; }
.nav a, .lang a { display: inline-flex; align-items: center; height: 40px; padding-inline: var(--s2); border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9375rem; transition: background-color .2s; }
.nav a:hover { background: var(--paper-2); }
.lang { display: flex; padding: 4px; gap: 4px; background: var(--paper-2); border-radius: var(--r-pill); }
.lang a { height: 32px; padding-inline: 12px; font-size: .8125rem; letter-spacing: .04em; min-width: 44px; justify-content: center; }
.lang a[aria-current] { background: var(--card); box-shadow: var(--shadow); color: var(--terra-dk); }

/* Hero */
.hero { position: relative; overflow: hidden; padding-top: var(--s7); text-align: center; isolation: isolate;
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2) 80%); transition: background-color .6s; }
.hero::before { /* soft watercolour blooms */ content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 30% at 20% 25%, #ffffff88, transparent 70%), radial-gradient(35% 25% at 80% 15%, #ffffff66, transparent 70%); }
.hero__sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero__in { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.eyebrow { font-weight: 800; font-size: .8125rem; text-transform: uppercase; letter-spacing: .14em; color: var(--terra-dk); }
.hero__title { font-size: clamp(3.5rem, 11vw, 7.5rem); color: var(--ink); display: flex; justify-content: center;
  }
.hero__title span { display: inline-block; animation: drop .9s var(--spring) both; animation-delay: calc(var(--n, 0) * 60ms + 100ms); }
.hero__title { gap: clamp(1px, .3vw, 4px); align-items: flex-end; filter: drop-shadow(0 4px 0 #ffffffaa) drop-shadow(0 10px 20px #6b4a3a33); }
.hero__title { font-family: var(--font-display); font-size: min(150px, calc((100vw - 64px) / 5.6)); line-height: 1; color: #1f1714; }
.hero__title span:nth-child(7) { color: #c85a3c; } /* the T (child 1 is the hidden label) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero__title span:hover { animation: jelly .6s var(--spring); }
.hero__lead { max-width: 40rem; font-size: 1.1875rem; color: var(--ink-soft); }
.hero__cta { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 56px; padding-inline: var(--s4); border-radius: var(--r-pill);
  font-weight: 800; font-size: 1.0625rem; text-decoration: none; color: var(--ink); background: var(--card);
  box-shadow: 0 4px 0 var(--line), var(--shadow); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line), var(--shadow); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line), var(--shadow); }
.btn--primary { background: var(--terra); color: #fff; box-shadow: 0 4px 0 var(--terra-dk), var(--shadow); }
.btn--primary:hover { box-shadow: 0 6px 0 var(--terra-dk), var(--shadow); }
.btn--primary:active { box-shadow: 0 1px 0 var(--terra-dk), var(--shadow); }

.parade { list-style: none; margin: var(--s6) auto 0; padding: 0 var(--s3); display: grid; grid-template-columns: repeat(8, 96px);
  justify-content: center; gap: var(--s2); position: relative; z-index: 1; }
.parade li { animation: bob 4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.5s); }
.parade a { display: block; width: 96px; height: 96px; border-radius: 50%; transition: transform .35s var(--spring); }
.parade a:hover, .parade a:focus-visible { transform: translateY(-8px) scale(1.08); }
.parade img { width: 96px; height: 96px; filter: drop-shadow(0 6px 6px #4a3a3233); }
.ground { height: 64px; margin-top: -24px; background: url("img/floors/meadow.webp") center / 256px repeat-x;
  -webkit-mask: linear-gradient(180deg, transparent, #000 40%); mask: linear-gradient(180deg, transparent, #000 40%); transition: filter .6s; }
body[data-season="autumn"] .ground { filter: hue-rotate(-45deg) saturate(1.1); }
body[data-season="winter"] .ground { background-image: url("img/floors/snow.webp"); }
body[data-season="summer"] .ground { filter: saturate(1.25); }

/* Sections */
.section { padding-block: var(--s7); }
.section--tint { background: var(--paper-2); }
.section__head { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; margin-bottom: var(--s5); }
.section__head h2 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.section__lead { max-width: 36rem; color: var(--ink-soft); }
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--line); }

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.feature { display: grid; grid-row: span 3; grid-template-rows: subgrid; justify-items: center; align-items: start; gap: var(--s2); padding: var(--s4) var(--s3); text-align: center;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: 0 1px 0 #fff inset, 0 16px 32px -12px #6b4a3a55; }
.feature img { width: 80px; height: 80px; object-fit: contain; transition: transform .4s var(--spring); }
.feature:hover img { transform: rotate(-6deg) scale(1.08); }
.feature h3 { font-size: 1.75rem; color: var(--terra-dk); align-self: center; }
.feature p { color: var(--ink-soft); font-size: 1rem; }

/* Neighbours */
.cats { display: grid; grid-template-columns: 280px 1fr; gap: var(--s3); align-items: start; }
.cats__list { display: grid; grid-template-columns: 1fr; gap: var(--s1); }
.chip { display: flex; align-items: center; gap: var(--s2); height: 64px; padding: 0 var(--s2) 0 var(--s1); width: 100%;
  border: 1px solid transparent; border-radius: var(--r-md); background: transparent; color: var(--ink);
  font: 700 1rem/1 var(--font-body); text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s, transform .2s var(--ease); }
.chip img { width: 48px; height: 48px; transition: transform .35s var(--spring); }
.chip:hover { background: var(--card); }
.chip:hover img { transform: scale(1.1) rotate(-4deg); }
.chip[aria-selected="true"] { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); color: var(--terra-dk); }
.cat { display: grid; grid-template-columns: 320px 1fr; gap: var(--s4); padding: var(--s4); min-height: 100%; align-items: center; }
.cat__portrait { position: relative; width: 320px; height: 320px; border: 0; padding: 0; cursor: pointer; border-radius: 50%;
  background: radial-gradient(closest-side, #fff, var(--paper-2)); touch-action: manipulation; }
.cat__face { width: 320px; height: 320px; transition: opacity .18s ease, transform .35s var(--spring); }
.cat__portrait:hover .cat__face { transform: scale(1.03); }
.cat__portrait.is-petted .cat__face { animation: squish .5s var(--spring); }
.cat__face.is-swapping { opacity: 0; }
.cat__hearts { position: absolute; inset: 0; pointer-events: none; }
.heart { position: absolute; left: 50%; top: 40%; width: 24px; height: 24px; margin: -12px 0 0 -12px; color: #e86a86;
  animation: float-up 1.1s var(--ease) forwards; }
.cat__body { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.cat__role { font-weight: 800; font-size: .8125rem; text-transform: uppercase; letter-spacing: .14em; color: var(--sage); }
.cat__name { font-size: 2.75rem; color: var(--ink); }
.cat__bio { color: var(--ink-soft); }
.cat__facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: 0; }
.cat__facts div { padding: 12px var(--s2); border-radius: var(--r-md); background: var(--paper); }
.cat__facts dt { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.cat__facts dd { margin: 4px 0 0; font-weight: 700; font-size: .9375rem; }
.moods { display: grid; grid-template-columns: repeat(5, 56px); gap: var(--s1); }
.mood { position: relative; width: 56px; height: 56px; padding: 4px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper);
  cursor: pointer; transition: border-color .2s, transform .25s var(--spring); }
.mood img { width: 44px; height: 44px; }
.mood:hover { transform: translateY(-3px); }
.mood[aria-pressed="true"] { border-color: var(--terra); background: var(--card); box-shadow: 0 0 0 3px #c8735a33; }
.mood::after { content: attr(data-label); position: absolute; left: 50%; top: calc(100% + 6px); transform: translate(-50%, -4px); white-space: nowrap;
  padding: 4px 8px; border-radius: 8px; background: var(--ink); color: #fff; font: 700 .75rem/1.2 var(--font-body); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 2; }
.mood:hover::after, .mood:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* Seasons */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; max-width: 640px; margin: 0 auto var(--s4);
  background: var(--paper-2); border-radius: var(--r-pill); position: relative; }
.seg__btn { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: var(--s1); height: 48px;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink); font: 800 1rem/1 var(--font-body); cursor: pointer; transition: color .25s; }
.seg__btn img { width: 28px; height: 28px; }
.seg__thumb { position: absolute; top: 4px; left: 4px; height: 48px; width: calc((100% - 20px) / 4); border-radius: var(--r-pill);
  background: var(--card); box-shadow: var(--shadow); transition: transform .45s var(--spring); }
.seg__btn[aria-selected="true"] { color: var(--terra-dk); }
.season { display: grid; grid-template-columns: 240px 1fr; overflow: hidden; max-width: 880px; margin-inline: auto; min-height: 280px; }
.season__sky { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2)); transition: background .6s; }
.season__weather { width: 96px; height: 96px; animation: bob 5s ease-in-out infinite; }
.season__temp { font: 2.5rem/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.season__body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); }
.season__name { font-size: 2.5rem; color: var(--season); transition: color .4s; }
.season__festival { display: inline-flex; align-self: flex-start; align-items: center; gap: var(--s1); height: 32px; padding-inline: 12px;
  border-radius: var(--r-pill); background: var(--paper); font-weight: 800; font-size: .875rem; }
.season__crops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, 72px); gap: var(--s2); }
.season__crops li { width: 72px; height: 72px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--paper);
  animation: pop .45s var(--spring) both; animation-delay: calc(var(--i) * 70ms); }
.season__crops img { width: 60px; height: 60px; object-fit: contain; }
.season__crops .is-empty { width: auto; height: auto; grid-column: 1 / -1; padding: var(--s2); place-items: start; color: var(--ink-soft); animation: none; }
.season__body > * { transition: opacity .25s; }
.season.is-swapping .season__body > *, .season.is-swapping .season__sky > * { opacity: 0; }

/* News + footer */
.news__in img { width: 160px; height: 160px; }
.news__in { display: grid; grid-template-columns: 160px 1fr; gap: var(--s4); align-items: center; max-width: 880px; }
.news__in h2 { font-size: 2.25rem; margin-bottom: var(--s1); }
.news__in p { color: var(--ink-soft); }
.foot { padding-block: var(--s4); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .9375rem; }
.foot__in { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; }

/* Reveal on scroll (set up by home.js; without JS everything is visible). */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.is-in { opacity: 1; transform: none; }


/* Paw prints: a trail between sections, a print where you click, paws as bullets. */
:root { --paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cellipse cx='32' cy='42' rx='14' ry='12'/%3E%3Cellipse cx='14' cy='26' rx='6' ry='8' transform='rotate(-20 14 26)'/%3E%3Cellipse cx='26' cy='16' rx='6' ry='8' transform='rotate(-6 26 16)'/%3E%3Cellipse cx='38' cy='16' rx='6' ry='8' transform='rotate(6 38 16)'/%3E%3Cellipse cx='50' cy='26' rx='6' ry='8' transform='rotate(20 50 26)'/%3E%3C/svg%3E"); }
.paw { display: inline-block; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--paw) center / contain no-repeat; mask: var(--paw) center / contain no-repeat; }
.trail { display: flex; justify-content: center; gap: var(--s3); height: 48px; align-items: center; color: #c8735a40; margin: 0; padding: 0; list-style: none; }
.trail li { width: 22px; height: 22px; transform: translateY(var(--y)) rotate(90deg); opacity: 0; transition: opacity .3s; transition-delay: calc(var(--i) * 140ms); }
.trail li:nth-child(odd) { --y: -8px; }
.trail li:nth-child(even) { --y: 8px; }
.trail.is-in li, html:not(.js) .trail li { opacity: 1; }
.tap { position: absolute; z-index: 60; width: 24px; height: 24px; margin: -12px 0 0 -12px; color: var(--terra); pointer-events: none; animation: tap 1.2s var(--ease) forwards; }
@keyframes tap { 0% { opacity: 0; transform: rotate(var(--r)) scale(.4); } 20% { opacity: .7; transform: rotate(var(--r)) scale(1); } 100% { opacity: 0; transform: rotate(var(--r)) scale(1); } }
.season__festival .paw, .eyebrow .paw { width: 14px; height: 14px; color: var(--terra); }
.eyebrow { display: inline-flex; align-items: center; gap: var(--s1); }
@media (prefers-reduced-motion: reduce) { .trail li { opacity: 1; } .tap { display: none; } }

@keyframes drop { from { opacity: 0; transform: translateY(-40px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes jelly { 30% { transform: scale(1.15, .85); } 60% { transform: scale(.92, 1.08); } 100% { transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes squish { 30% { transform: scale(1.06, .94); } 60% { transform: scale(.97, 1.03); } 100% { transform: none; } }
@keyframes float-up { from { opacity: 1; transform: translate(var(--dx), 0) scale(.6); } to { opacity: 0; transform: translate(calc(var(--dx) * 2), -140px) scale(1.2); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* Responsive: columns collapse whole, never leaving a ragged row. */
@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: 1fr; }
  .cats__list { grid-template-columns: repeat(4, 1fr); }
  .chip { flex-direction: column; justify-content: center; gap: 4px; height: 88px; padding: var(--s1); text-align: center; font-size: .875rem; }
  .parade { grid-template-columns: repeat(4, 96px); }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
  .cat { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: var(--s3); }
  .cat__portrait, .cat__face { width: 240px; height: 240px; }
  .cat__body { align-items: center; }
  .cat__facts { width: 100%; text-align: left; }
  .moods { justify-content: center; }
  .season { grid-template-columns: 1fr; }
  .season__sky { padding: var(--s3); flex-direction: row; }
  .seg__btn img { display: none; }
  .seg__btn { font-size: .875rem; }
  .season__crops { grid-template-columns: repeat(4, 1fr); }
  .season__crops li { width: auto; height: auto; aspect-ratio: 1; }
  .hero__cta { flex-direction: column; width: 100%; max-width: 320px; }
  .hero__cta .btn { width: 100%; }
  .news__in { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .foot__in { justify-content: center; text-align: center; }
}
@media (max-width: 480px) {
  .features { grid-template-columns: 1fr; }
  .parade { grid-template-columns: repeat(4, 64px); gap: var(--s1); }
  .parade a, .parade img { width: 64px; height: 64px; }
  .cats__list { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .chip span { font-size: .75rem; }
  .cat__facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
