:root {
  --bg: #050b14;
  --panel: #0c1524;
  --panel-2: #101b2d;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f7fb;
  --muted: #a9b4c7;
  --link: #dbe7ff;
  --hover: rgba(255, 255, 255, 0.04);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.2);
  --text: #0f172a;
  --muted: #475569;
  --link: #0f172a;
  --hover: rgba(15, 23, 42, 0.04);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.directory-hero {
  margin-bottom: 34px;
}

.hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.theme-toggle {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(240px, 0.9fr);
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.hero-feature {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 28px;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-copy p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.hero-link:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}

.hero-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 24px;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.feature-pill:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}

.directory-section h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
  line-height: 1.1;
}

.section-intro {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 980px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 18px;
}

.category-card {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--panel);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--panel-2);
}

.category-card h3 {
  margin: 0 0 14px;
  font-size: 1.55rem;
  line-height: 1.15;
}

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

.card-link {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 1200px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (max-width: 920px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-feature {
    min-height: 160px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding: 18px 0 40px;
  }

  .hero-copy,
  .hero-feature,
  .category-card {
    border-radius: 18px;
  }

  .hero-copy {
    padding: 22px;
  }

  .hero-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .category-card {
    min-height: 210px;
  }
}