* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fdf6ee;
  color: #333;
  padding: 1.5rem;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-text-size-adjust: 100%; /* Prevents iOS from scaling text */
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #f0f0f0;
  }

  h1, h2, p a, a {
    color: #e8a44a;
  }

  a:hover {
    text-decoration-color: #e8a44a;
  }
}

h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0.75rem;
  text-align: center;
  font-size: 1.4rem;
  line-height: 1.3;
}

p {
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

a {
  color: #e8a44a;
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: #d4922e;
  text-decoration: underline;
}

/* Cats grid container */
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  max-width: 100%;
  margin: 0 auto;
}

/* Cat cards - responsive layout */
.cat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 260px;
  min-width: 240px;
  max-width: calc(50% - 0.75rem); /* Default: 2 cards per row */
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cat-card h2 {
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 1.4rem;
}

.cat-card p {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.cat-card a {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  background: #e8a44a;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.cat-card a:hover {
  background: #d4922e;
  transform: scale(1.02);
}

.short-url {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.75rem;
  padding: 0.3rem 0.5rem;
  background: #f5f5f5;
  border-radius: 4px;
  display: inline-block;
}

/* Responsive typography */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .cat-card {
    max-width: calc(100% - 1rem); /* Stack vertically on smaller screens */
    width: 100%;
    padding: 1.25rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .cat-card a {
    padding: 0.5rem 1.1rem;
    font-size: 0.9rem;
  }

  .short-url {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.75rem;
    font-size: 16px; /* Prevents iOS text zoom */
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
  }

  .cat-card {
    padding: 1rem;
    border-radius: 10px;
  }

  .cat-card h2 {
    font-size: 1.2rem;
  }

  .cat-card p {
    font-size: 0.95rem;
  }

  .cat-card a {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .short-url {
    font-size: 0.75rem;
  }
}

/* Landscape tablets - show 2 cards per row */
@media (min-width: 600px) and (max-width: 900px) and (orientation: landscape) {
  .cat-card {
    max-width: calc(50% - 0.75rem);
  }
}

/* Ensure touch targets are accessible */
.cat-card a,
a:hover {
  min-height: 44px; /* Touch-friendly height */
  display: inline-block;
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}
