:root {
  color-scheme: light;
  --bg: #f7f8f3;
  --surface: #ffffff;
  --surface-muted: #edf4f2;
  --text: #18201f;
  --muted: #65706d;
  --line: #d9e2dd;
  --accent: #0f766e;
  --accent-strong: #0b4f49;
  --tag-bg: #f1efe3;
  --tag-text: #514829;
  --shadow: 0 18px 45px rgba(24, 32, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.site-header,
main {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 6vw, 4.6rem);
  line-height: 0.95;
}

.summary {
  min-width: 136px;
  padding: 14px 18px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: right;
}

.summary span:first-child {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.summary span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  padding: 24px 0 56px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.search span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input {
  width: 100%;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
}

button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  padding: 0 14px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.download-link:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.meta-line {
  min-height: 28px;
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.dataset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  gap: 14px;
  align-items: start;
  justify-content: start;
}

.dataset-card {
  display: flex;
  width: 240px;
  min-height: 320px;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.card-topline h2 {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.2;
}

.version {
  flex: 0 0 auto;
  max-width: 96px;
  padding: 4px 8px;
  background: var(--surface-muted);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.facts div {
  padding: 10px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  font-size: 0.86rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 29px;
  align-content: start;
}

.tag {
  padding: 5px 9px;
  background: var(--tag-bg);
  border-radius: 999px;
  color: var(--tag-text);
  font-size: 0.74rem;
  font-weight: 700;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 2px;
}

.empty-state {
  padding: 40px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    padding-top: 32px;
  }

  .summary {
    text-align: left;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .dataset-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dataset-card {
    width: 100%;
    min-height: 320px;
  }
}
