:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #17150f;
  --muted: #6b675c;
  --line: #17150f;
  --accent: #ff5c39;
  --accent-soft: #ffe3db;
  --chip: #efece4;
  --shadow: 6px 6px 0 var(--line);
  --shadow-sm: 3px 3px 0 var(--line);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171511;
    --surface: #211e19;
    --ink: #f2efe8;
    --muted: #a39e91;
    --line: #f2efe8;
    --accent: #ff6b47;
    --accent-soft: #3a221b;
    --chip: #2c2822;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Archivo", system-ui, sans-serif; }

a { color: inherit; }

/* ---------- hero ---------- */
.hero { padding: 72px 24px 40px; }

.hero-inner { max-width: 980px; margin: 0 auto; }

.hero-kicker {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.02;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.mark {
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 0 20px;
}

.hero-links a {
  display: inline-block;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
}

.hero-links a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); }

/* ---------- toolbar ---------- */
main { max-width: 980px; margin: 0 auto; padding: 0 24px 80px; }

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}

#search {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 18px;
  box-shadow: var(--shadow-sm);
  outline: none;
}

#search:focus { box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filters button {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--chip);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}

.filters button:hover { border-color: var(--line); }

.filters button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--line);
}

.count {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 6px 2px 18px;
}

/* ---------- grid & cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
  scroll-margin-top: 24px;
}

.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--line); }

.card.highlight { outline: 3px solid var(--accent); outline-offset: 3px; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-icon {
  font-size: 2rem;
  line-height: 1;
  background: var(--accent-soft);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 9px;
}

.stars {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--chip);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.card h3 { font-size: 1.25rem; font-weight: 900; margin: 0 0 2px; letter-spacing: -0.01em; }

.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }

.tagline {
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 8px;
}

.desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 14px;
  flex-grow: 1;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--chip);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
}

.tag.cat { background: var(--accent-soft); color: var(--ink); }

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.card-actions a {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 6px 14px;
  background: var(--surface);
  transition: background 0.1s, color 0.1s;
}

.card-actions a:hover { background: var(--ink); color: var(--bg); }

.card-actions a.primary { background: var(--accent); color: #fff; }
.card-actions a.primary:hover { background: var(--ink); }

/* ---------- misc ---------- */
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

.linkish {
  font: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer {
  border-top: 2px solid var(--line);
  padding: 28px 24px 40px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .hero { padding-top: 48px; }
  .grid { grid-template-columns: 1fr; }
}
