/* ==========================================================
   COCO — Professional Good Boy
   Palette: grounded in Coco's world
   ---------------------------------------------------------- */

/* ============ SELF-HOSTED FONTS (/fonts/) ============
   Download the .ttf files from Google Fonts (see steps in chat/README)
   and place them in a /fonts/ folder next to index.html:
     fonts/TitanOne-Regular.ttf
     fonts/PatrickHand-Regular.ttf
     fonts/Nunito-Regular.ttf
     fonts/Nunito-Bold.ttf        (700)
     fonts/Nunito-ExtraBold.ttf   (800)
     fonts/Nunito-Italic.ttf      (400 italic)
   font-display: swap → text shows immediately in the fallback, then
   swaps to the web font once loaded (no invisible-text flash). */
@font-face {
  font-family: "Titan One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/TitanOne-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Patrick Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/PatrickHand-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Nunito-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Nunito-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/Nunito-ExtraBold.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Nunito-Italic.ttf") format("truetype");
}

:root {
  --ball:       #c6e534;   /* tennis ball — ball is lyfe */
  --ball-dark:  #9dbb1a;
  --sky:        #58b7e6;   /* San Diego sky */
  --sky-deep:   #2a86bd;
  --link:       #1c6494;   /* AA-compliant link/interactive blue on paper */
  --caramel:    #e0a458;   /* doodle fur */
  --kibble:     #3c2a18;   /* text / near-brown-black */
  --paper:      #fffdf4;   /* polaroid + card paper */
  --sand:       #fdf3da;   /* section background */
  --coral:      #ff6b57;   /* treat button (decorative fill) */
  --coral-text: #cf3c24;   /* coral dark enough for white text (AA) */

  --font-display: "Titan One", system-ui, sans-serif;
  --font-hand:    "Patrick Hand", cursive;
  --font-body:    "Nunito", system-ui, sans-serif;

  --shadow-card: 0 6px 0 rgba(60, 42, 24, 0.18);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Skip link — visible only when focused */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--kibble);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 800;
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--ball);
  outline-offset: 2px;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--kibble);
  background: var(--sand);
  line-height: 1.55;
  overflow-x: hidden;
}

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

.nowrap { white-space: nowrap; }

/* ============ LANGUAGE SWITCHER ============ */
.lang-switch {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: end;
  justify-items: stretch;
  width: fit-content;
  gap: 0.15rem;
  background: var(--paper);
  border: 3px solid var(--kibble);
  border-radius: 14px;
  box-shadow: 0 4px 0 rgba(60,42,24,0.3);
  padding: 0.2rem;
}
.lang-btn {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--kibble);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0.32rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s ease;
  line-height: 1;
}
.lang-btn:hover { background: var(--sand); }
.lang-btn.active {
  background: var(--ball);
  cursor: default;
}
.lang-btn:focus-visible {
  outline: 3px solid var(--sky-deep);
  outline-offset: 1px;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,0.35), transparent 40%),
    linear-gradient(180deg, var(--sky) 0%, #7fcaee 70%, var(--sand) 100%);
  padding: clamp(3.5rem, 9vw, 7rem) 1.25rem 5.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-inner { position: relative; z-index: 2; max-width: 46rem; margin: 0 auto; }

.hero-eyebrow {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  background: var(--paper);
  border: 3px solid var(--kibble);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  box-shadow: 0 4px 0 rgba(60,42,24,0.25);
  margin: 0 0 1.25rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 18vw, 11rem);
  line-height: 0.95;
  margin: 0;
  color: var(--paper);
  -webkit-text-stroke: 4px var(--kibble);
  text-shadow: 0.06em 0.08em 0 var(--ball-dark);
  letter-spacing: 0.02em;
}

.hero-name span { display: inline-block; animation: bounce-in 0.7s cubic-bezier(.28,1.6,.45,1) backwards; }
.hero-name span:nth-child(1) { animation-delay: 0.05s; }
.hero-name span:nth-child(2) { animation-delay: 0.15s; }
.hero-name span:nth-child(3) { animation-delay: 0.25s; }
.hero-name span:nth-child(4) { animation-delay: 0.35s; }

@keyframes bounce-in {
  from { transform: translateY(-120%) rotate(-8deg); opacity: 0; }
  to   { transform: translateY(0) rotate(0); opacity: 1; }
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  font-weight: 700;
  margin: 1rem auto 2rem;
  color: #123a52;
}

.age-card {
  background: var(--paper);
  border: 3px solid var(--kibble);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.4rem;
  max-width: 34rem;
  margin: 0 auto 2rem;
  transform: rotate(-1.2deg);
}

.age-line { margin: 0 0 0.35rem; font-size: 1.15rem; }
.age-line strong { color: var(--sky-deep); }
.age-sub { display: block; font-size: 0.95rem; font-weight: 400; color: #6b543b; }
.age-bday { margin: 0; font-family: var(--font-hand); font-size: 1.1rem; color: #6b543b; }

.hero-cta {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--kibble);
  background: var(--ball);
  border: 3px solid var(--kibble);
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--kibble);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.hero-cta:hover  { transform: translateY(-3px); box-shadow: 0 8px 0 var(--kibble); }
.hero-cta:active { transform: translateY(2px);  box-shadow: 0 3px 0 var(--kibble); }

/* Bouncing tennis ball */
.ball {
  position: absolute;
  bottom: 8%;
  left: -60px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, #e3f970 0 18%, transparent 19%),
    var(--ball);
  border: 3px solid var(--ball-dark);
  z-index: 1;
  animation: ball-roll 9s linear infinite;
  cursor: pointer;
  pointer-events: auto;
}
.ball.popped { animation: ball-pop 0.5s ease forwards; }
@keyframes ball-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5) rotate(30deg); }
  100% { transform: scale(0) rotate(90deg); opacity: 0; }
}
.ball::after {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.85);
  border-left-color: transparent;
  border-right-color: transparent;
  transform: rotate(25deg);
}

/* Orange (basketball-ish) variant */
.ball-orange {
  background:
    radial-gradient(circle at 32% 30%, #ffb257 0 18%, transparent 19%),
    #f47c20;
  border-color: #c25a10;
}

/* Per-ball size / position / timing so they don't move in lockstep */
.ball-1 { bottom: 8%;  width: 46px; height: 46px; animation-duration: 9s;  animation-delay: 0s;    }
.ball-2 { bottom: 22%; width: 30px; height: 30px; animation-duration: 7s;  animation-delay: -3s; animation-name: ball-roll-2; }
.ball-3 { bottom: 4%;  width: 54px; height: 54px; animation-duration: 12s; animation-delay: -6s;   }
.ball-4 { bottom: 32%; width: 24px; height: 24px; animation-duration: 6.5s; animation-delay: -1.5s; animation-name: ball-roll-2; }

@keyframes ball-roll {
  0%   { transform: translateX(0) translateY(0) rotate(0); }
  10%  { transform: translateX(12vw)  translateY(-70px) rotate(180deg); }
  20%  { transform: translateX(24vw)  translateY(0)     rotate(360deg); }
  30%  { transform: translateX(36vw)  translateY(-50px) rotate(540deg); }
  40%  { transform: translateX(48vw)  translateY(0)     rotate(720deg); }
  50%  { transform: translateX(60vw)  translateY(-35px) rotate(900deg); }
  60%  { transform: translateX(72vw)  translateY(0)     rotate(1080deg); }
  70%  { transform: translateX(84vw)  translateY(-22px) rotate(1260deg); }
  80%  { transform: translateX(96vw)  translateY(0)     rotate(1440deg); }
  100% { transform: translateX(115vw) translateY(0)     rotate(1700deg); }
}

/* A bouncier, higher path for the smaller balls */
@keyframes ball-roll-2 {
  0%   { transform: translateX(0) translateY(0) rotate(0); }
  12%  { transform: translateX(15vw)  translateY(-100px) rotate(-200deg); }
  25%  { transform: translateX(30vw)  translateY(0)      rotate(-400deg); }
  37%  { transform: translateX(45vw)  translateY(-80px)  rotate(-600deg); }
  50%  { transform: translateX(60vw)  translateY(0)      rotate(-800deg); }
  62%  { transform: translateX(75vw)  translateY(-55px)  rotate(-1000deg); }
  75%  { transform: translateX(90vw)  translateY(0)      rotate(-1200deg); }
  88%  { transform: translateX(104vw) translateY(-30px)  rotate(-1400deg); }
  100% { transform: translateX(118vw) translateY(0)      rotate(-1600deg); }
}

/* ============ TICKER ============ */
.ticker {
  background: var(--kibble);
  color: var(--ball);
  overflow: hidden;
  padding: 0.55rem 0;
  border-top: 3px solid var(--kibble);
  border-bottom: 3px solid var(--kibble);
}
.ticker-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  animation: ticker-scroll 22s linear infinite;
}
.ticker-track span { white-space: nowrap; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============ SECTIONS ============ */
section { padding: clamp(3rem, 7vw, 5rem) 1.25rem; max-width: 72rem; margin: 0 auto; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  text-align: center;
  margin: 0 0 0.4rem;
  color: var(--kibble);
  text-shadow: 0.05em 0.07em 0 var(--caramel);
}
.section-sub {
  text-align: center;
  font-size: 1.1rem;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  color: #6b543b;
}

/* ============ FACTS ============ */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}

.fact-card {
  background: var(--paper);
  border: 3px solid var(--kibble);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.3rem 1.4rem 1.4rem;
  transition: transform 0.15s ease;
}
.fact-card:nth-child(odd)  { transform: rotate(-0.7deg); }
.fact-card:nth-child(even) { transform: rotate(0.7deg); }
.fact-card:hover { transform: rotate(0) translateY(-4px); }

.fact-emoji { font-size: 1.9rem; display: block; margin-bottom: 0.3rem; }
.fact-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
  color: var(--sky-deep);
}
.fact-card p { margin: 0; }

.meter {
  height: 16px;
  background: #efe6cf;
  border: 2px solid var(--kibble);
  border-radius: 999px;
  overflow: visible;
  margin: 0.5rem 0 0.4rem;
  position: relative;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: repeating-linear-gradient(45deg, var(--ball) 0 10px, var(--ball-dark) 10px 20px);
}
.meter-overflow { width: 100%; animation: meter-pulse 1.6s ease-in-out infinite; }
.meter-eleven   { width: 110%; background: repeating-linear-gradient(45deg, var(--coral) 0 10px, #d94a37 10px 20px); }
@keyframes meter-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
.meter-label { font-size: 0.9rem; color: #6b543b; }

/* ============ TRICK TAX ============ */
.tricks { position: relative; }

.trick-stage {
  background: var(--paper);
  border: 3px solid var(--kibble);
  border-radius: calc(var(--radius) * 1.4);
  box-shadow: var(--shadow-card);
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.2rem;
  text-align: center;
}

/* ---- Coco SVG doodle stage ---- */
.coco-stage {
  position: relative;
  width: 176px;
  height: 220px;
  margin: 0 auto;
  cursor: grab;
  z-index: 1;
  /* how big Coco gets during his post-trick "showcase" moment */
  --showcase-scale: 2.2;
}
.coco-stage:active { cursor: grabbing; }

/* soft spotlight that fades in behind him while he's big */
.coco-stage::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198,229,52,0.35) 0%, rgba(198,229,52,0.12) 45%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.coco-stage.showcase::before { opacity: 1; }

/* the zoom itself — scales the wrapper so .coco-dog's trick animation still runs */
.coco-stage.showcase {
  z-index: 40;
  pointer-events: none;      /* keep the trick buttons clickable underneath */
  will-change: transform;
  /* grow mostly downward into the card rather than up over the heading */
  transform-origin: 50% 32%;
  animation: stage-showcase 1.5s cubic-bezier(.34, 1.4, .64, 1) both;
}
@keyframes stage-showcase {
  0%   { transform: scale(1); }
  15%  { transform: scale(var(--showcase-scale)); }
  75%  { transform: scale(var(--showcase-scale)); }
  100% { transform: scale(1); }
}
.coco-dog {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: 50% 90%;
}

/* sleeping (idle) — slow breathing, closed eyes, tail still */
.coco-dog.sleeping { animation: coco-sleep 3.4s ease-in-out infinite; }
.coco-dog.sleeping .dog-eyes { opacity: 0; }
.coco-dog.sleeping .dog-eyes-closed { opacity: 1; }
.coco-dog.sleeping .dog-tail { animation: none; }
@keyframes coco-sleep {
  0%,100% { transform: translateY(0) scale(1) rotate(-2deg); }
  50%     { transform: translateY(3px) scale(1.02) rotate(-2deg); }
}

/* being petted */
.coco-dog.petting .dog-eyes { opacity: 0; }
.coco-dog.petting .dog-eyes-closed { opacity: 1; }
.coco-dog.petting .dog-tail { animation-duration: 0.22s; }
.coco-dog.petting .dog-head { animation: pet-nuzzle 0.5s ease-in-out infinite; }
@keyframes pet-nuzzle {
  0%,100% { transform: rotate(-3deg); }
  50%     { transform: rotate(3deg); }
}

/* animatable parts */
.dog-head { transform-origin: 110px 78px; }
.dog-tail { transform-origin: 164px 168px; animation: tail-wag 0.6s ease-in-out infinite; }
.dog-ear  { transform-origin: 110px 58px; }
.dog-bandana { transform-origin: 110px 132px; }
.dog-tongue { opacity: 0; transform-origin: 110px 90px; }
.dog-eyes-closed { opacity: 0; }

/* idle tail wag, always on (calm) */
@keyframes tail-wag {
  0%,100% { transform: rotate(-8deg); }
  50%     { transform: rotate(14deg); }
}

/* base breathing bob */
.coco-dog { animation: coco-breathe 3s ease-in-out infinite; }
@keyframes coco-breathe {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-2px) scale(1.01); }
}

/* ===== per-trick animations (class added to #coco-dog) ===== */
.coco-dog.t-sit        { animation: t-sit 0.7s ease both; }
.coco-dog.t-shake      { animation: none; }
.coco-dog.t-shake #dog-paw-right { animation: paw-shake 0.7s ease; }
.coco-dog.t-turnaround { animation: t-spin 0.8s ease both; }
.coco-dog.t-speak      { animation: t-speak 0.5s ease both; }
.coco-dog.t-kiss       { animation: t-lean 0.7s ease both; }
.coco-dog.t-hug        { animation: t-hug 0.8s ease both; }
.coco-dog.t-love       { animation: coco-breathe 3s ease-in-out infinite; }
.coco-dog.t-chin       { animation: t-chin 0.9s ease both; }
.coco-dog.t-paw        { animation: none; }
.coco-dog.t-paw #dog-paw-left { animation: paw-lift 0.7s ease; }
.coco-dog.t-cross      { animation: t-tilt 0.8s ease both; }
.coco-dog.t-peekaboo   { animation: t-hop 0.7s ease both; }
.coco-dog.t-sitnext    { animation: t-scoot 0.8s ease both; }
.coco-dog.sighing      { animation: t-sigh 1s ease both; }

/* show tongue / happy eyes on certain tricks (toggled via body-state classes) */
.coco-dog.happy .dog-tongue { opacity: 1; animation: tongue-bob 0.5s ease; }
.coco-dog.happy .dog-eyes { opacity: 0; }
.coco-dog.happy .dog-eyes-closed { opacity: 1; }

@keyframes t-sit      { 30%{transform:translateY(16px) scaleY(0.86)} 100%{transform:translateY(11px) scaleY(0.92)} }
@keyframes t-spin     { 100%{transform:rotateY(360deg)} }
@keyframes t-speak    { 0%,100%{transform:scale(1)} 40%{transform:scale(1.08) translateY(-5px)} }
@keyframes t-lean     { 0%,100%{transform:rotate(0)} 50%{transform:rotate(-9deg) translateX(-7px)} }
@keyframes t-hug      { 0%,100%{transform:scale(1)} 50%{transform:scale(1.07)} }
@keyframes t-chin     { 0%,100%{transform:translateY(0)} 50%{transform:translateY(16px) rotate(-3deg)} }
@keyframes t-tilt     { 0%,100%{transform:rotate(0)} 50%{transform:rotate(7deg)} }
@keyframes t-hop      { 0%,100%{transform:translateY(0)} 40%{transform:translateY(-30px)} 70%{transform:translateY(0)} }
@keyframes t-scoot    { 0%{transform:translateX(0)} 60%{transform:translateX(16px)} 100%{transform:translateX(9px)} }
@keyframes t-sigh     { 0%{transform:scale(1)} 30%{transform:scale(1.09) translateY(-5px)} 100%{transform:scale(1.02)} }
@keyframes paw-shake  { 0%,100%{transform:translateY(0) rotate(0)} 25%{transform:translateY(-26px) rotate(-16deg)} 50%{transform:translateY(-26px) rotate(9deg)} 75%{transform:translateY(-26px) rotate(-9deg)} }
@keyframes paw-lift   { 0%,100%{transform:translateY(0) rotate(0)} 40%{transform:translateY(-30px) rotate(-12deg)} }
@keyframes tongue-bob { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(1.4)} }

/* floating fx emojis (hearts, notes) */
.coco-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fx-item {
  position: absolute;
  left: 50%;
  bottom: 40%;
  font-size: 1.5rem;
  animation: fx-float 1.2s ease-out forwards;
}
@keyframes fx-float {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.4); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--fx-x, -50%), -90px) scale(1.1); }
}

.coco-speech {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  min-height: 2.2rem;
  margin: 0.6rem 0 1.2rem;
}

.trick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.btn {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--kibble);
  border: 3px solid var(--kibble);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--kibble);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.2s ease;
  background: var(--sky);
  color: #08283a;
}
.btn:hover:not(:disabled)  { transform: translateY(-2px); box-shadow: 0 6px 0 var(--kibble); }
.btn:active:not(:disabled) { transform: translateY(2px);  box-shadow: 0 2px 0 var(--kibble); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, .hero-cta:focus-visible, .lightbox-close:focus-visible, .polaroid:focus-visible {
  outline: 4px solid var(--sky-deep);
  outline-offset: 3px;
}

.treat-btn { background: var(--coral-text); color: #fff; }

.trick-counter { font-size: 0.95rem; color: #6b543b; margin: 0 0 1.1rem; }

/* treat + sound toggle row */
.trick-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.sound-toggle {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  border: 3px solid var(--kibble);
  background: var(--paper);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: 0 4px 0 var(--kibble);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}
.sound-toggle:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 var(--kibble); }
.sound-toggle:active { transform: translateY(2px);  box-shadow: 0 2px 0 var(--kibble); }
.sound-toggle[aria-pressed="true"] { background: var(--ball); }
.sound-toggle:focus-visible { outline: 4px solid var(--sky-deep); outline-offset: 3px; }

/* Confetti / treat-rain layer */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  overflow: hidden;
}
.confetti-bit {
  position: absolute;
  top: -40px;
  font-size: 1.6rem;
  will-change: transform;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { opacity: 0; transform: translateY(-40px) rotate(0); }
  10%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(105vh) rotate(var(--spin, 360deg)); }
}

/* Sigh overlay */
.sigh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 42, 24, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  text-align: center;
  padding: 1.5rem;
}
.sigh-overlay.show { opacity: 1; pointer-events: auto; }
.sigh-text {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--ball);
  animation: sigh-grow 1.6s ease both;
  letter-spacing: 0.04em;
}
@keyframes sigh-grow {
  from { transform: scale(0.4); opacity: 0; }
  30%  { transform: scale(1.15); opacity: 1; }
  to   { transform: scale(1); opacity: 1; }
}
.sigh-sub { color: var(--paper); font-size: 1.15rem; max-width: 26rem; }

/* ============ AWARDS / CERTIFICATES ============ */
.award-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.3rem;
}

.award-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0 12px, transparent 12px 24px),
    var(--paper);
  border: 3px solid var(--kibble);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.3rem 1rem 1.2rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.award:nth-child(odd)  .award-card { transform: rotate(-1deg); }
.award:nth-child(even) .award-card { transform: rotate(1deg); }
.award-card:hover { transform: rotate(0) translateY(-5px); box-shadow: 0 12px 0 rgba(60,42,24,0.2); }
.award-card:focus-visible { outline: 4px solid var(--sky-deep); outline-offset: 3px; }

/* scalloped "certificate seal" edge accent */
.award-card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(60,42,24,0.25);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

.award-medal {
  font-size: 2.8rem;
  line-height: 1;
  animation: medal-bob 2.6s ease-in-out infinite;
}
.award:nth-child(2n) .award-medal { animation-delay: -0.6s; }
.award:nth-child(3n) .award-medal { animation-delay: -1.2s; }
@keyframes medal-bob {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50%     { transform: translateY(-6px) rotate(4deg); }
}

.award-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--kibble);
  line-height: 1.25;
}

/* citation hidden until tapped */
.award-cite {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: #6b543b;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
}
.award-card[aria-expanded="true"] .award-cite {
  max-height: 8rem;
  opacity: 1;
  margin-top: 0.2rem;
}
.award-card[aria-expanded="true"] { background: var(--sand); }

/* shine sweep on hover / when awarded */
.award-shine {
  position: absolute;
  top: -60%;
  left: -80%;
  width: 50%;
  height: 220%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.85), transparent);
  transform: rotate(18deg);
  pointer-events: none;
}
.award-card:hover .award-shine,
.award-card.shine .award-shine { animation: shine-sweep 0.9s ease; }
@keyframes shine-sweep {
  0%   { left: -80%; }
  100% { left: 140%; }
}

/* scroll-in reveal */
.award.pending .award-card { opacity: 0; transform: translateY(24px) scale(0.94); }
.award.reveal-anim .award-card { transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.3,1.5,.5,1); }

.award-fine {
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: #6b543b;
  margin: 2rem 0 0;
}

/* ============ FAVORITE PERSON RANKINGS ============ */
.podium {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  align-items: start;
}

.podium-card {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--kibble);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.4rem 1.5rem;
  transform: rotate(0.6deg);
}
.podium-card:nth-child(odd) { transform: rotate(-0.6deg); }

.podium-first {
  background: linear-gradient(160deg, #fff9dd 0%, var(--paper) 60%);
  border-width: 4px;
  box-shadow: 0 8px 0 rgba(60,42,24,0.22), 0 0 0 6px rgba(198, 229, 52, 0.35);
}

.podium-crown {
  position: absolute;
  top: -1.3rem;
  right: 1rem;
  font-size: 2.2rem;
  transform: rotate(14deg);
}

.podium-rank {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--caramel);
  display: block;
  line-height: 1;
}
.podium-first .podium-rank { color: var(--ball-dark); font-size: 2.6rem; }

.podium-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0.3rem 0 0.5rem;
  color: var(--sky-deep);
}
.podium-card p { margin: 0 0 0.5rem; }
.podium-card p:last-child { margin-bottom: 0; }

.podium-link a {
  color: var(--link);
  font-weight: 800;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--ball-dark);
  text-underline-offset: 3px;
}
.podium-link a:hover { text-decoration-color: var(--coral-text); }

.podium-fine {
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: #6b543b;
  margin: 2rem 0 0;
}

/* ============ GALLERY / POLAROIDS ============ */
.gallery { max-width: 78rem; }

.polaroid-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.8rem 1.6rem;
  align-items: start;
}

.polaroid {
  display: block;
  width: 100%;
  margin: 0;
  background: var(--paper);
  border: 1px solid #e3d9bd;
  border-radius: 4px;
  padding: 0.8rem 0.8rem 1rem;
  box-shadow: 0 8px 18px rgba(60,42,24,0.18);
  cursor: zoom-in;
  position: relative;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* scroll reveal: hidden until IntersectionObserver marks it */
.polaroid.pending {
  opacity: 0;
  transform: translateY(28px) !important;
}
.polaroid.reveal-anim {
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.polaroid:nth-child(3n+1) { transform: rotate(-1.6deg); }
.polaroid:nth-child(3n+2) { transform: rotate(1.2deg); }
.polaroid:nth-child(3n)   { transform: rotate(-0.5deg); }
.polaroid:hover {
  transform: rotate(0) scale(1.025);
  box-shadow: 0 14px 26px rgba(60,42,24,0.26);
  z-index: 2;
}

/* washi tape */
.polaroid::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(198, 229, 52, 0.65);
  border-left: 2px dashed rgba(60,42,24,0.15);
  border-right: 2px dashed rgba(60,42,24,0.15);
}
.polaroid:nth-child(even)::before { background: rgba(88, 183, 230, 0.55); transform: translateX(-50%) rotate(2.5deg); }

.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  background: #efe6cf;
}
.polaroid img.wide { aspect-ratio: auto; }

.polaroid figcaption,
.polaroid .cap {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.3;
  padding: 0.7rem 0.2rem 0;
  color: #4a3520;
}

/* image failed to load → paw placeholder */
.polaroid .img-missing {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: repeating-linear-gradient(45deg, #f4ecd6 0 14px, #efe6cf 14px 28px);
  border-radius: 2px;
}

/* video polaroid */
.polaroid video {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  background: #1a1208;
}
.video-badge {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 2;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(217, 60, 40, 0.92);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  animation: badge-blink 1.6s steps(1) infinite;
}
@keyframes badge-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.lightbox-video {
  max-width: 100%;
  max-height: 74vh;
  border: 8px solid var(--paper);
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  background: #000;
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(24, 16, 8, 0.9);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 60rem);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border: 8px solid var(--paper);
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.lightbox-figure figcaption {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--paper);
  text-align: center;
  max-width: 42rem;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.4rem;
  font-family: var(--font-body);
  font-weight: 800;
  background: var(--paper);
  color: var(--kibble);
  border: 3px solid var(--kibble);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--kibble);
}

/* ============ FOOTER ============ */
.footer {
  background: var(--kibble);
  color: var(--sand);
  text-align: center;
  padding: 2.5rem 1.25rem 2.8rem;
  margin-top: 2rem;
}
.footer-paws { font-size: 1.4rem; letter-spacing: 0.6rem; margin: 0 0 0.8rem; }
.footer p { margin: 0.25rem 0; }
.footer-fine { font-size: 0.85rem; opacity: 0.75; }

/* ============ IMAGE PROTECTION (CSS side) ============ */
/* Applies ONLY to media, never to text — text stays selectable for
   accessibility. Pairs with the JS deterrents in script.js. */
.polaroid img,
.polaroid video,
.lightbox img,
.lightbox video,
.hero img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none; /* stops iOS long-press "Save Image" menu */
  pointer-events: auto;
}

/* ============ GLOBAL FOCUS BASELINE ============ */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid var(--sky-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ MOTION / RESPONSIVE ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-name span, .ball, .ticker-track, .meter-overflow,
  .sigh-text, .video-badge,
  .coco-dog, .dog-tail, .coco-dog[class*="t-"], .coco-dog.sighing,
  .coco-dog .dog-paw, .fx-item, .confetti-bit,
  .coco-stage.showcase, .award-medal {
    animation: none !important;
  }
  .coco-stage.showcase { transform: none !important; }
  .coco-stage::before { display: none; }
  .fact-card, .polaroid, .hero-cta, .btn, .sound-toggle { transition: none; }
  .polaroid.pending { opacity: 1; transform: none !important; }
}

@media (max-width: 560px) {
  .polaroid-wall { grid-template-columns: 1fr; }
  .trick-buttons .btn { flex: 1 1 40%; }

  /* Coco is already large relative to a phone screen — zoom less */
  .coco-stage { --showcase-scale: 1.65; }

  /* Language switcher: a centered top strip instead of a floating box,
     so it never lands on top of the hero's "Born & raised" pill. */
  .lang-switch {
    top: 0.5rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    grid-template-columns: repeat(8, auto);
    justify-content: center;
    max-width: calc(100vw - 1rem);
  }
  .lang-btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.5rem;
  }
  /* Give the hero enough headroom below the switcher strip. */
  .hero { padding-top: 4.25rem; }
}

/* Very narrow phones: fall back to two centered rows of four. */
@media (max-width: 380px) {
  .lang-switch { grid-template-columns: repeat(4, auto); }
  .hero { padding-top: 5.5rem; }
}
