:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #5c665f;
  --line: #dce2dc;
  --paper: #fbfcf8;
  --soft: #eef3ea;
  --moss: #355b3f;
  --moss-dark: #203b2a;
  --clay: #a85235;
  --gold: #d6a441;
  --water: #2f6f7f;
  --shadow: 0 18px 45px rgba(23, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(23, 32, 27, 0.1);
  background: rgba(251, 252, 248, 0.92);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  width: 30px;
  height: 30px;
  border: 2px solid var(--moss);
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 36%, var(--gold) 0 8%, transparent 9%),
    linear-gradient(135deg, transparent 20%, var(--moss) 21% 32%, transparent 33% 48%, var(--clay) 49% 58%, transparent 59%);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 64px));
  display: flex;
  align-items: end;
  padding: clamp(72px, 9vw, 138px) clamp(18px, 4vw, 56px) clamp(34px, 5vw, 70px);
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(16, 31, 22, 0.9), rgba(24, 49, 35, 0.63) 48%, rgba(240, 245, 236, 0.32)),
    linear-gradient(135deg, #223729, #426048 46%, #d9d9c7);
  color: white;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(0deg, rgba(23, 32, 27, 0.5), transparent);
  z-index: -1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.84;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 68px),
    linear-gradient(25deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 82px);
}

.track {
  position: absolute;
  display: block;
  width: 62vw;
  max-width: 780px;
  aspect-ratio: 8 / 1;
  border: 16px solid rgba(236, 222, 153, 0.48);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-24deg);
}

.track-one {
  top: 12%;
  right: -10%;
}

.track-two {
  top: 39%;
  right: 8%;
  border-color: rgba(255, 255, 255, 0.24);
  border-left-color: transparent;
  border-right-color: transparent;
  transform: rotate(18deg);
}

.track-three {
  bottom: 10%;
  left: -16%;
  border-color: rgba(168, 82, 53, 0.46);
  border-left-color: transparent;
  border-right-color: transparent;
  transform: rotate(12deg);
}

.hero-content {
  max-width: 780px;
}

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

.hero h1 {
  margin: 0;
  font-size: clamp(3.4rem, 10vw, 8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 650px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17201b;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.11);
  color: white;
}

.section {
  padding: clamp(48px, 7vw, 88px) clamp(18px, 4vw, 56px);
}

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

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

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-weight: 600;
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 700;
}

#reset-filters {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--moss-dark);
  font-weight: 800;
  cursor: pointer;
}

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

.snake-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 30px rgba(23, 32, 27, 0.06);
}

.card-image-link {
  display: block;
  background: var(--soft);
}

.snake-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

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

.card-body h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.scientific {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

.traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trait {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.card-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.5;
}

.text-link,
.back-link {
  color: var(--moss-dark);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover,
.back-link:hover {
  text-decoration: underline;
}

.source-list {
  display: grid;
  gap: 12px;
  max-width: 900px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.source-list a {
  color: var(--moss-dark);
  font-weight: 800;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  padding: clamp(48px, 7vw, 88px) clamp(18px, 4vw, 56px);
  background:
    linear-gradient(90deg, rgba(23, 32, 27, 0.9), rgba(23, 32, 27, 0.42)),
    linear-gradient(135deg, var(--accent), #e4e0cf);
  color: white;
}

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

.profile-copy h1 {
  margin: 12px 0 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.95;
}

.scientific.large {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.profile-summary {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.1rem;
  line-height: 1.6;
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: white;
}

.profile-figure {
  margin: 0;
}

.profile-figure img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.profile-figure figcaption {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.82rem;
}

.profile-figure a {
  color: white;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.profile-grid article {
  min-height: 220px;
  padding: clamp(20px, 3vw, 32px);
  background: white;
}

.profile-grid h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.profile-grid p,
.profile-grid ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.profile-grid ul {
  padding-left: 18px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.swatches span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1120px) {
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 780px) {
  .site-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: auto;
  }

  .filter-bar,
  .species-grid {
    grid-template-columns: 1fr;
  }

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

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