:root {
  --bg: #07090d;
  --surface: #0f131a;
  --surface-2: #151a23;
  --line: rgba(255,255,255,.08);
  --text: #f7f8fa;
  --muted: #9299a7;
  --accent: #7c5cff;
  --accent-2: #19d3ae;
  --shadow: 0 22px 60px rgba(0,0,0,.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(124,92,255,.14), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(25,211,174,.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(7,9,13,.72);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  font-size: 18px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.nav-links {
  display: flex;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}

.hero {
  padding: 110px 0 54px;
}

.hero-inner {
  text-align: center;
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  font-size: clamp(48px, 7vw, 88px);
  line-height: .98;
  letter-spacing: -.065em;
  margin: 30px 0 24px;
}

h1 span {
  display: block;
  color: var(--muted);
}

.hero-copy {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.search-shell {
  max-width: 720px;
  margin: 42px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.11);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 0 16px;
}

.search-shell:focus-within {
  border-color: rgba(124,92,255,.7);
}

.search-icon {
  font-size: 26px;
  color: var(--muted);
}

.search-shell input {
  flex: 1;
  height: 66px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
}

.search-shell kbd {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
}

.quick-links {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.quick-links button,
.categories button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
}

.quick-links button:hover,
.categories button:hover {
  color: var(--text);
  border-color: rgba(255,255,255,.18);
}

.categories button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #6138f5);
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 2px 10px rgba(124,92,255,.25);
}

.section {
  padding: 58px 0;
}

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

.section-head h2 {
  margin: 5px 0 0;
  font-size: 31px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  color: var(--accent-2);
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-count {
  color: var(--muted);
  font-size: 14px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tool-card {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent),
    var(--surface);
  border-radius: 18px;
  padding: 20px;
  min-height: 210px;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.17);
  background: var(--surface-2);
}

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

.tool-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(124,92,255,.17), rgba(25,211,174,.11));
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
}

.favorite {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
}

.favorite.active {
  color: #ffd66b;
}

.tool-card h3 {
  margin: 22px 0 8px;
  font-size: 18px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tool-category {
  position: absolute;
  bottom: 18px;
  left: 20px;
  color: var(--muted);
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  min-height: 210px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.panel h3 {
  margin: 8px 0 22px;
  font-size: 24px;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.mini-item {
  display: flex;
  justify-content: space-between;
  padding: 11px 13px;
  background: rgba(255,255,255,.025);
  border-radius: 10px;
  font-size: 14px;
}

.muted {
  color: var(--muted);
}

.ad-section {
  padding: 12px 0;
}

.ad-slot {
  height: 110px;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #616978;
  font-size: 12px;
  text-align: center;
}

.ad-slot strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 500;
}

.ad-slot.large {
  height: 180px;
}

.empty {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
}

.footer-inner {
  min-height: 160px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner p {
  color: var(--muted);
  margin: 7px 0 0;
}

.footer-links {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 70px;
  }

  h1 {
    font-size: 48px;
  }

  .tools-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    padding: 38px 0;
    display: block;
  }

  .footer-links {
    margin-top: 24px;
    flex-wrap: wrap;
  }
}

body.light-theme {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --line: rgba(0,0,0,.08);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-2: #0d9488;
  --shadow: 0 16px 36px rgba(0,0,0,.06);
  background: var(--bg);
}

body.light-theme .nav {
  background: rgba(255,255,255,.85);
}

body.light-theme .hero-badge {
  background: rgba(0,0,0,.04);
}
