:root {
  color-scheme: light;
  --ink: #241f2b;
  --muted: #6f6678;
  --paper: #fffaf1;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.9);
  --mint: #b8eadb;
  --rose: #ffb6c6;
  --sun: #ffd56f;
  --sky: #9ed8ff;
  --leaf: #7bcf94;
  --accent: #26735e;
  --control-bg: rgba(255, 255, 255, 0.82);
  --control-border: rgba(36, 31, 43, 0.14);
  --page-bg: linear-gradient(135deg, rgba(184, 234, 219, 0.9), rgba(255, 250, 241, 0.95) 42%, rgba(255, 182, 198, 0.62));
  --shadow: 0 18px 45px rgba(59, 43, 75, 0.16);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f7f1ff;
  --muted: #c9bed8;
  --paper: #15111c;
  --panel: #241b2d;
  --panel-soft: rgba(36, 27, 45, 0.92);
  --mint: #6ee3c3;
  --rose: #ff8eaa;
  --sun: #ffd36b;
  --sky: #7fc8ff;
  --leaf: #71d18f;
  --accent: #8fe9ce;
  --control-bg: rgba(36, 27, 45, 0.9);
  --control-border: rgba(255, 255, 255, 0.16);
  --page-bg: linear-gradient(135deg, rgba(35, 84, 78, 0.74), rgba(21, 17, 28, 0.96) 44%, rgba(92, 44, 74, 0.72));
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page-bg), var(--paper);
  transition: background 180ms ease, color 180ms ease;
}

button,
article {
  font: inherit;
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero {
  min-height: clamp(210px, 30vh, 310px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 24px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.intro {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.hero-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-toggle,
.theme-toggle {
  flex: 0 0 auto;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 2px solid var(--control-border);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--control-bg);
  box-shadow: 0 10px 22px rgba(36, 31, 43, 0.09);
  cursor: pointer;
}

.sound-toggle[aria-pressed="true"] {
  border-color: rgba(38, 115, 94, 0.38);
  background: var(--mint);
}

.sound-icon,
.theme-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #173d33;
  background: var(--sun);
  font-weight: 900;
}

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

.animal-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  outline: 0;
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.animal-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(0deg, rgba(20, 16, 27, 0.74), rgba(20, 16, 27, 0));
  pointer-events: none;
}

.animal-card:hover,
.animal-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 24px 55px rgba(59, 43, 75, 0.22);
}

.animal-card:focus-visible {
  outline: 4px solid var(--sky);
  outline-offset: 4px;
}

.animal-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-copy {
  position: absolute;
  z-index: 1;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
}

.animal-name {
  min-width: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
  font-weight: 900;
  line-height: 1;
}

.sound-label {
  flex: 0 0 auto;
  max-width: 42%;
  border-radius: 999px;
  padding: 7px 10px;
  color: #231929;
  background: var(--sun);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.animal-card.is-singing .sound-label {
  background: var(--rose);
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
    align-items: start;
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 1160px);
    padding-top: 22px;
  }

  .animal-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .animal-card {
    aspect-ratio: 5 / 4;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .sound-toggle,
  .theme-toggle {
    width: 100%;
    justify-content: center;
  }
}

.top-shorts {
  padding: 18px 0 38px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.section-heading p:not(.kicker) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.shorts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.short-card {
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 620px;
  background: #17121c;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.short-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 16px;
}

.rank-badge {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #173d33;
  background: var(--mint);
  font-weight: 900;
}

.short-copy h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.2;
}

.short-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 920px) {
  .top-shorts {
    display: grid;
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
    align-items: end;
    gap: 26px;
  }

  .section-heading {
    margin-bottom: 0;
  }
}

@media (max-width: 620px) {
  .shorts-grid {
    grid-template-columns: 1fr;
  }

  .video-frame {
    max-height: none;
  }
}
