:root {
  --bg: #090d12;
  --bg-soft: #111821;
  --panel: rgba(16, 22, 31, 0.82);
  --panel-strong: rgba(13, 18, 26, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --text: #edf5ff;
  --muted: #96a6b8;
  --line: rgba(152, 199, 255, 0.12);
  --line-strong: rgba(152, 199, 255, 0.2);
  --accent: #7ee0ff;
  --accent-soft: rgba(126, 224, 255, 0.14);
  --warm: #ffc97b;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(126, 224, 255, 0.11), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 201, 123, 0.09), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #080c11 0%, #0b1118 48%, #090d12 100%);
  background-size:
    auto,
    auto,
    72px 72px,
    72px 72px,
    auto;
}

body {
  padding: 20px;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

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

.page-shell {
  max-width: 1500px;
  margin: 0 auto;
}

.subpage-shell {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.subpage-header,
.subpage-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.92), rgba(11, 16, 24, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.subpage-header::before,
.subpage-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(126, 224, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 26%);
  pointer-events: none;
}

.subpage-header,
.subpage-panel {
  padding: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.subpage-header h1 {
  margin: 14px 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
}

.subpage-header p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.7;
}

.category-page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-top: 16px;
}

.category-page-search {
  width: min(360px, 100%);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy,
.hero-panel,
.filter-rail,
.results-panel,
.detail-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.92), rgba(11, 16, 24, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.hero-copy::before,
.hero-panel::before,
.filter-rail::before,
.results-panel::before,
.detail-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(126, 224, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 26%);
  pointer-events: none;
}

.hero-copy {
  padding: 22px 24px;
}

.hero-panel {
  padding: 18px;
}

.site-intro-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(126, 224, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(126, 224, 255, 0.13), rgba(255, 201, 123, 0.07) 42%, rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.035);
}

.site-intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-intro-copy h2 {
  max-width: 12ch;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  line-height: 0.96;
}

.site-intro-copy p:not(.panel-label) {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.site-intro-points {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.site-intro-points span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(126, 224, 255, 0.16);
  background: rgba(8, 15, 23, 0.46);
  color: #dcf8ff;
  font-size: 0.78rem;
  font-weight: 800;
}

.site-intro-art {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: center;
}

.site-intro-art img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.site-intro-art img:nth-child(2) {
  transform: translateY(14px);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 0.7fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: end;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(126, 224, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(16, 22, 31, 0.9), rgba(9, 13, 19, 0.94));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.footer-brand h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  line-height: 1;
}

.footer-note,
.footer-copyright {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.footer-note {
  text-align: right;
}

.footer-copyright {
  justify-self: end;
  color: rgba(237, 245, 255, 0.78);
  font-weight: 800;
  text-align: right;
}

.hero-copy-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.1fr);
  gap: 24px;
  align-items: center;
}

.hero-brand {
  display: grid;
  gap: 8px;
}

.hero-side {
  display: grid;
  gap: 14px;
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-intro-card .panel-label,
.endangered-link-card .panel-label,
.home-section-heading .panel-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  margin-bottom: 12px;
  padding: 0 10px;
  border: 1px solid rgba(126, 224, 255, 0.18);
  border-radius: 999px;
  background: rgba(126, 224, 255, 0.09);
  color: #9bedff;
}

.hero h1,
.section-heading h2,
.detail-copy h2,
.hero-spotlight h3,
.animal-summary-card h3 {
  font-family: "Space Grotesk", sans-serif;
}

.hero h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.68;
}

.hero-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.search-combo {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: end;
  max-width: 820px;
}

.search-mode-control {
  display: grid;
  gap: 10px;
}

.search-mode-control > span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.search-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 53px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.search-mode-button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 170ms ease, color 170ms ease, box-shadow 170ms ease;
}

.search-mode-button:hover,
.search-mode-button:focus-visible {
  color: var(--text);
  outline: none;
}

.search-mode-button.is-active {
  background: linear-gradient(135deg, rgba(126, 224, 255, 0.24), rgba(255, 201, 123, 0.15));
  color: #effaff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.search-field {
  display: grid;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.search-field span {
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.search-field input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

.search-field input::placeholder {
  color: rgba(237, 245, 255, 0.45);
}

.search-field input:focus {
  border-color: rgba(126, 224, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(126, 224, 255, 0.12);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(126, 224, 255, 0.14);
}

.stat-pill {
  min-height: 76px;
  padding: 16px 16px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-pill strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
}

.stat-pill span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.home-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 18px;
  align-items: end;
  margin: 22px 0 14px;
  padding: 14px 0 12px;
  border-bottom: 1px solid rgba(126, 224, 255, 0.14);
}

.home-section-heading h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 2.4vw, 2.4rem);
  line-height: 1;
}

.home-section-heading p:not(.panel-label) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  text-align: right;
}

.endangered-link-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1fr);
  align-items: stretch;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 201, 123, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 201, 123, 0.16), rgba(255, 109, 91, 0.08) 48%, rgba(126, 224, 255, 0.05)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 4px 0 0 rgba(255, 201, 123, 0.72);
}

.endangered-link-copy {
  display: grid;
  align-content: center;
}

.endangered-link-card .panel-label {
  border-color: rgba(255, 201, 123, 0.26);
  background: rgba(255, 201, 123, 0.1);
  color: #ffd99e;
}

.endangered-link-card h2 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 2.2vw, 2.25rem);
  line-height: 1;
  color: #fff5d8;
}

.endangered-link-card p:not(.panel-label) {
  max-width: 680px;
  margin: 0;
  color: #cbbfae;
  line-height: 1.65;
}

.endangered-link-action {
  display: grid;
  gap: 12px;
  align-content: center;
}

.endangered-preview-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.endangered-preview-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 217, 158, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.endangered-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.endangered-preview-card span {
  position: absolute;
  inset: auto 6px 6px;
  overflow: hidden;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(4, 8, 13, 0.66);
  color: #fff5d8;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endangered-preview-card:hover img {
  transform: scale(1.06);
  filter: saturate(1.08) brightness(1.05);
}

.endangered-link-button {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 217, 158, 0.34);
  border-radius: 8px;
  background: rgba(255, 201, 123, 0.13);
  color: var(--text);
  text-decoration: none;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.endangered-link-button:hover,
.endangered-link-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 217, 158, 0.56);
  background: rgba(255, 201, 123, 0.2);
  outline: none;
}

.endangered-link-button span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: #ffd99e;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.endangered-link-button span strong {
  color: #fff5d8;
  font-size: 1.85rem;
  line-height: 1;
}

.endangered-link-button b {
  max-width: 22ch;
  font-size: 0.95rem;
  line-height: 1.15;
  text-align: right;
}

.type-showcase-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.type-showcase-card:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 224, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.type-showcase-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

.type-showcase-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.type-showcase-body {
  min-width: 0;
  padding: 14px 14px 16px;
}

.type-showcase-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 8, 13, 0.76);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.search-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(152, 199, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.98), rgba(11, 16, 24, 0.98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
}

.search-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.search-modal-close:hover,
.search-modal-close:focus-visible {
  border-color: rgba(126, 224, 255, 0.3);
  background: rgba(126, 224, 255, 0.14);
  outline: none;
}

.search-results-heading {
  margin-top: 0;
  padding-right: 84px;
}

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

.search-result-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.search-result-card:hover,
.search-result-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(126, 224, 255, 0.24);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
}

.search-result-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.search-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.search-result-copy h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  line-height: 1.05;
}

.search-result-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.search-result-copy small {
  color: rgba(237, 245, 255, 0.58);
  font-weight: 800;
}

.search-animal-profile {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.search-profile-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.search-profile-hero img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-profile-copy h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.search-profile-copy p:not(.panel-label) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.search-profile-population {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 217, 158, 0.2);
  border-radius: 8px;
  background: rgba(255, 156, 74, 0.09);
}

.search-profile-population span {
  color: #ffd99e;
  font-size: 0.72rem;
  font-weight: 900;
}

.search-profile-population strong {
  color: #fff1c9;
  font-size: 0.78rem;
}

.search-profile-facts {
  margin: 0;
}

.search-profile-description {
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.search-profile-description h4 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.search-profile-description p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.search-back-button {
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(126, 224, 255, 0.18);
  border-radius: 999px;
  background: rgba(126, 224, 255, 0.1);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.search-back-button:hover,
.search-back-button:focus-visible {
  border-color: rgba(126, 224, 255, 0.34);
  background: rgba(126, 224, 255, 0.16);
  outline: none;
}

.spotlight-card,
.detail-facts div,
.related-item,
.chip,
.stat-pill {
  backdrop-filter: blur(14px);
}

.card-topline,
.spotlight-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-spotlight {
  margin-top: 14px;
}

.hero-filter-bar {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hero-filter-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.hero-filter-bar h3 {
  margin: 4px 0 0;
  font-size: 1.2rem;
}

.hero-filter-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-filter-group {
  display: grid;
  gap: 10px;
}

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

.hero-filter-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-select-wrap {
  position: relative;
  display: block;
}

.hero-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(219, 246, 255, 0.72);
  border-bottom: 2px solid rgba(219, 246, 255, 0.72);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.hero-filter-select {
  width: 100%;
  min-height: 44px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  appearance: none;
}

.hero-filter-select:focus {
  border-color: rgba(126, 224, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(126, 224, 255, 0.12);
}

.hero-filter-select option {
  background: #111821;
  color: var(--text);
}

.spotlight-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.spotlight-card img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
}

.hero-spotlight h3 {
  margin: 6px 0 0;
  font-size: 1.35rem;
}

.hero-spotlight p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.place-pill,
.category-tag,
.place-tag,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.place-pill {
  margin-top: 14px;
  background: linear-gradient(180deg, rgba(126, 224, 255, 0.18), rgba(126, 224, 255, 0.09));
  color: #dcf8ff;
  border: 1px solid rgba(126, 224, 255, 0.18);
}

.category-tag {
  background: rgba(126, 224, 255, 0.1);
  border: 1px solid rgba(126, 224, 255, 0.16);
  color: #d9f7ff;
}

.place-tag {
  background: rgba(255, 201, 123, 0.1);
  border: 1px solid rgba(255, 201, 123, 0.16);
  color: #ffe2af;
}

.badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.filter-rail,
.results-panel,
.detail-panel {
  padding: 18px;
}

.filter-rail {
  position: sticky;
  top: 20px;
}

.detail-panel {
  position: sticky;
  top: 20px;
}

.filter-rail-hidden {
  display: none;
}

.filter-block + .filter-block {
  margin-top: 22px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2,
.results-panel h2,
.detail-panel h2 {
  margin: 0;
  font-size: 1.15rem;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-list-stack {
  display: grid;
}

.chip {
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.chip strong {
  color: var(--muted);
  font-size: 0.75rem;
}

.chip:hover,
.animal-card:hover,
.related-item:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.chip-active {
  border-color: rgba(126, 224, 255, 0.32);
  background: linear-gradient(180deg, rgba(126, 224, 255, 0.14), rgba(126, 224, 255, 0.07));
  box-shadow: inset 0 0 0 1px rgba(126, 224, 255, 0.08);
}

.chip-active strong {
  color: #d7f6ff;
}

.results-panel {
  min-height: 620px;
}

.results-count {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.animal-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.animal-card-active {
  border-color: color-mix(in srgb, var(--card-accent) 60%, white 6%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

.card-image-wrap {
  position: relative;
  height: 182px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.card-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  cursor: pointer;
}

.card-image-button::after {
  content: "View details";
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(8, 13, 19, 0.74);
  color: #e9f8ff;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.card-image-button:hover::after,
.card-image-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.card-image-button:focus-visible {
  outline: 3px solid rgba(126, 224, 255, 0.42);
  outline-offset: -3px;
}

.endangered-ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff7e8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.endangered-ribbon.danger-critical {
  background: linear-gradient(180deg, rgba(255, 72, 72, 0.96), rgba(160, 28, 28, 0.96));
}

.endangered-ribbon.danger-endangered {
  background: linear-gradient(180deg, rgba(255, 156, 74, 0.96), rgba(177, 86, 33, 0.96));
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 220ms ease, filter 220ms ease;
}

.card-image-button:hover img,
.card-image-button:focus-visible img {
  filter: saturate(1.14) brightness(1.08);
  transform: scale(1.06);
}

.card-body {
  padding: 14px;
}

.card-topline {
  margin-bottom: 10px;
}

.card-tags-under {
  margin-top: 12px;
  margin-bottom: 0;
}

.card-body h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.52;
}

.animal-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.animal-modal.hidden {
  display: none;
}

.animal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 13, 0.74);
  backdrop-filter: blur(10px);
}

.animal-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(690px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(152, 199, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.98), rgba(11, 16, 24, 0.98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
}

.animal-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  margin-left: auto;
  display: flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.animal-modal-close:hover,
.animal-modal-close:focus-visible {
  border-color: rgba(126, 224, 255, 0.3);
  background: rgba(126, 224, 255, 0.14);
}

.animal-modal-content-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding-right: 58px;
}

.animal-modal-visual {
  display: grid;
  gap: 10px;
}

.animal-modal-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-population-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 217, 158, 0.2);
  border-radius: 8px;
  background: rgba(255, 156, 74, 0.09);
}

.modal-population-note span {
  display: inline;
  margin: 0;
  color: #ffd99e;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.modal-population-note strong {
  display: inline;
  color: #fff1c9;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.45;
}

.animal-modal-copy h2 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.detail-card {
  display: grid;
  gap: 14px;
}

.detail-country-card .detail-image {
  height: 180px;
}

.detail-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
}

.detail-copy h2 {
  font-size: 1.85rem;
  margin: 0 0 6px;
}

.scientific-name {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.detail-summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.modal-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.description-link,
.sound-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(126, 224, 255, 0.2);
  border-radius: 999px;
  background: rgba(126, 224, 255, 0.1);
  color: #def8ff;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}

.sound-button {
  border-color: rgba(255, 203, 126, 0.34);
  background: rgba(255, 203, 126, 0.12);
  color: #ffe4ad;
}

.description-link:hover,
.description-link:focus-visible,
.sound-button:hover,
.sound-button:focus-visible {
  border-color: rgba(126, 224, 255, 0.4);
  background: rgba(126, 224, 255, 0.16);
}

.sound-button:hover,
.sound-button:focus-visible {
  border-color: rgba(255, 203, 126, 0.58);
  background: rgba(255, 203, 126, 0.18);
}

.sound-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.sound-button-unavailable:disabled {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.sound-source {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.sound-source a {
  color: #def8ff;
  text-decoration: none;
}

.sound-source a:hover,
.sound-source a:focus-visible {
  text-decoration: underline;
}

.detail-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-section h3 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.98rem;
}

.animal-description-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.animal-description-section p + p {
  margin-top: 12px;
}

.distribution-main {
  margin: 0 0 12px;
  font-size: 1.08rem;
  font-weight: 700;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.detail-facts div {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.detail-facts span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-facts .natural-enemies-fact {
  grid-column: 1 / -1;
}

.animal-map-section {
  display: grid;
  gap: 12px;
}

.animal-map-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.animal-map-heading h3 {
  margin-bottom: 6px;
}

.animal-map-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.animal-mini-map {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(126, 224, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(126, 224, 255, 0.08), transparent 45%),
    rgba(5, 11, 18, 0.72);
}

.animal-map-overlay-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(126, 224, 255, 0.2);
  border-radius: 999px;
  background: rgba(7, 13, 20, 0.74);
  backdrop-filter: blur(10px);
}

.animal-map-overlay-actions button {
  min-width: 34px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.animal-map-overlay-actions button:hover,
.animal-map-overlay-actions button:focus-visible {
  background: rgba(126, 224, 255, 0.16);
}

.animal-map-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 3;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(7, 13, 20, 0.68);
  color: rgba(237, 245, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.animal-mini-map svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

.animal-mini-map svg:focus-visible {
  outline: 3px solid rgba(126, 224, 255, 0.4);
  outline-offset: -3px;
}

.animal-mini-map svg.animal-map-dragging {
  cursor: grabbing;
}

.animal-map-ocean {
  fill: #102236;
}

.world-country-layer {
  transform-origin: center;
}

.world-country {
  fill: rgba(72, 126, 107, 0.86);
  stroke: rgba(211, 239, 255, 0.25);
  stroke-linejoin: round;
  stroke-width: 0.8;
}

.world-country:nth-child(3n) {
  fill: rgba(83, 145, 118, 0.9);
}

.world-country:nth-child(4n) {
  fill: rgba(96, 161, 129, 0.86);
}

.world-country-highlight {
  fill: #ffc97b;
  stroke: #fff3d6;
  stroke-width: 1.4;
  filter: drop-shadow(0 0 7px rgba(255, 201, 123, 0.48));
}

.animal-map-pulse {
  animation: mapPulse 1.8s ease-out infinite;
  animation-delay: var(--pin-delay);
  fill: rgba(255, 201, 123, 0.24);
  stroke: rgba(255, 201, 123, 0.5);
  stroke-width: 2;
}

.animal-map-dot {
  fill: #ff8f3d;
  stroke: #fff4dc;
  stroke-width: 3;
}

.animal-map-pin text {
  fill: #0b1018;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.animal-map-country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.animal-map-country-list button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.animal-map-country-list button:hover,
.animal-map-country-list button:focus-visible {
  border-color: rgba(255, 201, 123, 0.44);
  background: rgba(255, 201, 123, 0.12);
}

.animal-map-country-list strong {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffc97b;
  color: #0b1018;
  font-size: 0.68rem;
}

@keyframes mapPulse {
  0% {
    opacity: 0.86;
    r: 7;
  }

  100% {
    opacity: 0;
    r: 24;
  }
}

.related-list {
  display: grid;
  gap: 10px;
}

.country-animal-list {
  display: grid;
  gap: 10px;
}

.country-animal-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.country-animal-item img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
}

.country-animal-item strong,
.country-animal-item span,
.country-animal-item small {
  display: block;
}

.country-animal-item span,
.country-animal-item small {
  color: var(--muted);
}

.related-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.related-item span {
  font-weight: 700;
}

.related-item small {
  color: var(--muted);
}

.empty-state,
.detail-empty {
  padding: 26px;
  border-radius: 8px;
  border: 1px dashed rgba(126, 224, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.empty-state h3,
.detail-empty h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
}

.empty-state p,
.detail-empty p {
  margin: 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

@media (max-width: 1280px) {
  .hero-copy-grid {
    grid-template-columns: 1fr;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 980px) {
  body {
    padding: 14px;
  }

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

  .site-intro-copy h2 {
    max-width: 15ch;
  }

  .site-intro-art {
    max-width: 520px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .filter-rail {
    position: static;
    order: 2;
  }

  .results-panel {
    order: 1;
    min-height: auto;
  }

  .detail-panel {
    order: 3;
  }

  .hero-tools {
    grid-template-columns: 1fr;
  }

  .search-combo {
    grid-template-columns: 1fr;
  }

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

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

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

  .site-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .footer-note,
  .footer-copyright {
    text-align: left;
    justify-self: start;
  }

  .home-section-heading {
    grid-template-columns: 1fr;
  }

  .home-section-heading p:not(.panel-label) {
    text-align: left;
  }

  .endangered-link-button {
    justify-content: flex-start;
    min-height: auto;
    min-width: 100%;
  }
}

@media (max-width: 640px) {
  .hero-copy,
  .hero-panel,
  .filter-rail,
  .results-panel,
  .detail-panel {
    padding: 14px;
  }

  .hero h1 {
    font-size: 2.7rem;
    max-width: none;
  }

  .site-intro-card {
    padding: 14px;
  }

  .site-intro-copy h2 {
    font-size: 2rem;
  }

  .site-intro-art {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .site-intro-art img:nth-child(2) {
    transform: none;
  }

  .stats-row,
  .detail-facts {
    grid-template-columns: 1fr;
  }

  .hero-filter-bar-top {
    flex-direction: column;
  }

  .hero-filter-selects {
    grid-template-columns: 1fr;
  }

  .type-showcase-grid {
    grid-template-columns: 1fr;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
  }

  .endangered-preview-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-result-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .search-profile-hero {
    grid-template-columns: 1fr;
  }

  .search-modal {
    padding: 12px;
  }

  .search-modal-dialog {
    padding: 14px;
  }

  .search-results-heading {
    padding-right: 0;
    padding-top: 34px;
  }

  .endangered-link-card {
    padding: 14px;
  }

  .home-section-heading h2 {
    font-size: 1.65rem;
  }

  .type-showcase-image-wrap {
    aspect-ratio: 16 / 11;
  }

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

  .animal-modal {
    padding: 12px;
  }

  .animal-modal-dialog {
    padding: 14px;
  }

  .animal-modal-content-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-right: 0;
    padding-top: 34px;
  }

  .animal-modal-copy h2 {
    font-size: 2rem;
  }

  .animal-map-heading {
    display: grid;
  }

}
