:root {
  --cream: #fff7f1;
  --pink: #ff8ecb;
  --pink-soft: #ffe2f2;
  --purple: #8657d6;
  --purple-soft: #efe5ff;
  --lavender: #f7f0ff;
  --brown: #6b432d;
  --brown-soft: #d7b79d;
  --cocoa: #2f211b;
  --muted: #745f56;
  --card: #fffdfb;
  --line: #ead5c8;
  --shadow: 0 24px 60px rgba(105, 67, 45, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 142, 203, 0.34), transparent 34%),
    radial-gradient(circle at 95% 8%, rgba(134, 87, 214, 0.18), transparent 28%),
    linear-gradient(90deg, rgba(255, 142, 203, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(134, 87, 214, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #fff9fb 0%, var(--cream) 44%, #f5e7db 100%);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
  color: var(--cocoa);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 54px);
  background: rgba(255, 247, 241, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brown), var(--purple));
  color: #fff9fb;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(107, 67, 45, 0.22);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a,
.site-footer a {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--brown);
  font-weight: 800;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  background: var(--pink-soft);
  color: var(--purple);
}

main,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.86fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: 54px 0 70px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
li {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 8px 0 8px;
  font-size: 1.28rem;
  line-height: 1.1;
}

.hero-text {
  max-width: 590px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-stats span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.76);
  color: var(--brown);
  font-size: 0.88rem;
  font-weight: 900;
}

.hero-actions,
.filter-row,
.quiz-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 30px;
}

.surprise-fact {
  min-height: 30px;
  margin: 16px 0 0;
  color: var(--brown);
  font-weight: 850;
}

.button,
.filter-button,
.quiz-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button.primary,
.filter-button.is-active,
.quiz-choice.is-correct {
  background: linear-gradient(135deg, var(--purple), #b457d7);
  border-color: var(--purple);
  color: #fff;
}

.button.secondary,
.filter-button,
.quiz-choice {
  background: var(--card);
  color: var(--brown);
}

.button:hover,
.button:focus-visible,
.filter-button:hover,
.filter-button:focus-visible,
.quiz-choice:hover,
.quiz-choice:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(107, 67, 45, 0.16);
}

.quiz-choice.is-wrong {
  background: var(--pink-soft);
  border-color: var(--pink);
  color: var(--brown);
}

.photo-stack {
  position: relative;
  min-height: 470px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(150deg, var(--pink-soft), transparent 44%),
    linear-gradient(330deg, var(--purple-soft), transparent 46%),
    var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.photo-stack::before,
.photo-stack::after,
.photo-card {
  will-change: transform;
}

.photo-stack::before,
.photo-stack::after {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(107, 67, 45, 0.18);
}

.photo-stack::before {
  content: "so cute";
  top: 18px;
  right: 22px;
  width: 92px;
  height: 92px;
  transform: rotate(8deg);
}

.photo-stack::after {
  content: "learn!";
  left: 22px;
  bottom: 22px;
  width: 78px;
  height: 78px;
  background: var(--purple);
  transform: rotate(-10deg);
}

.photo-card {
  position: absolute;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 18px 34px rgba(107, 67, 45, 0.18);
  transition: transform 180ms ease;
}

.photo-card:hover {
  z-index: 3;
  transform: rotate(0deg) translateY(-4px);
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}

.photo-focus-cat {
  object-position: 42% 55%;
}

.photo-focus-dog {
  object-position: 54% 42%;
}

.photo-focus-capybara {
  object-position: 42% 48%;
}

.photo-card span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 247, 241, 0.9);
  color: var(--brown);
  font-size: 0.8rem;
  font-weight: 900;
}

.cat-photo-card {
  top: 38px;
  left: 32px;
  width: min(56%, 270px);
  height: 190px;
  transform: rotate(-5deg);
}

.dog-photo-card {
  top: 152px;
  right: 34px;
  width: min(58%, 286px);
  height: 200px;
  transform: rotate(6deg);
}

.capybara-photo-card {
  left: 74px;
  bottom: 38px;
  width: min(62%, 306px);
  height: 190px;
  transform: rotate(-2deg);
}

.learning-strip {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.intro-band,
.fact-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: start;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.72);
}

.species-note {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 142, 203, 0.2), transparent 45%),
    var(--purple-soft);
  color: var(--brown);
  font-weight: 700;
}

.species-note strong {
  color: var(--purple);
}

.intro-band p,
.section p,
.fact-list {
  color: var(--muted);
}

.section {
  padding: 62px 0;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 24px;
}

.filter-row {
  margin-bottom: 18px;
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.animal-card {
  display: grid;
  align-content: start;
  min-height: 350px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(107, 67, 45, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.animal-card:hover {
  border-color: var(--pink);
  box-shadow: 0 18px 36px rgba(107, 67, 45, 0.14);
  transform: translateY(-3px);
}

.animal-card.is-hidden {
  display: none;
}

.card-photo {
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pink-soft);
}

.dog-running-photo,
.capybara-close-photo,
.capybara-hay-photo,
.capybara-water-photo {
  object-fit: cover;
}

.cat-lounge-photo {
  object-position: 50% 42%;
}

.cat-tuxedo-photo {
  object-position: 50% 44%;
}

.cat-face-photo {
  object-position: 50% 45%;
}

.dog-face-photo {
  object-position: 50% 50%;
}

.corgi-photo {
  object-position: 50% 48%;
}

.dog-running-photo {
  object-position: 50% 44%;
}

.capybara-close-photo {
  object-position: 50% 48%;
}

.capybara-hay-photo {
  object-position: 50% 48%;
}

.capybara-water-photo {
  object-position: 50% 50%;
}

.card-label {
  align-self: end;
  margin: 16px 0 0;
  color: var(--purple);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.science-name {
  margin: 0 0 10px;
  color: var(--brown);
  font-size: 0.92rem;
  font-weight: 850;
}

.animal-card p:last-child {
  margin: 0;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.quick-facts div {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 8px;
  background: var(--lavender);
  text-align: center;
}

.quick-facts dt {
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-facts dd {
  margin: 2px 0 0;
  color: var(--brown);
  font-size: 0.86rem;
  font-weight: 900;
}

.learning-lab {
  padding-top: 18px;
}

.compare-grid,
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.compare-grid article,
.glossary-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(107, 67, 45, 0.08);
}

.compare-grid span {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--pink-soft);
  color: var(--purple);
  font-size: 0.82rem;
  font-weight: 900;
}

.compare-grid p,
.glossary-grid p {
  margin: 10px 0 0;
  color: var(--muted);
}

.fact-panel {
  margin: 10px 0 24px;
}

.fact-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  font-weight: 750;
}

.quiz-shell {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 142, 203, 0.18), transparent 42%),
    var(--card);
  box-shadow: 0 18px 40px rgba(107, 67, 45, 0.1);
}

.quiz-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--brown);
  font-weight: 900;
}

.quiz-topline span {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--pink-soft);
}

.quiz-meter {
  height: 12px;
  margin: 14px 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.8);
}

.quiz-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  transition: width 180ms ease;
}

.quiz-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.9);
}

.quiz-level {
  margin: 0 0 10px;
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quiz-card h3 {
  margin-bottom: 18px;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quiz-result {
  min-height: 28px;
  margin: 14px 0 0;
  color: var(--brown);
  font-weight: 850;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.quiz-actions .button:disabled,
.quiz-choice:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.level-ten-panel {
  margin-top: 18px;
  padding: 22px;
  border: 2px solid var(--purple);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 142, 203, 0.22), transparent 48%),
    var(--lavender);
}

.level-ten-panel h3 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.level-ten-panel p {
  color: var(--muted);
}

.fun-zone {
  padding-top: 20px;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mood-grid article {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 142, 203, 0.26), transparent 50%),
    var(--card);
  box-shadow: 0 12px 30px rgba(107, 67, 45, 0.08);
}

.mood-grid span {
  display: inline-flex;
  margin-bottom: 22px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--brown);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 900;
}

.mood-grid strong {
  display: block;
  color: var(--purple);
  font-size: 1.45rem;
}

.mood-grid p {
  margin: 10px 0 0;
}

.glossary-section {
  padding-top: 20px;
}

.glossary-grid strong {
  display: block;
  color: var(--purple);
  font-size: 1.15rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.credit-line {
  margin-top: 6px;
  font-size: 0.86rem;
}

.credit-line a {
  min-height: auto;
  padding: 0;
  color: var(--purple);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .hero,
  .intro-band,
  .fact-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .animal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-grid,
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    gap: 12px;
    padding: 14px 12px;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    justify-content: start;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
  }

  .nav-links a {
    min-height: 36px;
    padding: 8px 10px;
    background: rgba(255, 253, 251, 0.72);
    white-space: nowrap;
  }

  .button,
  .filter-button,
  .quiz-choice {
    width: 100%;
  }

  .quiz-choices {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  .hero {
    padding-top: 34px;
  }

  .hero-stats span {
    flex: 1 1 120px;
    text-align: center;
  }

  .photo-stack {
    min-height: 420px;
  }

  .photo-stack::before {
    width: 76px;
    height: 76px;
    font-size: 0.86rem;
  }

  .photo-stack::after {
    width: 66px;
    height: 66px;
    font-size: 0.86rem;
  }

  .cat-photo-card {
    left: 10px;
    width: 72%;
    height: 150px;
  }

  .dog-photo-card {
    right: 10px;
    top: 142px;
    width: 72%;
    height: 150px;
  }

  .capybara-photo-card {
    left: 20px;
    bottom: 30px;
    width: 76%;
    height: 150px;
  }

  .intro-band,
  .fact-panel {
    padding: 22px;
  }

  .animal-grid,
  .mood-grid,
  .quick-facts {
    grid-template-columns: 1fr;
  }
}
