/* =========================================================
   ChaseMania · styles
   ========================================================= */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Lilita One";
  src: url("../fonts/lilita-one.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #5a3210;
  --text: #3a2410;
  --sky: #3fb8f0;
  --sky-deep: #1b8bd0;
  --sky-pale: #e3f5fd;
  --gold: #ffb627;
  --gold-soft: #ffd666;
  --cream: #fff7ea;
  --coral: #ff6b6b;
  --white: #ffffff;

  --font-body: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-display: "Lilita One", "Fredoka", "Arial Rounded MT Bold", sans-serif;

  --radius: 24px;
  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
}

/* ---------- Basics ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--sky-deep);
}

:focus-visible {
  outline: 4px dashed var(--sky-deep);
  outline-offset: 4px;
  border-radius: 8px;
}

.container {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  border: var(--border);
  border-radius: 12px;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Buttons, pills, stickers ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.7em 1.4em;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: var(--border);
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--ink);
}

.btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn--white {
  background: var(--white);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.9rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: var(--border);
  border-radius: 999px;
  transform: rotate(-2deg);
}

.eyebrow--white {
  background: var(--white);
}

.sticker {
  position: absolute;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: var(--white);
  font-family: var(--font-display);
  border: var(--border);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 4px solid var(--ink);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.6rem;
}

.site-logo img {
  height: 60px;
  width: auto;
  transition: transform 0.2s ease;
}

.site-logo:hover img {
  transform: rotate(-2deg) scale(1.03);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.4rem 0.9rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.site-nav a:hover {
  background: var(--sky-pale);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(5rem, 10vw, 8rem);
  background: linear-gradient(180deg, #6fcdf6 0%, #a9e2fa 60%, #d4f1fd 100%);
  overflow: hidden;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 2rem;
}

.hero__title {
  font-size: clamp(2.6rem, 6.5vw, 4.8rem);
  color: var(--white);
  text-shadow:
    -3px -3px 0 var(--ink), 3px -3px 0 var(--ink),
    -3px 3px 0 var(--ink), 3px 3px 0 var(--ink),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink),
    -3px 0 0 var(--ink), 3px 0 0 var(--ink),
    0 8px 0 var(--ink);
}

.hero__title span {
  display: inline-block;
  color: var(--gold);
}

.hero__lead {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 600;
  color: var(--ink);
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero__buddy {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
  padding-top: 3.5rem;
}

.chase-buddy {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  filter: drop-shadow(0 14px 0 rgba(90, 50, 16, 0.18));
  animation: float 4s ease-in-out infinite;
}

.chase-buddy img {
  width: 100%;
}

.chase-buddy.is-booped img {
  animation: boop 0.5s ease;
}

.speech-bubble {
  position: absolute;
  top: 0;
  left: -0.5rem;
  z-index: 2;
  margin: 0;
  padding: 0.6rem 1.1rem;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
  border: var(--border);
  border-radius: 20px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-4deg);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 2.2rem;
  bottom: -14px;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-right: var(--border);
  border-bottom: var(--border);
  transform: rotate(45deg);
}

/* Drifting clouds and a jet zooming past */
.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: 160px;
  height: 48px;
  background: var(--white);
  border-radius: 48px;
  opacity: 0.85;
  animation: drift 60s linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: var(--white);
  border-radius: 50%;
}

.cloud::before {
  width: 70px;
  height: 70px;
  left: 22px;
  top: -34px;
}

.cloud::after {
  width: 52px;
  height: 52px;
  left: 78px;
  top: -24px;
}

.cloud--1 { top: 12%; left: -10%; }
.cloud--2 { top: 55%; left: 30%; transform: scale(0.7); animation-duration: 80s; animation-delay: -30s; }
.cloud--3 { top: 28%; left: 70%; transform: scale(1.2); animation-duration: 70s; animation-delay: -50s; }

.plane {
  position: absolute;
  top: 7%;
  left: 0;
  width: clamp(130px, 16vw, 200px);
  animation: fly 16s linear infinite;
  animation-delay: 2s;
  transform: translateX(-100%);
}

.plane svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.wave {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(40px, 6vw, 90px);
  fill: var(--cream);
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.section--cream { background: var(--cream); }

.section--sky {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.25) 0 120px, transparent 121px),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.2) 0 180px, transparent 181px),
    var(--sky);
}

.section--gold {
  background-color: var(--gold-soft);
  background-image: url("../images/paw.svg");
  background-size: 90px;
}

.section-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.section-lead {
  max-width: 44rem;
  font-size: 1.25rem;
  font-weight: 500;
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  padding: 2.75rem 1.5rem 1.5rem;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step__icon {
  position: absolute;
  top: -28px;
  left: 1.5rem;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  border: var(--border);
  border-radius: 50%;
}

.step--gold .step__icon { background: var(--gold); }
.step--sky .step__icon { background: var(--sky); }
.step--coral .step__icon { background: var(--coral); }

.step h3 {
  font-size: 1.6rem;
}

.step p {
  margin: 0;
}

/* ---------- Games ---------- */

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 2rem;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 32px;
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
}

.game-card__image {
  position: relative;
  display: block;
  min-height: 360px;
  border-right: 4px solid var(--ink);
  overflow: hidden;
}

.game-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .game-card__image img {
  transform: scale(1.05);
}

.game-card .sticker {
  top: 18px;
  left: 18px;
  width: 84px;
  height: 84px;
  font-size: 1.4rem;
  border-radius: 50%;
  transform: rotate(-14deg);
  animation: pulse 2s ease-in-out infinite;
}

.game-card__body {
  align-self: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.game-card__number {
  margin: 0 0 0.25rem;
  color: var(--sky-deep);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.game-card__title {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.2rem 0.8rem;
  background: var(--sky-pale);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.mystery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.mystery-card {
  padding: 1.75rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.35);
  border: 4px dashed rgba(90, 50, 16, 0.55);
  border-radius: var(--radius);
}

.mystery-card__mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  background: var(--white);
  color: var(--sky-deep);
  font-family: var(--font-display);
  font-size: 2.4rem;
  border: var(--border);
  border-radius: 50%;
  animation: wobble 3s ease-in-out infinite;
}

.mystery-card h3 {
  font-size: 1.5rem;
}

.mystery-card p {
  margin: 0;
  color: var(--ink);
}

/* ---------- Meet Chase ---------- */

.meet {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.meet__photo {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 420px);
}

.meet__photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 10px solid var(--white);
  border-radius: 50%;
  outline: 4px solid var(--ink);
  box-shadow: 10px 12px 0 var(--ink);
  transform: rotate(-3deg);
}

.sticker--photo {
  right: 0;
  bottom: 8%;
  padding: 0.4rem 1rem;
  font-size: 1.2rem;
  border-radius: 14px;
  transform: rotate(6deg);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.fact {
  padding: 1rem 1.2rem;
  background: var(--white);
  border: var(--border);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink);
}

.fact dt {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
}

.fact dd {
  margin: 0;
}

/* ---------- Game pages ---------- */

.btn--small {
  padding: 0.45em 1.1em;
  font-size: 1.1rem;
}

.btn[hidden] {
  display: none;
}

.game-stage {
  padding: clamp(1.25rem, 3vw, 2rem) 0 clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(180deg, #6fcdf6 0%, #a9e2fa 70%, var(--cream) 100%);
}

.game-stage__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

.game-stage__title {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: var(--white);
  text-shadow:
    -3px -3px 0 var(--ink), 3px -3px 0 var(--ink),
    -3px 3px 0 var(--ink), 3px 3px 0 var(--ink),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink),
    -3px 0 0 var(--ink), 3px 0 0 var(--ink),
    0 6px 0 var(--ink);
}

.game-stage__title span {
  color: var(--gold);
}

.back-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* The 16:9 game screen is as big as fits below the header (but never tiny),
   and the title row above it lines up with the screen's edges. */
.game-shell {
  width: max(min(100% - 32px, 480px), min(100% - 32px, 1400px, calc((100svh - 250px) * 16 / 9)));
}

.game-frame {
  aspect-ratio: 16 / 9;
  background: #0a1f3f;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
}

.game-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.rotate-tip {
  display: none;
  margin: 1.25rem 0 0;
  text-align: center;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 600px) and (orientation: portrait) {
  .rotate-tip {
    display: block;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 3rem;
  background: var(--ink);
  color: var(--cream);
  text-align: center;
}

.site-footer__inner {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.site-footer__tag {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.35;
}

.site-footer__tag span {
  color: var(--gold-soft);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

.site-footer__nav a {
  color: var(--gold-soft);
  font-weight: 600;
}

.site-footer__small {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* ---------- Paw-print burst (added by main.js) ---------- */

.paw-pop {
  position: fixed;
  z-index: 60;
  font-size: 1.6rem;
  pointer-events: none;
  animation: paw-pop 0.9s ease-out forwards;
}

/* ---------- Animations ---------- */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes boop {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(0.9, 1.1) rotate(-6deg); }
  60% { transform: scale(1.08, 0.94) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes drift {
  from { translate: 0 0; }
  to { translate: 120vw 0; }
}

@keyframes fly {
  0% { transform: translateX(-100%) translateY(0) rotate(0); }
  25% { transform: translateX(calc(25vw - 50%)) translateY(-10px) rotate(-3deg); }
  50% { transform: translateX(calc(50vw - 50%)) translateY(0) rotate(0); }
  75% { transform: translateX(calc(75vw - 50%)) translateY(-8px) rotate(-2deg); }
  100% { transform: translateX(100vw) translateY(0) rotate(0); }
}

@keyframes pulse {
  0%, 100% { scale: 1; }
  50% { scale: 1.08; }
}

@keyframes wobble {
  0%, 100% { rotate: -6deg; }
  50% { rotate: 6deg; }
}

@keyframes paw-pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .plane { display: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .hero__inner,
  .meet {
    grid-template-columns: 1fr;
  }

  .hero__buddy {
    order: -1;
    width: min(70%, 280px);
  }

  .speech-bubble {
    font-size: 1.1rem;
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card__image {
    min-height: 0;
    aspect-ratio: 4 / 3;
    border-right: 0;
    border-bottom: 4px solid var(--ink);
  }
}

@media (max-width: 560px) {
  html { scroll-padding-top: 130px; }

  .site-header__inner {
    justify-content: center;
  }

  .site-logo img {
    height: 44px;
  }

  .site-nav a {
    padding: 0.3rem 0.6rem;
    font-size: 1rem;
  }

  .btn {
    font-size: 1.15rem;
  }
}
