/* Fatty Cat — colours come straight from the game's Palette.swift / SkyTheme.swift */
@font-face {
  font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-400.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-700.woff2") format("woff2");
}
:root {
  --sky: #62a6ec;
  --navy: #1b1e5e;
  --lavender: #b9bcf4;
  --yellow: #ffd21f;
  --pink: #ee5a96;
  --pink-dark: #6e1a40;
  --outline: #15151c;
  --white: #ffffff;
  --measure: 34rem;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--navy);
  font: 400 1.125rem/1.55 "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--pink); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 6px var(--navy); }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }

/* Pixel headings: SVG drawn by pixel.js from the game's 5x7 font */
.px { margin: 0; font-weight: 700; line-height: 1.1; --px-fill: var(--navy); }
.px svg { display: block; height: var(--px-h, 2rem); width: auto; max-width: 100%; }
.px-center svg { margin-inline: auto; }

/* ── Header ── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 3px 3px 0 var(--navy); }
.brand .px { --px-h: 1.6rem; --px-fill: var(--yellow); --px-extrude: var(--pink); --px-outline: var(--navy); }
.nav { display: flex; gap: 1.25rem; font-weight: 700; }
.nav a { text-decoration: none; padding: 0.4rem 0.1rem; }
.nav a:hover, .nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 4px; }

/* ── Hero ── */
.hero { --u: 3px; position: relative; overflow: hidden; background: var(--sky); text-align: center; padding-top: clamp(1.5rem, 5vw, 3.5rem); }
.hero::before {
  content: ""; position: absolute; display: none; top: 1.5rem; right: 2rem; width: calc(15 * var(--u)); height: calc(15 * var(--u));
  background: url(sun.png) 0 0 / 100% 100% no-repeat; image-rendering: pixelated;
}
.hero > .wrap { position: relative; }
/* The game's own river scene (cat, dog, bird, pillars), mirrored so it tiles edge to edge */
.scene {
  display: block; height: calc(113 * var(--u)); margin-top: 1.5rem;
  background: url(scene.png) calc(2 * var(--u) * 5) bottom / calc(240 * var(--u)) calc(113 * var(--u)) repeat-x;
  image-rendering: pixelated;
}
@media (min-width: 700px) { .hero { --u: 4px; } }
@media (min-width: 960px) { .hero::before { display: block; } }
.hero h1 { --px-h: clamp(4.25rem, 15vw, 8.5rem); --px-fill: var(--yellow); --px-extrude: var(--pink); --px-outline: var(--navy); }
.lede { max-width: var(--measure); margin: 1.25rem auto 1.75rem; font-size: 1.25rem; }
.cta {
  display: inline-block; padding: 0.85rem 1.5rem; font-weight: 700; font-size: 1.125rem;
  background: var(--yellow); color: var(--navy); text-decoration: none;
  border: 3px solid var(--outline); box-shadow: 5px 5px 0 var(--outline);
}
a.cta:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--outline); }
a.cta:active { transform: translate(5px, 5px); box-shadow: none; }
.cta-note { display: block; margin-top: 0.9rem; font-size: 0.95rem; }

/* Top button: a hop with a growing shadow, plus a shine sweep, every few seconds. Hover or focus calms it. */
a.cta { position: relative; overflow: hidden; }
a.cta-pulse { animation: cta-hop 2.6s cubic-bezier(.3,.7,.4,1) infinite; }
a.cta-pulse::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-20deg); animation: cta-shine 2.6s ease-in-out infinite;
}
a.cta-pulse:hover, a.cta-pulse:focus-visible, a.cta-pulse:active { animation: none; }
@keyframes cta-hop {
  0%, 55%, 100% { transform: translateY(0); box-shadow: 5px 5px 0 var(--outline); }
  65% { transform: translateY(-9px); box-shadow: 5px 14px 0 var(--outline); }
  75% { transform: translateY(0); box-shadow: 5px 5px 0 var(--outline); }
  84% { transform: translateY(-4px); box-shadow: 5px 9px 0 var(--outline); }
  92% { transform: translateY(0); box-shadow: 5px 5px 0 var(--outline); }
}
@keyframes cta-shine { 0%, 45% { left: -60%; } 70%, 100% { left: 130%; } }

/* ── Floating sound button: follows the visitor down the page ── */
.sound {
  position: fixed; z-index: 50; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: 3rem; height: 3rem; padding: 0.75rem; display: grid; place-items: center; cursor: pointer;
  background: var(--navy); color: var(--white); border: 3px solid var(--lavender); box-shadow: 4px 4px 0 var(--outline);
}
/* Sound is on but the browser is still waiting for a first tap: ring pulse and a short hint. */
.sound.pending { animation: sound-ring 1.6s ease-out infinite; }
.sound.pending::before {
  content: "Tap for sound"; position: absolute; right: calc(100% + 0.7rem); top: 50%; transform: translateY(-50%);
  padding: 0.35rem 0.6rem; white-space: nowrap; font-size: 0.85rem; font-weight: 700;
  background: var(--navy); color: var(--white); border: 2px solid var(--lavender);
}
@keyframes sound-ring { 0% { box-shadow: 4px 4px 0 var(--outline), 0 0 0 0 rgba(255,210,31,.9); } 100% { box-shadow: 4px 4px 0 var(--outline), 0 0 0 14px rgba(255,210,31,0); } }
@media (prefers-reduced-motion: reduce) { .sound.pending { animation: none; } }
.sound.docked { top: var(--sound-top, 1rem); bottom: auto; }
.sound svg { width: 100%; height: auto; }
.sound.is-on { background: var(--yellow); color: var(--navy); border-color: var(--outline); }
.sound:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--outline); }
.sound:active { transform: translate(4px, 4px); box-shadow: none; }

/* ── Closing call to action ── */
.final { background: var(--navy); color: var(--white); text-align: center; padding-block: clamp(3rem, 9vw, 5rem); }
.final h2 { --px-h: clamp(1.9rem, 6vw, 3rem); --px-fill: var(--yellow); --px-extrude: var(--pink); --px-outline: var(--outline); margin-bottom: 1.75rem; }
.final .cta { box-shadow: 5px 5px 0 var(--pink); border-color: var(--outline); }
.final .cta:hover { box-shadow: 3px 3px 0 var(--pink); }
.final .cta-note { color: var(--lavender); }

/* ── Screens ── */
.screens { background: var(--yellow); padding-block: clamp(3rem, 8vw, 5rem); }
.screens h2 { --px-h: clamp(1.9rem, 5vw, 2.6rem); }
.strip {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2rem max(1rem, calc((100% - 68rem) / 2)) 1.25rem; margin: 0;
  list-style: none; scrollbar-color: var(--navy) transparent;
}
.strip li { flex: 0 0 auto; scroll-snap-align: center; }
.strip img {
  width: clamp(13rem, 60vw, 16.5rem); border: 3px solid var(--outline);
  box-shadow: 6px 6px 0 var(--navy);
}

/* ── Panel (echoes the in-game "Pick a cat" panel) ── */
.inside { padding-block: clamp(3rem, 8vw, 5.5rem); }
.panel {
  background: var(--navy); color: var(--white);
  border: 4px solid var(--lavender); box-shadow: 8px 8px 0 rgba(21, 21, 28, 0.45);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  display: grid; gap: 2rem; align-items: center;
}
@media (min-width: 52rem) { .panel { grid-template-columns: 1.15fr 1fr; } }
.panel h2 { --px-h: clamp(1.9rem, 5vw, 2.6rem); --px-fill: var(--white); }
.facts { margin: 1.5rem 0 0; padding: 0; list-style: none; max-width: var(--measure); }
.facts li { padding: 0.7rem 0 0.7rem 1.6rem; border-top: 2px solid rgba(185, 188, 244, 0.35); position: relative; }
.facts li::before {
  content: ""; position: absolute; left: 0; top: 1.25rem; width: 0.6rem; height: 0.6rem;
  background: var(--yellow); box-shadow: 2px 2px 0 var(--pink);
}
.facts strong { color: var(--yellow); }
.panel img { justify-self: center; width: min(100%, 26rem); }

/* ── Text pages ── */
.page { padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 5rem); }
.page h1 { --px-h: clamp(2.6rem, 9vw, 4rem); --px-fill: var(--yellow); --px-extrude: var(--pink); --px-outline: var(--navy); }
.sheet {
  background: var(--white); border: 4px solid var(--navy); box-shadow: 8px 8px 0 var(--navy);
  padding: clamp(1.25rem, 4vw, 2.5rem); margin-top: 1.75rem; max-width: 46rem;
}
.sheet > :first-child { margin-top: 0; }
.sheet h2 { font-size: 1.35rem; margin: 2rem 0 0.5rem; }
.sheet p, .sheet li { max-width: var(--measure); }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 1.25rem 0 0.5rem; }
.contact .cta { box-shadow: 4px 4px 0 var(--navy); border-color: var(--navy); }
.mail { font-weight: 700; word-break: break-all; }
details { border-top: 2px solid var(--lavender); }
details:last-of-type { border-bottom: 2px solid var(--lavender); }
summary { cursor: pointer; font-weight: 700; padding: 0.85rem 0; margin-left: 1.1rem; display: list-item; }
details p { margin: 0 0 1rem 1.1rem; }
.updated { font-size: 0.95rem; color: #4a4e86; }

/* ── Footer: a row of pillar bricks ── */
.foot {
  background-color: var(--pink);
  background-image:
    linear-gradient(var(--pink-dark) 2px, transparent 2px),
    linear-gradient(90deg, var(--pink-dark) 2px, transparent 2px);
  background-size: 48px 18px, 48px 36px;
  border-top: 4px solid var(--outline);
  padding-block: 2.5rem;
}
.foot .wrap {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
  background: var(--navy); color: var(--white); padding: 1rem 1.25rem; border: 3px solid var(--lavender);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-weight: 700; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { text-decoration: underline; text-decoration-color: var(--yellow); }
.foot small { font-size: 0.95rem; }

@media (max-width: 30rem) {
  body { font-size: 1.0625rem; }
  .nav { gap: 0.9rem; font-size: 1rem; }
  .brand .px { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  a.cta:hover, a.cta:active { transform: none; }
  a.cta-pulse, a.cta-pulse::after { animation: none; }
}
