:root {
  color-scheme: light;
  --paper: #f4efe4;
  --ink: #1d1c19;
  --muted: #6b645a;
  --line: #c9c0b1;
  --white: #bfb490;
  --birthday: #ead9ad;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgb(255 255 255 / 35%), transparent 32rem),
    var(--paper);
}

a {
  color: inherit;
}

a:focus-visible,
audio:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}

.site-header,
.site-footer,
.page-shell {
  width: min(100% - 3rem, 76rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.header-note,
.site-footer {
  color: var(--muted);
  font-size: 0.85rem;
}

.header-nav {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
}

.stats-link {
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.stats-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.page-shell {
  padding-block: 3.5rem 5rem;
}

.intro {
  max-width: 42rem;
  margin-bottom: 2.75rem;
}

.eyebrow,
.birthday-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro h1,
.detail-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.intro h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 7vw, 5.5rem);
}

.intro > p:last-child {
  max-width: 38rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.birthday-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  margin-bottom: 2.75rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--ink);
  background: var(--birthday);
  box-shadow: 5px 5px 0 var(--ink);
  text-align: center;
}

.birthday-banner h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  font-weight: 500;
  line-height: 1.25;
}

.birthday-banner h2 a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.birthday-banner p:last-child {
  margin: 0.65rem 0 0;
  line-height: 1.5;
}

.birthday-kicker {
  margin-bottom: 0.35rem;
}

.birthday-star {
  flex: none;
  font-size: clamp(1.75rem, 4vw, 3rem);
}

.birthday-content {
  min-width: 0;
}

.birthday-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.birthday-cat-image {
  display: block;
  width: clamp(4.5rem, 10vw, 6.5rem);
  aspect-ratio: 4 / 5;
  border: 1px solid var(--ink);
  background: var(--white);
  object-fit: contain;
}

.real-world-heading {
  max-width: 42rem;
}

.real-world-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.real-world-heading > p:last-child {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.photo-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--ink);
  background: var(--white);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.photo-link:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--ink);
}

.photo-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-lightbox {
  width: fit-content;
  max-width: 96vw;
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--paper);
  background: var(--ink);
}

.photo-lightbox::backdrop {
  background: rgb(0 0 0 / 80%);
}

.photo-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
  place-items: center;
}

.lightbox-open {
  overflow: hidden;
}

.gallery-divider {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 2rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-card {
  display: block;
  height: 100%;
  text-decoration: none;
}

.card-image {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--ink);
  background: var(--white);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cat-card:hover .card-image {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--ink);
}

.card-caption {
  padding-top: 0.9rem;
}

.card-caption h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.2;
}

.card-caption p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.empty-message {
  padding: 3rem;
  border: 1px dashed var(--line);
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.cat-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  align-items: start;
  gap: clamp(2rem, 6vw, 5rem);
}

.detail-image {
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 7px 7px 0 var(--ink);
}

.detail-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
}

.detail-copy {
  padding-top: 1rem;
}

.detail-copy h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  overflow-wrap: anywhere;
}

.alternative-name {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.cat-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  padding-block: 1.25rem;
  border-block: 1px solid var(--line);
}

.cat-facts dt {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cat-facts dd {
  margin: 0;
  line-height: 1.4;
}

.cat-description,
.cat-audio {
  margin-top: 2rem;
}

.cat-description h2,
.cat-audio h2 {
  margin: 0 0 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 500;
}

.cat-description p {
  margin: 0;
  line-height: 1.75;
  white-space: pre-line;
}

.cat-audio audio {
  display: block;
  width: 100%;
}

.stats-intro {
  margin-bottom: 3rem;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 44rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--ink);
  background: rgb(255 255 255 / 20%);
  box-shadow: 4px 4px 0 var(--ink);
}

.stat-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-label {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.stats-section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.chart-scroll {
  overflow-x: auto;
  margin-top: 1.5rem;
  padding: 0.5rem 0.25rem 0;
}

.year-chart {
  display: flex;
  gap: 0.75rem;
  min-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.year-column {
  flex: 1 0 3.5rem;
}

.year-bar-area {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 16rem;
  border-bottom: 1px solid var(--ink);
}

.year-value {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.year-bar {
  height: var(--bar-height);
  min-height: 4px;
  background: var(--ink);
}

.year-label {
  display: block;
  padding-top: 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.country-chart {
  display: grid;
  gap: 1.25rem;
  max-width: 52rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.country-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.country-name {
  font-weight: 750;
}

.country-code,
.country-iso {
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.country-iso::before {
  content: "(";
}

.country-iso::after {
  content: ")";
}

.country-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.country-track {
  height: 1.25rem;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 25%);
}

.country-bar {
  width: var(--bar-width);
  min-width: 4px;
  height: 100%;
  background: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 48rem) {
  .page-shell {
    padding-block: 2.5rem 4rem;
  }

  .cat-detail {
    grid-template-columns: 1fr;
  }

  .detail-copy {
    padding-top: 0;
  }

  .detail-image img {
    max-height: none;
  }
}

@media (max-width: 34rem) {
  .site-header,
  .site-footer,
  .page-shell {
    width: min(100% - 2rem, 76rem);
  }

  .header-note {
    display: none;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .gallery-divider {
    margin-block: 2.25rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 0.85rem;
  }

  .card-caption h2 {
    font-size: 1.2rem;
  }

  .card-caption p {
    font-size: 0.8rem;
  }

  .birthday-star {
    display: none;
  }

  .birthday-banner {
    box-shadow: 4px 4px 0 var(--ink);
  }

  .cat-facts {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-image,
  .photo-link {
    transition: none;
  }
}
