/* ── DESIGN TOKENS ── */
:root {
  --bg-0: #070709;
  --bg-1: #0f0f14;
  --bg-2: #17171f;
  --bg-3: #202030;
  --bg-4: #2a2a40;
  --border-1: #1e1e2e;
  --border-2: #2a2a3e;
  --border-3: #3a3a58;

  --violet: #7c6fff;
  --violet-light: #8666dc;
  --violet-dark: #5a4fcc;
  --violet-glow: rgba(124, 111, 255, 0.18);
  --violet-glow2: rgba(124, 111, 255, 0.08);

  --cyan: #22d3ee;
  --cyan-light: #67e8f9;
  --cyan-glow: rgba(34, 211, 238, 0.15);

  --green: #22c55e;
  --yellow: #eab308;
  --red: #f43f5e;
  --orange: #f97316;

  --text-0: #ffffff;
  --text-1: #f0f0f0;
  --text-2: #bbbbe4;
  /* lifted for legibility */
  --text-3: #a8a8c5;
  /* lifted for legibility */

  --grad-main: linear-gradient(135deg, var(--violet) 0%, var(--cyan) 100%);
  --grad-subtle: linear-gradient(135deg, rgba(124, 111, 255, .08) 0%, rgba(34, 211, 238, .05) 100%);
  --grad-bg: radial-gradient(ellipse 60% 50% at 50% -10%, rgba(124, 111, 255, .07) 0%, transparent 60%);

  --nav-h: 62px;
  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* Shadows — subtle, not heavy */
  --sh-sm: 0 1px 3px rgba(0, 0, 0, .25);
  --sh-md: 0 3px 12px rgba(0, 0, 0, .28);
  --sh-lg: 0 6px 24px rgba(0, 0, 0, .32);
  --sh-violet: 0 0 16px rgba(124, 111, 255, .15);

  --t-fast: 130ms ease;
  --t-base: 220ms ease;
  --t-slow: 380ms ease;
}

[data-theme="light"] {
  --bg-0: #f4f5f8;
  --bg-1: #f9fbfd;
  --bg-2: #ffffff;
  --bg-3: #eff1f7;
  --bg-4: #e0e4f0;
  --border-1: #e4e7f3;
  --border-2: #d4d8e8;
  --border-3: #a8b0cc;

  /* Text — all values meet WCAG AA on white/light backgrounds */
  --text-0: #0e0e1a;
  /* near-black for headings */
  --text-1: #26263c;
  /* dark for body text */
  --text-2: #44445e;
  /* secondary — was too light before */
  --text-3: #66667e;
  /* muted — was blending before */

  /* Accent colours — darkened for WCAG AA contrast on light backgrounds */
  --violet: #6350e0;
  --violet-light: #5a42d6;
  --violet-dark: #4a3ab5;
  --cyan: #0891b2;
  --cyan-light: #0e7490;
  --green: #16a34a;

  --violet-glow: rgba(124, 111, 255, 0.1);
  --violet-glow2: rgba(124, 111, 255, 0.06);
  --cyan-glow: rgba(14, 116, 144, 0.1);
  --grad-bg: radial-gradient(ellipse 70% 60% at 50% -5%, rgba(124, 111, 255, .04) 0%, transparent 65%);
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remove blue/grey tap flash on mobile touch */
a,
button,
input,
select,
textarea,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* Remove focus outline on click; keep for keyboard navigation */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  background-image: var(--grad-bg);
  background-attachment: fixed;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── LAYOUT STABILITY (CLS) ── */
/* Reserve space on JS-driven containers ONLY when empty (avoids CLS on pre-rendered pages) */
.cat-hero-wrap:empty {
  min-height: 200px;
}

.cat-tabs-wrap:empty {
  min-height: 60px;
}

/* tools-grid min-height removed — causes visible CLS on pre-rendered pages */

/* Skeleton loaders */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

.card-icon svg,
.drop-icon svg,
.section-icon svg,
.drawer-tool-icon svg {
  width: 1em;
  height: 1em;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
}

ul,
ol {
  list-style: none;
}

code,
pre,
.mono {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
}

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
  background: var(--border-3);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--violet-dark);
}

::selection {
  background: var(--violet-glow);
  color: var(--text-0);
}

/* ── LAYOUT ── */
.container {
  width: 100%;
  max-width: 1260px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ── NAVIGATION ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(6, 6, 8, 0.92);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--border-1);
  transition: border-color var(--t-base);
}

[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--border-2);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  min-width: 0;
}

/* Logo — ready for custom SVG/PNG */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  /* Transparent background to natively render the rich SVG */
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border-radius: 10px;
  /* match icon's rx="12" proportionally */
  overflow: hidden;
}


.nav-logo-icon img,
.nav-logo-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-logo:hover .nav-logo-icon {
  opacity: .82;
}

.nav-logo-text {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.03em;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav search */
.nav-search {
  flex: 1;
  max-width: 340px;
  position: relative;
}

.nav-search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 0 12px;
  gap: 8px;
  height: 38px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.nav-search-wrap:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-glow2);
}

.nav-search-wrap svg {
  width: 15px;
  height: 15px;
  color: var(--text-3);
  flex-shrink: 0;
}

#nav-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: .875rem;
  color: var(--text-0);
  min-width: 0;
}

#nav-search-input::placeholder {
  color: var(--text-3);
}

.nav-kbd {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  font-size: .65rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--violet-light);
  background: var(--bg-3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  /* never let nav-actions shrink */
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: transparent;
  transition: all var(--t-fast);
}

.btn-icon:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  background: transparent;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  /* CRITICAL: never let hamburger shrink to 0 */
  transition: background var(--t-fast);
}

.nav-hamburger:hover {
  background: var(--bg-3);
}

.nav-hamburger svg {
  width: 20px;
  height: 20px;
}

/* Mobile search toggle icon — not used, kept for backwards compat */
.nav-mobile-search-btn {
  display: none !important;
}

/* ── ADVANCED MEGA MENU (desktop) ── */
.desktop-menu {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-dropdown {
  position: relative;
}

/* Bridge the gap so the panel doesn't close as mouse moves down */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 16px;
  display: block;
}

.nav-chevron {
  width: 13px;
  height: 13px;
  transition: transform var(--t-fast);
  opacity: .5;
  margin-left: 2px;
}

.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 260px;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 6px;
  box-shadow: var(--sh-md);
  opacity: 0;
  pointer-events: none;
  /* Instant show, delayed hide so mouse can travel to panel */
  transition: opacity 180ms ease, transform 180ms ease;
  transition-delay: 0ms;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.nav-dropdown:not(:hover) .dropdown-panel {
  transition-delay: 180ms;
  /* stay visible 180ms after hover leaves */
}

.nav-dropdown:hover .dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0ms;
}

.drop-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
  color: var(--text-1);
}

.drop-tool:hover {
  background: var(--bg-2);
  color: var(--violet-light);
}

.drop-icon {
  font-size: 1rem;
}

.drop-name {
  font-size: .84rem;
  font-weight: 500;
}

.drop-all {
  display: block;
  text-align: center;
  margin-top: 4px;
  padding: 9px 12px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--violet);
  border-top: 1px solid var(--border-1);
}

.drop-all:hover {
  color: var(--violet-light);
}

/* ── MOBILE DRAWER ── */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}

.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 300;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-1);
  border-left: 1px solid var(--border-1);
  transform: translateX(100%);
  transition: transform var(--t-base);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-1);
}

.drawer-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-0);
}

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
}

.drawer-close:hover {
  background: var(--bg-3);
}

.drawer-close svg {
  width: 18px;
  height: 18px;
}

.drawer-body {
  padding: 12px 16px;
  flex: 1;
}

.drawer-section {
  margin-bottom: 8px;
}

.drawer-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-1);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast);
}

.drawer-cat-btn:hover {
  background: var(--bg-2);
}

.drawer-cat-btn svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform var(--t-fast);
}

.drawer-section.open .drawer-cat-btn svg {
  transform: rotate(180deg);
}

.drawer-cat-tools {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-slow);
  padding-left: 12px;
}

.drawer-section.open .drawer-cat-tools {
  max-height: 400px;
}

.drawer-tool-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: .84rem;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}

.drawer-tool-link:hover {
  background: var(--bg-2);
  color: var(--violet-light);
}

.drawer-tool-icon {
  font-size: .95rem;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-theme-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.drawer-theme-btn:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

.drawer-theme-btn svg {
  width: 15px;
  height: 15px;
}

/* ── SEARCH DROPDOWN (shared) ── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  display: none;
  z-index: 300;
  max-height: 400px;
  overflow-y: auto;
}

.search-dropdown.open {
  display: block;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-1);
  transition: background var(--t-fast);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover,
.search-result.active {
  background: var(--bg-3);
}

.search-result-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.search-result-name {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text-0);
}

.search-result-category {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 1px;
}

.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-3);
  font-size: .85rem;
}

/* ── HERO SECTION ── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(124, 111, 255, .07) 0%, transparent 60%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--violet-glow2);
  border: 1px solid var(--border-3);
  border-radius: var(--r-full);
  padding: 6px 16px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--violet-light);
  margin-bottom: 28px;
  letter-spacing: .02em;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .4;
    transform: scale(.7);
  }
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.08;
  margin-bottom: 22px;
  color: var(--text-0);
}

.hero h1 .grad {
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 500px;
  margin: 0 auto 44px;
  line-height: 1.75;
}

/* Hero search */
.hero-search {
  max-width: 560px;
  margin: 0 auto 48px;
  position: relative;
}

.hero-search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 6px 6px 6px 20px;
  gap: 12px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.hero-search-wrap:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px var(--violet-glow2);
}

.hero-search-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

#hero-search {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-0);
  padding: 6px 0;
}

#hero-search::placeholder {
  color: var(--text-3);
}

.hero-search-btn {
  height: 42px;
  padding: 0 22px;
  background: var(--grad-main);
  border-radius: var(--r-lg);
  font-weight: 700;
  font-size: .875rem;
  color: #fff;
  flex-shrink: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
  cursor: pointer;
  border: none;
}

.hero-search-btn:hover {
  opacity: .88;
  transform: scale(.98);
}

.hero-search .search-dropdown {
  text-align: left;
}

/* Hero stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 52px;
  flex-wrap: wrap;
}

.hero-stat-num {
  display: block;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -.04em;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stat-label {
  font-size: .78rem;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 2px;
}

/* ── CATEGORY CHIPS ── */
.cats-bar {
  padding: 32px 0 20px;
}

.cats-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.cats-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}

.cat-chip:hover,
.cat-chip.active {
  background: var(--violet-glow);
  border-color: var(--violet);
  color: var(--violet-light);
}

/* ── TOOL SECTION ── */
.tool-section {
  padding: 52px 0;
}

.tool-section+.tool-section {
  padding-top: 0;
}

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

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.section-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text-0);
}

.section-count {
  font-size: .78rem;
  color: var(--text-3);
  margin-top: 2px;
}

.see-all-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--violet);
  transition: opacity var(--t-fast);
}

.see-all-link:hover {
  opacity: .7;
}

.see-all-link svg {
  width: 13px;
  height: 13px;
}

/* ── TOOL CARD GRID ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 14px;
}

/* ── TOOL CARD ── */
.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-subtle);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 111, 255, .35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

.tool-card:hover::after {
  opacity: 1;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 14px;
  transition: background var(--t-fast), transform var(--t-fast);
  position: relative;
  z-index: 1;
}

.tool-card:hover .card-icon {
  background: var(--violet-glow);
  transform: scale(1.1);
}

.card-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text-0);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.card-desc {
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
  position: relative;
  z-index: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-1);
  position: relative;
  z-index: 1;
}

.card-open {
  font-size: .75rem;
  font-weight: 600;
  color: var(--violet);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--t-fast);
}

.tool-card:hover .card-open {
  gap: 7px;
}

.card-open svg {
  width: 12px;
  height: 12px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  border: none;
  transition: all var(--t-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 111, 255, .2);
}

.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 3px 14px rgba(124, 111, 255, .28);
}

.btn-secondary {
  background: var(--bg-3);
  color: var(--text-0);
  border: 1px solid var(--border-2);
}

.btn-secondary:hover {
  background: var(--bg-4);
  border-color: var(--border-3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

.btn-sm {
  padding: 7px 14px;
  font-size: .8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: .95rem;
}

.btn svg {
  width: 15px;
  height: 15px;
}

/* ── FORMS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-1);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--text-0);
  outline: none;
  width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.65;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-glow2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-3);
}

.form-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239898b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Range slider */
.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-4);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--violet);
  cursor: pointer;
  transition: transform var(--t-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Checkbox / toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--bg-4);
  transition: background var(--t-fast);
}

.toggle input:checked+.toggle-track {
  background: var(--violet);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--t-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.toggle input:checked~.toggle-thumb {
  transform: translateX(18px);
}

.toggle-label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-1);
  user-select: none;
}

/* ── CARDS ── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 24px;
}

.card-sm {
  padding: 16px;
  border-radius: var(--r-md);
}

/* ── COPY BUTTON ── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.copy-btn:hover {
  background: var(--bg-4);
  color: var(--text-0);
}

.copy-btn.copied {
  background: rgba(34, 197, 94, .12);
  border-color: var(--green);
  color: var(--green);
}

.copy-btn svg {
  width: 13px;
  height: 13px;
}

/* ── CODE OUTPUT ── */
.code-output {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  color: var(--cyan-light);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.7;
  min-height: 60px;
}

/* ── BADGE / TAG ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: .72rem;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
}

.badge-violet {
  background: var(--violet-glow2);
  border-color: var(--violet-dark);
  color: var(--violet-light);
}

.badge-cyan {
  background: var(--cyan-glow);
  border-color: var(--cyan-dark, #06b6d4);
  color: var(--cyan-light);
}

.badge-green {
  background: rgba(34, 197, 94, .1);
  border-color: var(--green);
  color: var(--green);
}

.badge-red {
  background: rgba(244, 63, 94, .1);
  border-color: var(--red);
  color: var(--red);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border-1);
  margin: 32px 0;
}

/* ================================================================
   MOBILE RESPONSIVE SYSTEM
   Breakpoints: 1024px (tablet), 768px (large phone), 480px (small phone)
   ================================================================ */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {

  /* Nav: hide desktop links + mega menu, show hamburger */
  .nav-links,
  .desktop-menu {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  /* Search: constrain but keep visible */
  .nav-search {
    max-width: 220px;
  }

  /* Compress nav link sizing for remaining items */
  .desktop-menu .nav-link {
    padding: 6px 8px;
    font-size: .82rem;
  }

  /* Hero */
  .hero {
    padding: 60px 0 44px;
  }

  .hero-sub {
    font-size: .95rem;
    margin-bottom: 32px;
  }

  /* Tools grid: 2 columns with safe minmax */
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  }

  /* Footer grid collapse */
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

/* ── Large phone (≤768px) ── */
@media (max-width: 768px) {

  /* Disable fixed background on mobile */
  body {
    background-attachment: scroll;
  }

  /* Nav: compress gap, hide brand name, search fills remaining space */
  .nav-inner {
    gap: 10px; /* enough breathing room between logo and search */
  }

  .nav-logo-text {
    display: none;
  }

  .nav-search {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
  }

  .nav-search-wrap {
    min-width: 0;
  }

  .nav-actions {
    /* Keep margin-left:auto so icons stay right-aligned */
    flex-shrink: 0;
    gap: 4px;
  }

  /* Hero */
  .hero {
    padding: 44px 0 36px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
    margin-bottom: 14px;
  }

  .hero-sub {
    font-size: .88rem;
    margin-bottom: 28px;
    max-width: 90%;
  }

  .hero-search {
    margin-bottom: 32px;
  }

  .hero-stats {
    display: none;
  }

  /* Category chips: horizontal scroll on BOTH class names */
  .cat-chips,
  .cats-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .cat-chips::-webkit-scrollbar,
  .cats-scroll::-webkit-scrollbar {
    display: none;
  }

  .cat-chip {
    flex-shrink: 0;
  }

  /* Section header */
  .section-head {
    gap: 10px;
  }

  .section-name {
    font-size: 1rem;
  }

  .section-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  /* Tool cards: 2 column */
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .tool-card {
    padding: 14px;
  }

  .card-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .card-name {
    font-size: .88rem;
  }

  .card-desc {
    font-size: .77rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Category hero: compact horizontal layout like tool header */
  .cat-hero-wrap {
    padding: 24px 0 20px;
  }

  .cat-hero-inner {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .cat-hero-icon-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
  }

  .cat-hero-icon-wrap svg {
    width: 24px;
    height: 24px;
  }

  .cat-hero-title {
    font-size: 1.3rem;
    margin-bottom: 4px;
  }

  .cat-hero-desc {
    font-size: .82rem;
    margin-bottom: 10px;
  }

  /* Footer */
  .footer {
    margin-top: 60px;
    padding: 44px 0 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
  }

  .footer-tagline {
    max-width: 100%;
    font-size: .83rem;
  }
}

/* ── Small phone (≤480px) ── */
@media (max-width: 480px) {
  :root {
    --nav-h: 54px;
  }

  /* Nav: tighter spacing, all icons 40px touch targets */
  .nav {
    height: 54px;
  }

  .nav-inner {
    gap: 8px; /* decent spacing between logo and search */
  }

  .nav-logo-icon {
    width: 30px;
    height: 30px;
  }

  /* Search: limited width so icons can't be crowded out */
  .nav-search {
    flex: 1;
    min-width: 0;
    max-width: 160px;
  }

  .nav-search-wrap {
    height: 34px;
    padding: 0 8px;
  }

  #nav-search-input {
    font-size: .8rem;
  }

  .nav-kbd {
    display: none;
  }

  .btn-icon {
    width: 40px;
    height: 40px;
  }

  .nav-hamburger {
    width: 40px;
    height: 40px;
  }

  /* Hero */
  .hero {
    padding: 28px 0 24px;
  }

  .hero h1 {
    font-size: 1.55rem;
    line-height: 1.2;
  }

  .hero-badge {
    font-size: .70rem;
    padding: 4px 10px;
    margin-bottom: 14px;
  }

  .hero-sub {
    font-size: .82rem;
    margin-bottom: 20px;
  }

  /* Hero search: hide button, use full-width input */
  .hero-search-wrap {
    padding: 6px 12px;
    gap: 8px;
    border-radius: var(--r-lg);
  }

  .hero-search-btn {
    display: none;
  }

  #hero-search {
    font-size: .88rem;
  }

  #hero-search::placeholder {
    font-size: .82rem;
  }

  /* Category bar */
  .cats-bar {
    padding: 16px 0 12px;
  }

  .cat-chip {
    padding: 6px 12px;
    font-size: .78rem;
    gap: 5px;
  }

  /* Tool cards: single column */
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .card-desc {
    display: block;
  }

  /* Category hero: even more compact */
  .cat-hero-wrap {
    padding: 16px 0 12px;
  }

  .cat-hero-icon-wrap {
    width: 44px;
    height: 44px;
  }

  .cat-hero-icon-wrap svg {
    width: 20px;
    height: 20px;
  }

  .cat-hero-title {
    font-size: 1.1rem;
  }

  .cat-hero-desc {
    display: none;
  }

  /* hide verbose desc on tiny screens */
  .cat-hero-meta {
    gap: 6px;
  }

  .cat-badge {
    font-size: .70rem;
    padding: 3px 8px;
  }

  /* Section head: compact */
  .section-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-title-wrap {
    flex: 1;
  }

  .see-all-link {
    font-size: .75rem;
  }

  .container {
    padding-inline: 14px;
  }

  /* Footer: stack */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}


.footer {
  border-top: 1px solid var(--border-2);
  margin-top: 100px;
  padding: 64px 0 32px;
  background: var(--bg-1);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  /* Advanced grid layout */
  gap: 48px;
  margin-bottom: 56px;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 500px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

.footer-brand {
  grid-column: span 1;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-logo-icon {
  width: 32px;
  height: 32px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-icon img,
.footer-logo-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-logo-text {
  font-weight: 800;
  font-size: .95rem;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-tagline {
  font-size: .88rem;
  color: var(--text-3);
  line-height: 1.6;
  max-width: 280px;
  margin-bottom: 24px;
}

.footer-socials {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-social-link {
  color: var(--text-3);
  transition: color var(--t-fast);
}

.footer-social-link:hover {
  color: var(--violet-light);
}

.footer-col-title {
  font-size: .80rem;
  font-weight: 700;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  font-size: .90rem;
  color: var(--text-3);
  transition: color var(--t-fast), transform var(--t-fast);
}

.footer-link:hover {
  color: var(--text-0);
  transform: translateX(2px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border-1);
  font-size: .82rem;
  color: var(--text-muted);
}

/* ── BACK TO TOP ── */
#back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--t-base), transform var(--t-base), background var(--t-fast);
  pointer-events: none;
}

#back-top:hover {
  background: var(--bg-4);
  color: var(--text-0);
}

#back-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-top svg {
  width: 16px;
  height: 16px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-0);
  box-shadow: var(--sh-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-base), transform var(--t-base);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 15px;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-up {
  animation: fadeUp .5s ease forwards;
  opacity: 0;
}

.delay-1 {
  animation-delay: .08s;
}

.delay-2 {
  animation-delay: .16s;
}

.delay-3 {
  animation-delay: .24s;
}




/* ================================================================
   CATEGORY PAGES — Redesigned from scratch
   ================================================================ */

/* ── Card entrance animation ── */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-enter {
  animation: cardEnter 0.35s ease both;
}

/* ── Hero ── */
.cat-hero-wrap {
  padding: 48px 0 36px;
  margin-bottom: 0;
}

.cat-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.cat-hero-icon-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--cat-color, var(--violet)) 12%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--violet)) 30%, var(--border-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cat-color, var(--violet));
  box-shadow: 0 0 28px color-mix(in srgb, var(--cat-color, var(--violet)) 18%, transparent);
}

.cat-hero-icon-wrap svg {
  width: 36px;
  height: 36px;
}

.cat-hero-text {
  flex: 1;
  padding-top: 4px;
}

.cat-hero-parent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color var(--t-fast);
}

.cat-hero-parent:hover {
  color: var(--violet-light);
}

.cat-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 10px;
  background: linear-gradient(135deg, var(--text-0) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cat-hero-desc {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 0 16px;
}

.cat-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
}

.cat-badge-sub {
  background: var(--violet-glow2);
  border-color: var(--violet-dark);
  color: var(--violet-light);
}

/* ── In-hero search & inline search ── */
.cat-hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-full);
  padding: 10px 18px;
  max-width: 440px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.cat-hero-search:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-glow2);
}

.cat-hero-search svg {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}

.cat-hero-search input {
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-0);
  flex: 1;
  min-width: 0;
}

.cat-hero-search input::placeholder {
  color: var(--text-3);
}

.cat-search-inline {
  margin-top: 0;
  max-width: 260px;
}

/* ── Subcategory Tabs ── */
.cat-tabs-wrap {
  margin-top: 32px;
}

.cat-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-1);
  padding-bottom: 0;
}

.cat-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
}

.cat-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.cat-tab:hover {
  color: var(--text-1);
}

.cat-tab.active {
  color: var(--text-0);
  border-bottom-color: var(--violet);
}

.cat-tab-icon {
  display: inline-flex;
}

.cat-tab-icon svg {
  width: 15px;
  height: 15px;
}

.cat-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-3);
  border-radius: 99px;
  padding: 1px 7px;
  color: var(--text-3);
}

.cat-tab.active .cat-tab-count {
  background: var(--violet-glow2);
  color: var(--violet-light);
}

/* ── Subcategory showcase sections ── */
.cat-subcat-section {
  margin-bottom: 48px;
}

.cat-subcat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.cat-subcat-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
}

.cat-subcat-icon svg {
  width: 22px;
  height: 22px;
}

.cat-subcat-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 2px;
}

.cat-subcat-desc {
  font-size: 0.82rem;
  color: var(--text-3);
}

.cat-subcat-link {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--violet-light);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  transition: background var(--t-fast), border-color var(--t-fast);
}

.cat-subcat-link:hover {
  background: var(--violet-glow2);
  border-color: var(--violet);
}

/* ── Main tools grid ── */
.cat-main-grid {
  margin-top: 28px;
}

/* ── Empty state ── */
.cat-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 0.95rem;
}

.cat-empty strong {
  color: var(--text-1);
}

/* ── Dropdown subcategory pills in nav ── */
.drop-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 8px;
}

.drop-subcat {
  font-size: 0.78rem;
  padding: 3px 10px;
  background: var(--bg-3);
  border-radius: 99px;
  color: var(--violet-light);
  text-decoration: none;
  border: 1px solid var(--border-2);
  transition: 0.15s;
}

.drop-subcat:hover {
  background: var(--violet-glow);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .cat-hero-inner {
    flex-direction: column;
    gap: 16px;
  }

  .cat-hero-icon-wrap {
    width: 60px;
    height: 60px;
  }

  .cat-hero-icon-wrap svg {
    width: 28px;
    height: 28px;
  }

  .cat-tabs-header {
    flex-direction: column;
    align-items: stretch;
  }

  .cat-search-inline {
    max-width: 100%;
  }

  .cat-subcat-head {
    flex-wrap: wrap;
  }

  .cat-subcat-link {
    margin-left: 0;
  }
}

/* ── PRINT STYLES ── */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .nav,
  .footer,
  .tool-sidebar,
  .breadcrumb,
  .seo-content,
  .hero,
  #back-top,
  .toast,
  .drawer,
  .mobile-overlay {
    display: none !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .tool-layout {
    display: block !important;
  }

  .tool-main-col {
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
  }

  .tool-widget {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #000 !important;
    page-break-inside: avoid;
  }

  .tool-header-icon {
    display: none !important;
    /* Hide to save ink */
  }

  .btn,
  .copy-btn {
    display: none !important;
    /* Interactive elements are useless on paper */
  }
}