:root {
  --bg: #070a12;
  --surface: #101522;
  --surface-2: #151b2a;
  --ink: #f7f9ff;
  --muted: #9aa7bd;
  --line: rgba(148, 163, 184, .18);
  --accent: #38bdf8;
  --accent-2: #8b5cf6;
  --ad: #f2c76b;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% -12%, rgba(56, 189, 248, .16), transparent 34%),
    radial-gradient(circle at 80% 0%, rgba(139, 92, 246, .13), transparent 30%),
    var(--bg);
  color: var(--ink);
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(7, 10, 18, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.theme-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.theme-switcher button {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.theme-switcher button.active {
  background: rgba(255, 255, 255, .1);
  color: var(--ink);
}

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

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

nav a,
.submit-link {
  text-decoration: none;
}

nav a:hover,
.submit-link:hover {
  color: var(--accent);
}

.submit-link {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 64px) 72px;
}

.hero {
  padding: clamp(52px, 8vw, 96px) 0 44px;
}

.compact-hero {
  padding-bottom: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 18px;
  font-size: clamp(46px, 7vw, 86px);
  line-height: .98;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
}

h3 {
  font-size: 22px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.lede {
  max-width: 720px;
  font-size: 20px;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 820px;
  margin-top: 28px;
  padding: 8px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box input {
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.search-box button,
.mid-ad a {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.quick-tags,
.data-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quick-tags a,
.data-links a {
  padding: 8px 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

section {
  margin-top: 46px;
}

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

.section-heading h2 {
  max-width: 760px;
}

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

.category-grid a,
.tool-card,
.task-grid article,
.data-layer,
.mid-ad {
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.category-grid a {
  display: grid;
  gap: 18px;
  min-height: 124px;
  padding: 16px;
  text-decoration: none;
}

.category-grid span {
  font-weight: 850;
}

.category-grid strong {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  padding: 18px;
}

.tool-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badge,
.free,
.paid {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.badge {
  background: rgba(56, 189, 248, .12);
  color: #7dd3fc;
}

.free {
  background: rgba(34, 197, 94, .12);
  color: #86efac;
}

.paid {
  background: rgba(242, 199, 107, .12);
  color: var(--ad);
}

.tool-card ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.tool-card a {
  color: var(--accent);
  font-weight: 850;
}

.mid-ad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-color: rgba(242, 199, 107, .35);
}

.mid-ad span {
  color: var(--ad);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mid-ad h2 {
  margin: 8px 0 8px;
  font-size: clamp(24px, 3vw, 36px);
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.task-grid article {
  padding: 18px;
}

.data-layer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 5vw, 64px);
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 720px;
  margin: 0;
}

@media (max-width: 1050px) {
  .category-grid,
  .tool-grid,
  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-layer,
  .mid-ad {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header,
  .search-box,
  .category-grid,
  .tool-grid,
  .task-grid {
    grid-template-columns: 1fr;
  }

  .submit-link {
    justify-self: start;
  }

  .header-actions {
    justify-self: start;
    flex-wrap: wrap;
  }

  h1 {
    font-size: 46px;
  }
}

body.theme-gold {
  --bg: #070707;
  --surface: #111111;
  --surface-2: #18120b;
  --ink: #fff7e8;
  --muted: #b8aa95;
  --line: rgba(214, 168, 79, .25);
  --accent: #f0c66a;
  --accent-2: #b7791f;
  --ad: #f6d98d;
  background:
    radial-gradient(circle at 20% -12%, rgba(240, 198, 106, .18), transparent 34%),
    radial-gradient(circle at 80% 0%, rgba(183, 121, 31, .12), transparent 30%),
    #070707;
}

body.theme-gold .search-box button,
body.theme-gold .mid-ad a {
  background: linear-gradient(135deg, #f0c66a, #b7791f);
  color: #070707;
}

body.theme-gold .badge {
  background: rgba(240, 198, 106, .12);
  color: #f6d98d;
}

body.theme-gold .mid-ad {
  background: linear-gradient(180deg, rgba(240, 198, 106, .09), rgba(255, 255, 255, .025));
}

body.theme-terminal {
  --bg: #040806;
  --surface: #0b1410;
  --surface-2: #0e1a15;
  --ink: #edfff6;
  --muted: #91aa9e;
  --line: rgba(62, 233, 138, .2);
  --accent: #3ee98a;
  --accent-2: #2dd4bf;
  --ad: #d6f36a;
  background:
    radial-gradient(circle at 16% -12%, rgba(62, 233, 138, .14), transparent 34%),
    radial-gradient(circle at 82% 0%, rgba(45, 212, 191, .12), transparent 30%),
    #040806;
}

body.theme-terminal .search-box button,
body.theme-terminal .mid-ad a {
  background: linear-gradient(135deg, #3ee98a, #2dd4bf);
  color: #03110b;
}

body.theme-terminal .badge {
  background: rgba(62, 233, 138, .12);
  color: #86efac;
}

body.theme-terminal .mid-ad {
  background: linear-gradient(180deg, rgba(62, 233, 138, .08), rgba(255, 255, 255, .025));
}
