:root {
  --bg: #f5efe4;
  --panel: rgba(255, 252, 246, 0.84);
  --panel-strong: #fffaf0;
  --text: #1b1a17;
  --muted: #6f675b;
  --accent: #cb5d2d;
  --accent-dark: #8f3410;
  --line: rgba(27, 26, 23, 0.1);
  --shadow: 0 24px 60px rgba(74, 46, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(203, 93, 45, 0.2), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(235, 199, 92, 0.2), transparent 24%),
    linear-gradient(180deg, #f8f2e8 0%, #f2eadb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(27, 26, 23, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 26, 23, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  padding: 28px;
}

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

.hero h1 {
  margin: 0;
  /* max-width: 10ch; */
  font-size: clamp(2.5rem, 8vw, 5.6rem);
  line-height: 0.95;
}

.hero-copy {
  /* max-width: 640px; */
  margin: 20px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

code {
  padding: 0.12em 0.36em;
  border-radius: 999px;
  background: rgba(27, 26, 23, 0.06);
  font-family: inherit;
}

.search-panel {
  padding: 0 28px;
}

.search-form,
.results,
.empty-state {
  backdrop-filter: blur(16px);
}

.search-form {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-label {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-row input,
.search-row button,
.download-link {
  border: 0;
  border-radius: 18px;
  font: inherit;
}

.search-row input {
  min-width: 0;
  padding: 16px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(27, 26, 23, 0.08);
}

.search-row input:focus {
  outline: 2px solid rgba(203, 93, 45, 0.28);
  outline-offset: 2px;
}

.search-row button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  font-weight: 600;
  color: #fff9f4;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.search-row button:hover,
.download-link:hover,
.image-link:hover {
  transform: translateY(-1px);
}

.status {
  margin: 14px 2px 0;
  min-height: 1.5em;
  color: var(--muted);
}

.status[data-tone="success"] {
  color: #27613c;
}

.status[data-tone="warning"] {
  color: #8a5d09;
}

.status[data-tone="error"] {
  color: #8b1f1f;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  padding: 28px;
  margin-top: 22px;
}

.result-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.image-link {
  display: block;
  background: #e8dfd0;
}

.result-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.result-meta {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.result-category {
  margin: 0;
  font-weight: 700;
}

.result-bibs {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 252, 246, 0.68);
}

.support {
  margin: 10px;
}

footer {
  margin-top: 40px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

footer p {
  margin: 4px 0;
}

footer img {
  width: 200px;
  height: 100px;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1120px);
    padding: 24px 0 48px;
  }

  .hero,
  .search-panel,
  .results {
    padding-left: 12px;
    padding-right: 12px;
  }

  .search-form {
    padding: 18px;
    border-radius: 22px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }
}