:root {
  --ink: #1f2937;
  --muted: #4b5563;
  --bg: #f5f7ef;
  --card: rgba(255, 255, 255, 0.86);
  --line: #d8e1d0;
  --accent: #0f766e;
  --accent-soft: #99f6e4;
  --chip-bg: #ecfdf5;
  --shadow: 0 16px 40px rgba(2, 44, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overscroll-behavior-y: contain;
}

.sky-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(153, 246, 228, 0.6), transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(252, 211, 77, 0.45), transparent 30%),
    linear-gradient(180deg, #f0fdf4 0%, #f5f7ef 45%, #eef8ff 100%);
}

.container {
  width: min(1140px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.2rem 0 3.5rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.6rem;
  animation: floatIn 460ms ease-out;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.74rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", serif;
}

h1 {
  margin-top: 0.45rem;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0.8rem auto 0;
  max-width: 58ch;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem;
  margin-bottom: 1rem;
  animation: floatIn 560ms ease-out;
}

.toolbar label {
  font-weight: 700;
  color: var(--muted);
}

input[type="date"],
select,
button {
  height: 40px;
  border-radius: 10px;
  border: 1px solid #b7cbbf;
  padding: 0 0.75rem;
  font: inherit;
}

input[type="date"] {
  background: #fff;
  color: var(--ink);
}

select {
  background: #fff;
  color: var(--ink);
  min-width: 220px;
}

button {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.stat-card {
  padding: 0.9rem 1rem;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.6rem;
  font-family: "Fraunces", serif;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 1.1rem 0 0.7rem;
}

.section-title-row p {
  margin: 0;
  color: var(--muted);
}

.birds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.bird-card.card {
  background: transparent;
  overflow: hidden;
  border: 0;
  animation: riseIn 420ms ease both;
}

.bird-photo-wrap {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(120deg, #dcfce7, #dbeafe);
}

.bird-photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.74) 0%,
    rgba(0, 0, 0, 0.42) 34%,
    rgba(0, 0, 0, 0.1) 58%,
    rgba(0, 0, 0, 0) 76%
  );
  pointer-events: none;
}

.bird-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: none;
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e8fff8;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bird-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 0.8rem 0.9rem 1rem;
}

.com-name {
  color: #ffffff;
  font-size: 1.2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.sci-name {
  margin: 0.15rem 0 0.7rem;
  color: rgba(255, 255, 255, 0.88);
  font-style: italic;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.chip {
  background: rgba(10, 20, 18, 0.6);
  border: 1px solid rgba(185, 236, 220, 0.45);
  color: #f3fffb;
  backdrop-filter: blur(2px);
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.83rem;
  font-weight: 700;
}

.empty-state {
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 1rem);
    padding-top: 1.2rem;
  }

  .bird-photo-wrap {
    height: 230px;
  }

  .toolbar {
    padding: 0.85rem;
  }
}
