/* ==========================================================================
   Thalion Biobank Portal - Styles
   Inspired by thalion.global - dark, scientific, editorial
   ========================================================================== */

/* TT Norms Pro - Thalion brand sans (commercial, TypeType foundry).
   Local files in /fonts. Make sure the Thalion web license covers the
   domain this portal is hosted on before going public. */
@font-face {
  font-family: 'TT Norms Pro';
  src: url('fonts/TTNormsPro-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TT Norms Pro';
  src: url('fonts/TTNormsPro-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TT Norms Pro';
  src: url('fonts/TTNormsPro-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'TT Norms Pro';
  src: url('fonts/TTNormsPro-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TT Norms Pro';
  src: url('fonts/TTNormsPro-DemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Core palette */
  --bg: #0a0c0e;
  --bg-elevated: #13161a;
  --bg-card: #15181d;
  --bg-hover: #1b1f25;
  --border: #24282e;
  --border-bright: #343942;

  /* Text */
  --text: #eae4d5;
  --text-muted: #9a9ea5;
  --text-dim: #5a5d63;

  /* Accents */
  --accent: #c4a467;        /* Thalion warm gold */
  --accent-bright: #e0bc7a;
  --accent-dim: #8b7347;

  /* Status */
  --status-complete: #5fa68e;
  --status-progress: #c4a467;
  --status-pending: #2a2e34;
  --status-pending-text: #6a6e75;

  /* IUCN traffic-light */
  --iucn-cr: #c2314a;
  --iucn-en: #d46d2d;
  --iucn-vu: #c9a63b;
  --iucn-nt: #8aa53d;
  --iucn-lc: #4e9464;
  --iucn-na: #5a5d63;
  --iucn-unknown: #4a4d52;

  --maxw: 1440px;
  --radius: 2px;
  --radius-lg: 6px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* Display typography */
.display, h1, h2, h3 {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 1.6vw, 1.5rem); }

.mono {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-variant-ligatures: none;
  font-feature-settings: 'tnum';
}

.eyebrow {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   TOP NAV — mirrors Thalion's minimal lowercase nav
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 14, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg,
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand span strong { font-weight: 400; color: var(--text); }
.brand span .sub {
  display: block;
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.nav-links a {
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
}

.nav-cta {
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border-bright);
  border-radius: 100px;
  color: var(--text);
  transition: all 0.25s var(--ease);
}
.nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

@media (max-width: 800px) {
  .nav-links { display: none; }
}

/* ==========================================================================
   PAGE CONTAINERS
   ========================================================================== */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 2rem;
}

.view { display: none; }
.view.active { display: block; }

/* ==========================================================================
   HERO (portal landing)
   ========================================================================== */

.hero {
  padding: 5rem 2rem 4rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(196, 164, 103, 0.08), transparent),
    radial-gradient(ellipse 50% 50% at 0% 100%, rgba(95, 166, 142, 0.05), transparent);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.hero-text {
  min-width: 0;  /* allow shrinking inside grid */
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(196, 164, 103, 0.15);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(196,164,103,0.15); }
  50% { box-shadow: 0 0 0 7px rgba(196,164,103,0.05); }
}

.hero h1 {
  margin-bottom: 1.8rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.hero-lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

/* YouTube embed — 16:9 frame with subtle border to match site chrome */
.hero-video {
  min-width: 0;
}
.hero-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.hero-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}
.hero-stat {
  padding: 0.5rem 1.5rem 0.5rem 0;
  border-right: 1px solid var(--border);
}
.hero-stat:last-child { border-right: none; }
.hero-stat-num {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  font-variation-settings: 'opsz' 144, 'SOFT' 0;
}
.hero-stat-num .unit {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 0.2rem;
}
.hero-stat-label {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.4rem;
}

/* ==========================================================================
   CONTROLS BAR (filters + search + view toggle)
   ========================================================================== */

.controls {
  padding: 2rem 2rem 1rem;
  position: sticky;
  top: 60px;
  background: rgba(10, 12, 14, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.controls-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.search {
  flex: 1;
  min-width: 240px;
  max-width: 340px;
  position: relative;
}
.search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem 0.65rem 2.3rem;
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-hover);
}
.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 15px; height: 15px;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-label {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-right: 0.25rem;
}
.filter-btn {
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.2s var(--ease);
  cursor: pointer;
}
.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-bright);
}
.filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.view-toggle {
  margin-left: auto;
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-toggle button {
  padding: 0.5rem 0.8rem;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}
.view-toggle button:last-child { border-right: none; }
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active {
  background: var(--bg-hover);
  color: var(--accent);
}
.view-toggle svg { width: 14px; height: 14px; }

.result-count {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ==========================================================================
   ANIMAL GRID + TABLE
   ========================================================================== */

.grid-section {
  padding: 2rem 2rem 6rem;
}
.grid-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

/* Grid view */
.animal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.animal-card {
  background: var(--bg);
  padding: 1.4rem 1.4rem 1.2rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 210px;
  position: relative;
}
.animal-card:hover {
  background: var(--bg-hover);
}
.animal-card:hover .card-arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

.card-arrow {
  position: absolute;
  top: 1.3rem;
  right: 1.3rem;
  color: var(--text-dim);
  transition: all 0.25s var(--ease);
}
.card-arrow svg { width: 14px; height: 14px; }

.card-head {
  padding-right: 1.5rem;
}
.card-name {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.32rem;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.3rem;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}
.card-scientific {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.card-meta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.72rem;
}
.card-meta .group {
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.card-lifespan {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  color: var(--text);
}
.card-lifespan .num {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}
.card-lifespan .lbl {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border);
}

.iucn-badge {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  padding: 3px 7px 3px 15px;
  border-radius: 100px;
  position: relative;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.iucn-badge::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
}
.iucn-badge.cr::before { background: var(--iucn-cr); }
.iucn-badge.en::before { background: var(--iucn-en); }
.iucn-badge.vu::before { background: var(--iucn-vu); }
.iucn-badge.nt::before { background: var(--iucn-nt); }
.iucn-badge.lc::before { background: var(--iucn-lc); }
.iucn-badge.na::before { background: var(--iucn-na); }
.iucn-badge.unknown::before { background: var(--iucn-unknown); }
.iucn-badge.other::before { background: var(--iucn-unknown); }

/* Progress bar — horizontal cells */
.progress-strip {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  height: 6px;
}
.progress-strip .cell {
  height: 100%;
  background: var(--status-pending);
  border-radius: 1px;
}
.progress-strip .cell.complete { background: var(--status-complete); }
.progress-strip .cell.in_progress { background: var(--status-progress); }

/* Table view */
.animal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.animal-table thead th {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 125px;
  z-index: 10;
  white-space: nowrap;
}
.animal-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.animal-table tbody tr:hover { background: var(--bg-hover); }
.animal-table td {
  padding: 0.9rem 1rem;
  vertical-align: middle;
}
.animal-table .name-cell {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.02rem;
  color: var(--text);
}
.animal-table .sci-cell {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.animal-table .lifespan-cell {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.82rem;
}
.animal-table .progress-strip {
  max-width: 160px;
}

.no-results {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.2rem;
  font-style: italic;
}

/* ==========================================================================
   ANIMAL DETAIL VIEW
   ========================================================================== */

.detail-back {
  padding: 1.5rem 2rem 0;
  max-width: var(--maxw);
  margin: 0 auto;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 14px; height: 14px; }

.detail-hero {
  padding: 3rem 2rem 2.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.detail-eyebrow {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.detail-name {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.02;
  margin-bottom: 0.7rem;
  max-width: 18ch;
}
.detail-scientific {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-muted);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  margin-bottom: 2rem;
}

/* Hero image (optional — renders only if a matching file exists in images/) */
.detail-image-wrap {
  margin: 0 0 2.4rem 0;
  padding: 0;
}
.detail-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #14171a;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* subtle fade-in so the photo doesn't pop abruptly on load */
  opacity: 0;
  transition: opacity 0.35s ease-out;
}
.detail-image[src] { opacity: 1; }
.detail-image-credit {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.6rem;
  text-align: right;
}
@media (max-width: 640px) {
  .detail-image-frame { aspect-ratio: 4 / 3; }
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 1.8rem;
}
.detail-fact {
  padding: 0 1.5rem 0 0;
  border-right: 1px solid var(--border);
}
.detail-fact:last-child { border-right: none; }
.detail-fact dt {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.detail-fact dd {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.6rem;
  line-height: 1.1;
  font-weight: 300;
  color: var(--text);
  font-variation-settings: 'opsz' 144, 'SOFT' 0;
}
.detail-fact dd .unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.2rem;
}
.detail-fact dd.small {
  font-size: 0.95rem;
  line-height: 1.35;
}

/* Main detail body grid */
.detail-body {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 3rem;
}
@media (max-width: 900px) {
  .detail-body { grid-template-columns: 1fr; gap: 2rem; }
}

.detail-section {
  margin-bottom: 3rem;
}
.detail-section:last-child { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.section-head .num {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.section-head h3 {
  font-size: 1.5rem;
  flex: 1;
}

.prose p {
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.65;
}
.prose p:last-child { margin-bottom: 0; }
.prose .lede {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 1.4rem;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
}
.prose .range-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Map */
#animal-map {
  width: 100%;
  height: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  filter: saturate(0.7) brightness(0.9);
}
.map-wrap { position: relative; }
.map-cite {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.63rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-top: 0.6rem;
  text-transform: uppercase;
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}
.checklist-head {
  padding: 1rem 1.2rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.checklist-head .pct {
  color: var(--accent);
  font-weight: 500;
}
.checklist-subgroup {
  border-bottom: 1px solid var(--border);
}
.checklist-subgroup:last-child { border-bottom: none; }
.checklist-subgroup-head {
  padding: 0.7rem 1.2rem 0.4rem;
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.checklist-item {
  padding: 0.85rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.9rem;
  color: var(--text);
  border-top: 1px solid var(--border);
}
.checklist-item:first-of-type { border-top: none; }

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  border: 1px solid transparent;
}
.status-dot.complete {
  background: var(--status-complete);
  box-shadow: 0 0 0 3px rgba(95, 166, 142, 0.12);
}
.status-dot.complete::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  width: 3px;
  height: 6px;
  border-right: 1.5px solid var(--bg);
  border-bottom: 1.5px solid var(--bg);
  transform: rotate(45deg);
}
.status-dot.in_progress {
  background: var(--bg-card);
  border-color: var(--status-progress);
  box-shadow: inset 0 0 0 3px var(--bg-card), 0 0 0 2.5px var(--status-progress);
}
.status-dot.not_started {
  background: var(--bg-card);
  border-color: var(--border-bright);
}

.item-label {
  flex: 1;
  color: var(--text);
}
.checklist-item.not_started .item-label { color: var(--text-muted); }

.item-status-tag {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.item-status-tag.complete { color: var(--status-complete); }
.item-status-tag.in_progress { color: var(--status-progress); }

/* Data access lock */
.data-lock {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  position: relative;
  overflow: hidden;
}
.data-lock::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent 0, transparent 10px,
    rgba(196, 164, 103, 0.02) 10px, rgba(196, 164, 103, 0.02) 12px
  );
  pointer-events: none;
}
.lock-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.lock-icon svg { width: 18px; height: 18px; }
.lock-text { flex: 1; position: relative; z-index: 1; }
.lock-text h4 {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.lock-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.lock-cta {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  cursor: not-allowed;
  opacity: 0.8;
  position: relative;
  z-index: 1;
  transition: all 0.2s var(--ease);
}
.lock-cta:hover { background: rgba(196, 164, 103, 0.08); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 2rem;
  background: var(--bg-elevated);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}
.footer-tagline {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 1.3rem;
  color: var(--text);
  max-width: 22ch;
  margin-bottom: 1rem;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
}
.footer-mini {
  font-family: 'TT Norms Pro', -apple-system, sans-serif;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-right {
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-right a { color: var(--accent); }
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-right { text-align: left; }
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media (max-width: 700px) {
  .hero { padding: 3rem 1.2rem 2.5rem; }
  .container, .controls, .grid-section, .detail-back, .detail-hero, .detail-body, .footer { padding-left: 1.2rem; padding-right: 1.2rem; }
  .nav-inner { padding: 1rem 1.2rem; gap: 1rem; }
  .hero-stat { padding-right: 1rem; }
  .detail-fact { padding-right: 1rem; }
  .animal-table { font-size: 0.82rem; }
  .animal-table td, .animal-table th { padding: 0.7rem 0.6rem; }
  .animal-table .progress-strip { max-width: 100px; }
}

/* Loading shimmer */
.shimmer {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
}
.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Entry animation */
.fade-in {
  animation: fadeIn 0.5s var(--ease);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
