@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e6e4de;
  --ink: #1c1d22;
  --muted: #6b6d78;
  --amber: #d98a2b;
  --amber-deep: #b06f1f;
  --amber-tint: #fbf0de;
  --teal: #2f8f82;
  --radius: 8px;
  --max-width: 1080px;
  --shadow-sm: 0 1px 2px rgba(28, 29, 34, 0.05);
  --shadow-md: 0 4px 16px rgba(28, 29, 34, 0.06);
}

:root[data-theme="dark"] {
  --bg: #15161a;
  --surface: #1c1e24;
  --border: #2c2e36;
  --ink: #f1f1ee;
  --muted: #9497a3;
  --amber: #e8a23d;
  --amber-deep: #f0b660;
  --amber-tint: #3a2f1c;
  --teal: #5fc4b8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161a;
    --surface: #1c1e24;
    --border: #2c2e36;
    --ink: #f1f1ee;
    --muted: #9497a3;
    --amber: #e8a23d;
    --amber-deep: #f0b660;
    --amber-tint: #3a2f1c;
    --teal: #5fc4b8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

body { transition: background-color 0.2s ease, color 0.2s ease; }
.site-header, footer.site-footer, .surface, .tool-card, .category-card, .search-box input, .feature-pill, .filter-btn {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* ---------- Header ---------- */

header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand .mark svg { width: 16px; height: 16px; }

nav.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  margin-left: 26px;
  transition: color 0.15s ease;
}

nav.site-nav a:hover,
nav.site-nav a:focus-visible {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 18px;
  flex-shrink: 0;
}

.theme-toggle:hover { color: var(--amber); border-color: var(--amber); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Hero ---------- */

.hero {
  padding: 68px 0 40px;
  text-align: center;
}

.hero h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 auto 16px;
  max-width: 18ch;
}

.hero p.lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto 32px;
}

.search-box {
  max-width: 480px;
  margin: 0 auto 36px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-tint);
}

.search-box svg {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.stat-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 28px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat .n {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--amber-deep);
  line-height: 1;
}

.stat .l {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.feature-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.83rem;
  color: var(--muted);
}

.feature-pill svg { width: 14px; height: 14px; color: var(--amber); flex-shrink: 0; }

/* ---------- Section shell ---------- */

section.section {
  padding: 52px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--muted);
  margin: 0;
  max-width: 56ch;
}

/* ---------- Category chips ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  opacity: 0;
  animation: card-in 0.4s ease forwards;
  animation-delay: calc(var(--stagger, 0) * 40ms);
}

.category-card:hover {
  border-color: var(--amber);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.category-card.active {
  border-color: var(--amber);
  background: var(--amber-tint);
}

.category-card .cat-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.category-card .cat-count {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Filters ---------- */

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

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.filter-btn:hover { color: var(--ink); border-color: var(--amber); }

.filter-btn.active {
  color: #fff;
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 500;
}

/* ---------- Tool cards ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  opacity: 0;
  animation: card-in 0.45s ease forwards;
  animation-delay: calc(var(--stagger, 0) * 25ms);
}

.tool-card.is-hidden { display: none; }

.tool-card:hover {
  border-color: var(--amber);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

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

.copy-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.9);
}

.tool-card:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { border-color: var(--amber); color: var(--amber-deep); }
.copy-btn.copied { color: var(--teal); border-color: var(--teal); opacity: 1; transform: scale(1); }

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--amber-tint);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--amber-deep);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.tool-card h3 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}

.tool-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex-grow: 1;
}

.tool-card .tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--amber-deep);
  text-decoration: none;
  width: fit-content;
}

.tool-card .tool-cta svg {
  width: 13px;
  height: 13px;
  transition: transform 0.15s ease;
}

.tool-card:hover .tool-cta svg {
  transform: translate(2px, -2px);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ---------- How it works ---------- */

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

.step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step .step-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--amber);
}

.step h3 {
  margin: 0;
  font-size: 1rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
}

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

/* ---------- About strip ---------- */

.about-strip p {
  color: var(--muted);
  max-width: 60ch;
  font-size: 0.97rem;
}

.about-strip a.inline-link {
  color: var(--amber-deep);
  font-weight: 500;
  text-decoration: none;
}

/* ---------- Footer ---------- */

footer.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}

.footer-col h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 600;
}

.footer-col p {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 34ch;
  margin: 0;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--amber-deep); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Simple content pages (about/privacy/terms/contact) ---------- */

.page-content {
  padding: 52px 0 60px;
}

.page-content h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 2rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.page-content .updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

.page-content h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.15rem;
  margin-top: 34px;
}

.page-content p, .page-content li {
  color: var(--muted);
  font-size: 0.97rem;
}

.page-content a { color: var(--amber-deep); }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

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

/* ---------- Back to top ---------- */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease, color 0.15s ease;
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover { border-color: var(--amber); color: var(--amber-deep); }
.back-to-top svg { width: 18px; height: 18px; }

/* ---------- Motion & accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .tool-card, .category-card { opacity: 1; }
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
