@font-face {
  font-family: 'Syne';
  src: url('/fonts/Syne-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk-Variable.ttf') format('truetype-variations');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #11120f;
  --paper: #f4f5f0;
  --white: #ffffff;
  --blue: #0b63f3;
  --blue-soft: #e8f0fe;
  --green: #14a36f;
  --line: #d6d8d1;
  --muted: #5a5d55;
  --pad: max(20px, calc((100vw - 1320px) / 2));

  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

.section-pad {
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 12px 18px;
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* ── Header ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(244, 245, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  min-width: 0;
}

.topbar-brand img {
  height: 28px;
  width: auto;
  display: block;
}

.topbar-brand span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.nav-pill:hover,
.nav-pill:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  outline: none;
}

.search-wrap {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-wrap svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input {
  width: 280px;
  max-width: 100%;
  min-height: 44px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease;
}

.search-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(11, 99, 243, 0.15);
}

/* ── Hero ────────────────────────────────────────────────────── */
.eyebrow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  flex: none;
  margin-top: 0.62em;
}

.hero {
  padding-top: 52px;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: clamp(34px, 4.8vw, 62px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 18px 0 18px;
  max-width: 20ch;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--blue);
}

.hero-lead {
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}

.hero-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta b {
  color: var(--ink);
  font-weight: 700;
}

/* ── Sections & Filters ──────────────────────────────────────── */
.directory-section {
  scroll-margin-top: 84px;
  padding-top: 44px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--line);
}

.directory-section.alt {
  background: var(--white);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 10px 0 8px;
  text-wrap: balance;
}

.section-head h2 code {
  font-family: inherit;
  color: var(--blue);
}

.section-desc {
  max-width: 60ch;
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  text-wrap: pretty;
}

.section-count {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}

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

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 28px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.filter-pill:hover,
.filter-pill:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.filter-pill[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* ── Clickable Site Cards Grid ───────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 16px;
}

.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.directory-section.alt .site-card {
  background: var(--paper);
}

.site-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: transparent;
  transition: background 0.16s ease;
}

.site-card:hover,
.site-card:focus-visible {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -16px rgba(17, 18, 15, 0.35);
  outline: none;
}

.site-card:hover::before,
.site-card:focus-visible::before {
  background: var(--blue);
}

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

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

.card-tag-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.card-flagship {
  display: inline-block;
  padding: 2px 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.card-arrow {
  flex: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  transition: transform 0.16s ease, color 0.16s ease;
}

.site-card:hover .card-arrow,
.site-card:focus-visible .card-arrow {
  color: var(--blue);
  transform: translate(2px, -2px);
}

.site-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.site-card p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.site-domain {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.site-card:hover .site-domain,
.site-card:focus-visible .site-domain {
  color: var(--blue);
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  margin: 32px auto;
  max-width: 520px;
  padding: 28px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.empty-state p {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
  background: var(--blue);
  border-color: var(--blue);
  outline: none;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  padding-top: 28px;
  padding-bottom: 36px;
  font-size: 13px;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}

.footer-row p {
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar {
    gap: 12px;
  }
  .search-wrap {
    margin-left: 0;
    width: 100%;
    order: 3;
  }
  .search-wrap input {
    width: 100%;
  }
  .topbar-nav {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .topbar-nav {
    margin-left: 0;
    width: 100%;
  }
  .nav-pill {
    flex: 1;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .site-card,
  .card-arrow,
  .nav-pill,
  .filter-pill,
  .search-wrap input {
    transition: none;
  }
  .site-card:hover,
  .site-card:focus-visible {
    transform: none;
  }
}
