:root {
  color-scheme: dark;
  --purple-950: #170b25;
  --purple-900: #27103d;
  --purple-800: #3b155f;
  --purple-700: #5c258c;
  --purple-500: #9a55da;
  --lavender: #d8b7ff;
  --cream: #fff7e7;
  --lime: #b9ea4d;
  --lime-dark: #739d20;
  --orange: #ffad42;
  --ink: #241831;
  --card: #fffaf0;
  --shadow: 0 14px 34px rgba(16, 5, 30, 0.28);
  font-family: "Arial Rounded MT Bold", "Noto Sans Hebrew", "Rubik", Arial, sans-serif;
  background: var(--purple-950);
  color: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--purple-950);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 32%, rgba(104, 52, 139, 0.24), transparent 28rem),
    linear-gradient(180deg, #1c0b2d 0%, #2f1348 54%, #20102f 100%);
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font: inherit;
}

button {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid var(--orange);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -100px;
  right: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: white;
  color: var(--ink);
}

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

.hero {
  position: relative;
  min-height: 475px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 11%, rgba(255, 238, 177, 0.28), transparent 16%),
    radial-gradient(circle at 80% 10%, rgba(191, 116, 255, 0.28), transparent 30%),
    linear-gradient(180deg, #3e1762 0%, #542078 54%, #321747 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -5;
  opacity: 0.17;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hero__content {
  position: relative;
  z-index: 5;
  width: min(100% - 40px, 680px);
  margin: 0 auto;
  padding: max(42px, env(safe-area-inset-top)) 0 170px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(35, 11, 55, 0.34);
  color: var(--lavender);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(7px);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
}

h1 {
  margin: 14px 0 8px;
  color: white;
  font-size: clamp(3.15rem, 15vw, 5.6rem);
  line-height: 0.84;
  letter-spacing: -0.075em;
  text-shadow: 0 6px 0 rgba(41, 13, 64, 0.45);
}

h1 span {
  display: inline-block;
  margin-top: 14px;
  color: var(--lime);
  transform: rotate(-2deg);
}

.hero__content p {
  max-width: 290px;
  margin: 17px auto 20px;
  color: #eadcf4;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
}

.surprise-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 18px 9px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: 0 7px 0 rgba(29, 9, 45, 0.45), 0 12px 26px rgba(18, 4, 32, 0.25);
  color: var(--purple-800);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.surprise-button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(29, 9, 45, 0.45);
}

.surprise-button__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50% 50% 47% 53% / 56% 45% 55% 44%;
  background: var(--purple-700);
  color: var(--lime);
  font-size: 1.25rem;
}

.hero__moon {
  position: absolute;
  z-index: -3;
  top: 28px;
  left: 7%;
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f4dc9d;
  box-shadow: 0 0 40px rgba(255, 224, 157, 0.28);
  opacity: 0.7;
}

.hero__stars {
  position: absolute;
  z-index: -3;
  inset: 0;
  opacity: 0.38;
  background-image:
    radial-gradient(circle, white 1.2px, transparent 1.7px),
    radial-gradient(circle, white 1px, transparent 1.5px);
  background-position: 12px 18px, 48px 65px;
  background-size: 84px 84px, 119px 119px;
}

.hero__mist {
  position: absolute;
  z-index: -1;
  right: -25%;
  bottom: 45px;
  width: 150%;
  height: 90px;
  border-radius: 50%;
  background: rgba(188, 129, 211, 0.14);
  filter: blur(19px);
}

.hero__mountains {
  position: absolute;
  z-index: -3;
  right: -5%;
  bottom: 50px;
  width: 112%;
  height: 175px;
  background: #2d153e;
  clip-path: polygon(0 72%, 8% 54%, 14% 63%, 22% 36%, 31% 62%, 38% 48%, 46% 70%, 54% 37%, 63% 63%, 70% 50%, 81% 71%, 91% 43%, 100% 66%, 100% 100%, 0 100%);
}

.hero__mountains--far {
  z-index: -4;
  bottom: 95px;
  height: 160px;
  background: #663184;
  opacity: 0.55;
  transform: scaleX(-1);
}

.hero__dino {
  position: absolute;
  z-index: 1;
  bottom: 29px;
  left: 50%;
  width: min(91vw, 440px);
  transform: translateX(-50%);
  fill: #150b1d;
  filter: drop-shadow(0 14px 10px rgba(12, 3, 20, 0.35));
  opacity: 0.94;
}

.hero__ground {
  position: absolute;
  z-index: 0;
  right: -4%;
  bottom: -22px;
  width: 108%;
  height: 92px;
  border-radius: 47% 52% 0 0;
  background: #160b20;
}

.collection {
  position: relative;
  z-index: 2;
  width: min(100% - 28px, 900px);
  margin: -3px auto 0;
  padding: 34px 0 55px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 3px 20px;
}

.section-heading__kicker {
  color: var(--lavender);
  font-size: 0.8rem;
  font-weight: 700;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(1.65rem, 7vw, 2.4rem);
  letter-spacing: -0.045em;
}

.count-badge {
  flex: none;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--lavender);
  font-size: 0.78rem;
}

.count-badge strong {
  color: var(--lime);
}

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

.dino-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 23px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.dino-card:nth-child(3n + 2) {
  transform: translateY(7px);
}

.dino-card:active {
  transform: scale(0.965);
}

.dino-card__photo {
  position: relative;
  aspect-ratio: 0.98;
  overflow: hidden;
  background: #d8c9bd;
}

.dino-card__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 56%, rgba(30, 13, 40, 0.35));
  pointer-events: none;
}

.dino-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 350ms ease;
}

.dino-card:hover img {
  transform: scale(1.035);
}

.dino-card__number {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(35, 15, 48, 0.68);
  color: white;
  font-size: 0.76rem;
  backdrop-filter: blur(5px);
}

.dino-card__arrow {
  position: absolute;
  z-index: 1;
  left: 10px;
  bottom: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--purple-900);
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 5px 13px rgba(29, 10, 42, 0.27);
}

.dino-card__body {
  min-height: 91px;
  padding: 12px 12px 14px;
}

.dino-card h3 {
  margin: 0 0 3px;
  overflow: hidden;
  font-size: clamp(1rem, 4.6vw, 1.28rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dino-card__english {
  display: block;
  overflow: hidden;
  color: #755f7e;
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dino-card__diet {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f4cc;
  color: #42620c;
  font-size: 0.66rem;
  font-weight: 800;
}

.dino-card__diet--meat {
  background: #ffe0d6;
  color: #9d3924;
}

.dino-card__diet--fish {
  background: #d9eff7;
  color: #175e78;
}

.dino-card__diet--mixed {
  background: #f3e3ff;
  color: #68268e;
}

.parent-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 27px 4px 0;
  color: #baa9c5;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.45;
}

footer {
  padding: 23px 20px calc(27px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #9987a3;
  font-size: 0.72rem;
  text-align: center;
}

.footprint {
  position: relative;
  display: inline-block;
  margin: 0 8px;
  color: var(--purple-500);
  font-size: 0.6rem;
}

.footprint::before,
.footprint::after {
  content: "●";
  position: absolute;
  top: -5px;
  font-size: 0.42rem;
}

.footprint::before { right: -3px; }
.footprint::after { left: -3px; }
.footprint--two { transform: rotate(28deg); }

.detail {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  align-items: end;
  visibility: hidden;
  opacity: 0;
  transition: opacity 230ms ease, visibility 230ms ease;
}

.detail.is-open {
  visibility: visible;
  opacity: 1;
}

.detail__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 5, 24, 0.78);
  backdrop-filter: blur(7px);
}

.detail__sheet {
  position: relative;
  width: min(100%, 670px);
  max-height: 100dvh;
  margin: 0 auto;
  overflow: auto;
  border-radius: 28px 28px 0 0;
  background: var(--card);
  box-shadow: 0 -15px 50px rgba(8, 2, 14, 0.42);
  color: var(--ink);
  overscroll-behavior: contain;
  transform: translateY(35px);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.detail.is-open .detail__sheet {
  transform: translateY(0);
}

.detail__topbar {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(13px + env(safe-area-inset-top)) 14px 10px;
}

.round-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: rgba(24, 10, 35, 0.66);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.round-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-button--sound svg {
  width: 22px;
}

.detail__counter {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24, 10, 35, 0.55);
  color: rgba(255, 255, 255, 0.87);
  font-size: 0.75rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.photo-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  min-height: 265px;
  padding: 5px;
  background: #1d0d2b;
}

.photo-card {
  position: relative;
  min-width: 0;
  min-height: 260px;
  margin: 0;
  overflow: hidden;
  background: #b9a8ac;
}

.photo-card:first-child {
  border-radius: 8px 22px 8px 8px;
}

.photo-card:last-child {
  border-radius: 22px 8px 8px 8px;
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(19, 8, 27, 0.28) 0, transparent 32%, transparent 60%, rgba(20, 8, 28, 0.46) 100%);
}

.photo-card img {
  width: 100%;
  height: 100%;
  display: block;
}

.photo-card--toy img {
  object-fit: cover;
}

.photo-card--real {
  background:
    radial-gradient(circle at 50% 42%, #fffef7 0 31%, transparent 62%),
    linear-gradient(155deg, #ded0eb, #f7ebd3);
}

.photo-card--real img {
  padding: 18px 8px 30px;
  object-fit: contain;
}

.photo-label {
  position: absolute;
  z-index: 1;
  bottom: 14px;
  right: 10px;
  left: 10px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(25, 11, 36, 0.68);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  backdrop-filter: blur(8px);
}

.detail__body {
  position: relative;
  z-index: 2;
  margin-top: -4px;
  padding: 23px 18px calc(30px + env(safe-area-inset-bottom));
  border-radius: 25px 25px 0 0;
  background: var(--card);
}

.reconstruction-meta {
  margin: -8px 0 18px;
  padding: 9px 11px;
  border-radius: 14px;
  background: #f3e9f5;
  color: #705c78;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  text-align: center;
}

.reconstruction-meta p {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
}

.name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.name-row h2 {
  margin: 0;
  color: var(--purple-900);
  font-size: clamp(2rem, 10vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.english-name {
  margin: 7px 0 0;
  color: #866e8f;
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 0.83rem;
  font-weight: 800;
  text-align: right;
}

.diet-pill {
  flex: none;
  margin-top: 3px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #e8f4cc;
  color: #42620c;
  font-size: 0.7rem;
  font-weight: 900;
}

.diet-pill[data-diet="meat"] { background: #ffe0d6; color: #9d3924; }
.diet-pill[data-diet="fish"] { background: #d9eff7; color: #175e78; }
.diet-pill[data-diet="mixed"] { background: #f3e3ff; color: #68268e; }

.listen-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  margin: 20px 0 18px;
  padding: 10px 12px;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--purple-800), #6e2c9b);
  box-shadow: 0 7px 0 #2c1046, 0 13px 24px rgba(54, 20, 80, 0.23);
  color: white;
  text-align: right;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.listen-button:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #2c1046, 0 7px 15px rgba(54, 20, 80, 0.2);
}

.listen-button::after {
  content: "";
  position: absolute;
  top: -50px;
  left: 15%;
  width: 120px;
  height: 120px;
  border: 18px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.listen-button__disc {
  position: relative;
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--purple-900);
  box-shadow: 0 4px 13px rgba(12, 5, 18, 0.28);
}

.listen-button__disc svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.listen-button__pause {
  display: none;
}

.listen-button.is-playing .listen-button__play {
  display: none;
}

.listen-button.is-playing .listen-button__pause {
  display: block;
}

.listen-button strong,
.listen-button small {
  position: relative;
  z-index: 1;
  display: block;
}

.listen-button strong {
  font-size: 1rem;
}

.listen-button small {
  margin-top: 3px;
  color: #ddc7e9;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
}

.sound-waves {
  position: relative;
  z-index: 1;
  display: flex;
  height: 30px;
  align-items: center;
  gap: 3px;
  margin-right: auto;
  padding-left: 7px;
}

.sound-waves i {
  display: block;
  width: 3px;
  height: 7px;
  border-radius: 5px;
  background: var(--lavender);
}

.listen-button.is-playing .sound-waves i {
  animation: wave 650ms ease-in-out infinite alternate;
}

.listen-button.is-playing .sound-waves i:nth-child(2) { animation-delay: -230ms; }
.listen-button.is-playing .sound-waves i:nth-child(3) { animation-delay: -410ms; }
.listen-button.is-playing .sound-waves i:nth-child(4) { animation-delay: -120ms; }

@keyframes wave {
  to { height: 28px; background: var(--lime); }
}

.story {
  margin: 0;
  color: #4a3a50;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.68;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0 14px;
}

.fact-card {
  position: relative;
  min-height: 98px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #e6d9e8;
  border-radius: 19px;
  background: #f7eff8;
}

.fact-card__icon {
  position: absolute;
  top: 8px;
  left: 10px;
  color: #c7a6d5;
  font-size: 1.45rem;
  font-weight: 900;
}

.fact-card small,
.fact-card strong {
  display: block;
}

.fact-card small {
  margin-bottom: 9px;
  color: #8b7592;
  font-size: 0.68rem;
  font-weight: 800;
}

.fact-card strong {
  max-width: 88%;
  color: var(--purple-900);
  font-size: 0.93rem;
  line-height: 1.3;
}

.image-credit {
  display: block;
  margin: 4px 0 0;
  color: #70517b;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 0.62rem;
  line-height: 1.35;
  text-align: center;
}

.detail__navigation {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.detail__navigation button {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 16px;
  background: #eee1f0;
  color: var(--purple-800);
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.detail__navigation svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: calc(100% - 34px);
  padding: 11px 15px;
  border-radius: 14px;
  background: #20102f;
  box-shadow: var(--shadow);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

body.detail-open {
  overflow: hidden;
}

@media (min-width: 620px) {
  .hero { min-height: 540px; }
  .hero__content { padding-top: 60px; }
  .dino-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dino-card__photo { aspect-ratio: 1.12; }
  .detail { align-items: center; padding: 28px; }
  .detail__sheet { border-radius: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
