:root {
  color-scheme: light;
  --ink: #141311;
  --muted: #5e5a55;
  --sand: #f6f1e7;
  --clay: #d8c3a5;
  --copper: #c96f3a;
  --sage: #6b7d6b;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(20, 19, 17, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(
      circle at 15% 20%,
      rgba(201, 111, 58, 0.25),
      transparent 55%
    ),
    radial-gradient(
      circle at 85% 5%,
      rgba(107, 125, 107, 0.2),
      transparent 45%
    ),
    var(--sand);
}

code {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.95em;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero {
  background: var(--white);
  padding: 48px;
  border-radius: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 20% -10% auto auto;
  width: 220px;
  height: 220px;
  background: linear-gradient(140deg, var(--clay), transparent);
  border-radius: 40% 60% 60% 40%;
  opacity: 0.6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 16px;
}

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

h1 {
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1.1;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 24px;
}

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

.hero-actions a {
  text-decoration: none;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.primary {
  background: var(--copper);
  color: var(--white);
  box-shadow: 0 12px 30px rgba(201, 111, 58, 0.3);
}

.secondary {
  background: transparent;
  border-color: var(--copper);
  color: var(--copper);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.controls h2 {
  font-size: 2rem;
}

#stats {
  margin: 0;
  color: var(--muted);
}

.search {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.search input {
  width: min(320px, 70vw);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(20, 19, 17, 0.1);
  font-size: 1rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
}

.load-more {
  border: none;
  background: var(--copper);
  color: var(--white);
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(201, 111, 58, 0.25);
}

.load-more[disabled] {
  opacity: 0.5;
  cursor: default;
}

.card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 280px;
  animation: floatUp 500ms ease forwards;
}

.guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.guide-card {
  background: var(--white);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.guide-card pre {
  background: rgba(20, 19, 17, 0.06);
  padding: 12px 14px;
  border-radius: 16px;
  overflow-x: auto;
}

.card-image {
  background: rgba(216, 195, 165, 0.25);
  padding: 16px;
}

.card-image img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: rgba(216, 195, 165, 0.25);
  border-radius: 16px;
}

.card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  background: rgba(107, 125, 107, 0.15);
  color: var(--sage);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.copy {
  border: none;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.copy.copied {
  background: var(--sage);
}

.empty {
  grid-column: 1 / -1;
  background: var(--white);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  color: var(--muted);
}

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

@media (max-width: 720px) {
  .hero {
    padding: 32px 24px;
  }

  .hero::after {
    inset: 10% -30% auto auto;
    width: 180px;
    height: 180px;
  }

  .controls {
    align-items: flex-start;
  }
}
