:root {
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --display: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --shadow: 0 18px 40px rgba(48, 32, 16, 0.08);
  --columns: 3;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 0% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    var(--bg);
  font-family: var(--font);
  line-height: 1.45;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 64px;
}

.wrap.narrow { width: min(460px, calc(100% - 32px)); padding-top: 48px; }

.top, .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top { padding: 28px 0 8px; }

.brand { text-decoration: none; font-weight: 650; }

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--display);
}

h1 {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-weight: 560;
}

.tagline, .category-copy { color: var(--muted); max-width: 40rem; }

.text-link {
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

.search { margin: 28px 0 8px; }

.search label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.search input, .field input, .field select, .field textarea, .card {
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font: inherit;
}

.search input {
  width: min(380px, 100%);
  border-radius: 999px;
  padding: 12px 16px;
}

.category { margin-top: 36px; }

.category-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.category h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 560;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--cat, var(--accent));
  transform: translateY(-2px);
}

.count { color: var(--muted); }

.tiles {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 176px;
  padding: 18px 18px 16px 22px;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--cat, var(--accent));
}

.tile:hover { transform: translateY(-2px); }

.tile .icon { font-size: 28px; line-height: 1; }

.tile img.icon { width: 36px; height: 36px; object-fit: contain; }

.tile h3 { margin: 0; font-size: 20px; }

.tile p {
  margin: 4px 0 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.host {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
}

.badge, .banner, .flash {
  border-radius: 999px;
  padding: 3px 8px;
}

.badge { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--text); }

.layout-list .tiles { grid-template-columns: 1fr; }

.layout-list .tile {
  min-height: 0;
  flex-direction: row;
  align-items: center;
}

.layout-list .tile-copy { flex: 1; }

.layout-compact .tile { min-height: 96px; padding-top: 12px; padding-bottom: 12px; }

.layout-compact .tile h3 { font-size: 16px; }

.empty, .card {
  margin-top: 28px;
  padding: 22px;
  border-radius: 20px;
}

.empty h2, .card h1 { font-size: 32px; }

.field { display: grid; gap: 6px; margin: 12px 0; }

.field input, .field select, .field textarea {
  width: 100%;
  border-radius: 12px;
  padding: 12px 14px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  font: inherit;
  cursor: pointer;
}

.flash, .banner {
  border-radius: 12px;
  padding: 12px 14px;
}

.flash-ok { background: color-mix(in srgb, #2f7d4a 18%, var(--surface)); }

.flash-error, .banner { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }

footer { margin-top: 48px; color: var(--muted); }

@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .tiles, .layout-list .tiles { grid-template-columns: 1fr; }
  .layout-list .tile { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
}
