:root {
  --bg: #050816;
  --bg-alt: #0b1020;
  --card-bg: #0f172a;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-subtle: #1f2937;
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
  color: var(--text-main);
  min-height: 100vh;
}

/* Layout helpers */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 4.5rem 0;
}

.section-alt {
  padding: 4.5rem 0;
  background: radial-gradient(circle at top, #020617, #020617 50%, #000 100%);
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.9rem;
  margin: 0 0 0.5rem;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.6),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 30% 0, #60a5fa, #2563eb);
  color: #e5e7eb;
  font-weight: 700;
  font-size: 0.9rem;
}

.logo-text {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.main-nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.9rem;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #60a5fa, #a855f7);
  border-radius: 999px;
  transition: width 0.18s ease-out;
}

.main-nav a:hover {
  color: var(--text-main);
}

.main-nav a:hover::after {
  width: 100%;
}

/* Hero */

.hero {
  padding: 3.5rem 0 3rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 2.5rem;
  align-items: stretch;
}

.hero-text h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.hero-text p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.search-bar {
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius-full);
  padding: 0.18rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  align-items: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  padding: 0.65rem 0.9rem;
  flex: 1;
  color: var(--text-main);
  font-size: 0.95rem;
}

.search-bar input::placeholder {
  color: #6b7280;
}

.hero-actions {
  margin-bottom: 1rem;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.35rem 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s,
    transform 0.08s;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text-main);
  transform: translateY(-1px);
}

.chip-active {
  background: linear-gradient(to right, #2563eb, #a855f7);
  border-color: transparent;
  color: #f9fafb;
}

/* Hero side card */

.hero-highlight-card {
  background: radial-gradient(circle at top left, #1d4ed8, #0f172a 55%);
  border-radius: 24px;
  padding: 1.5rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
}

.hero-highlight-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.hero-highlight-card p {
  margin: 0 0 1rem;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.hero-highlight-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.highlight-item {
  padding: 0.55rem 0.6rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.82rem;
}

.highlight-item span {
  display: block;
}

.highlight-name {
  font-weight: 600;
}

.highlight-meta {
  color: #cbd5f5;
  font-size: 0.78rem;
}

/* Toolbar */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filter-group select {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* Tool cards */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.tool-card {
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #020617, #020617 55%, #020617);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.8);
  position: relative;
  overflow: hidden;
}

.tool-card-featured::before {
  content: "Featured";
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(to right, #4f46e5, #ec4899);
  color: #f9fafb;
}

.tool-header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tool-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: radial-gradient(circle at top, #1d4ed8, #0f172a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.tool-title-block h3 {
  margin: 0;
  font-size: 1rem;
}

.tool-title-block .tool-category-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tool-description {
  margin: 0.25rem 0 0.4rem;
  color: #d1d5db;
  font-size: 0.88rem;
}

.tool-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.72rem;
}

.badge-primary {
  border-color: transparent;
  background: var(--accent-soft);
  color: #bfdbfe;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.tool-tag {
  font-size: 0.72rem;
  color: #9ca3af;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.tool-footer {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-footer a {
  font-size: 0.8rem;
  text-decoration: none;
  color: #bfdbfe;
  font-weight: 500;
}

.tool-footer a:hover {
  text-decoration: underline;
}

.no-results {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* Categories overview */

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.category-card {
  border-radius: 1rem;
  background: radial-gradient(circle at top, #020617, #020617 55%, #020617);
  border: 1px solid var(--border-subtle);
  padding: 0.9rem 0.95rem;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.75);
}

.category-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
}

.category-card p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.category-card span {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Newsletter */

.newsletter {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  align-items: center;
  border-radius: 1.3rem;
  background: radial-gradient(circle at top left, #1d4ed8, #0f172a 60%);
  padding: 1.8rem 1.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: var(--shadow-soft);
}

.newsletter-text h2 {
  margin: 0 0 0.3rem;
}

.newsletter-text p {
  margin: 0;
  color: #e5e7eb;
  max-width: 24rem;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.newsletter-form input {
  border-radius: var(--radius-full);
  border: none;
  padding: 0.55rem 0.8rem;
  min-width: 240px;
  font-size: 0.9rem;
}

.newsletter-form button {
  border-radius: var(--radius-full);
  border: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  background: #020617;
  color: #e5e7eb;
}

/* Submit form */

.submit-form {
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-subtle);
  padding: 1.4rem 1.3rem;
  box-shadow: var(--shadow-soft);
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.5rem 0.6rem;
  background: #020617;
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-field textarea {
  resize: vertical;
}

.submit-btn {
  margin-top: 1rem;
  border-radius: var(--radius-full);
  border: none;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(to right, #2563eb, #a855f7);
  color: #f9fafb;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: #020617;
  margin-top: 3rem;
}

.footer-inner {
  padding: 1.8rem 0 2rem;
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr);
  gap: 1.4rem;
  align-items: center;
}

.footer-logo {
  margin-bottom: 0.35rem;
}

.footer-text {
  margin: 0;
  color: var(--text-muted);
  max-width: 26rem;
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: flex-end;
}

.footer-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: #e5e7eb;
  text-decoration: underline;
}

.footer-meta {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: right;
}

/* Responsive */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-highlight-card {
    order: -1;
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-meta {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .main-nav {
    font-size: 0.8rem;
    gap: 0.8rem;
    flex-wrap: wrap;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .hero-text h1 {
    font-size: 1.9rem;
  }

  .tools-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .newsletter {
    padding: 1.4rem 1.1rem;
  }

  .newsletter-form input {
    min-width: 100%;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
