/* ==========================================================================
   CodeCrate - 2026 Premium International Developer SaaS Design System
   Aesthetic: Dark navy / deep blue developer platform, electric blue/cyan accents,
   subtle purple glows, code/grid micro-patterns, smooth transitions.
   Full Light & Dark Theme Support.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ==========================================================================
   COLOR TOKENS & SYSTEM VARIABLES
   ========================================================================== */
:root,
[data-theme="dark"] {
  /* Core Theme Colors - Dark Theme (Primary Developer Visual Direction) */
  --bg-canvas: #070b14;
  --bg-surface: #0c1322;
  --bg-surface-elevated: #111a2e;
  --bg-subtle: #142038;
  --bg-card: #0d1526;
  --bg-card-hover: #131e36;
  --bg-active: #1c2b4a;

  --border-subtle: #19263f;
  --border-default: #223455;
  --border-hover: #38bdf8;
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8da2c0;
  --text-dim: #556987;
  --text-inverse: #070b14;

  /* Accents */
  --brand-primary: #38bdf8;
  --brand-primary-hover: #7dd3fc;
  --brand-cyan: #22d3ee;
  --brand-purple: #a78bfa;
  --brand-electric: #38bdf8;
  --brand-gradient: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
  --brand-gradient-text: linear-gradient(135deg, #ffffff 40%, #38bdf8 100%);
  
  --primary-glow: rgba(56, 189, 248, 0.18);
  --cyan-glow: rgba(34, 211, 238, 0.16);
  --grid-color: rgba(56, 189, 248, 0.04);
  --hero-glow: radial-gradient(ellipse 70% 55% at 50% 10%, rgba(56, 189, 248, 0.15) 0%, rgba(139, 92, 246, 0.08) 45%, transparent 100%);

  /* Category Identity Accents for Dark */
  --cat-json: #38bdf8;
  --cat-json-bg: rgba(56, 189, 248, 0.12);
  --cat-encode: #a78bfa;
  --cat-encode-bg: rgba(167, 139, 250, 0.12);
  --cat-security: #34d399;
  --cat-security-bg: rgba(52, 211, 153, 0.12);
  --cat-utils: #fbbf24;
  --cat-utils-bg: rgba(251, 191, 36, 0.12);
  --cat-code: #fb7185;
  --cat-code-bg: rgba(251, 113, 133, 0.12);
  --cat-text: #818cf8;
  --cat-text-bg: rgba(129, 140, 248, 0.12);

  /* Shadows for Dark Mode */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 6px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 32px -4px rgba(0, 0, 0, 0.6), 0 6px 12px -3px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px -4px rgba(56, 189, 248, 0.35);

  /* Header & Navigation Dark */
  --header-bg: rgba(7, 11, 20, 0.88);
  --header-border: rgba(30, 44, 71, 0.85);
  --header-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 220ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-width: 1440px;
  --header-height: 70px;
}


/* ==========================================================================
   BASE RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-canvas);
}

body.menu-open {
  overflow: hidden;
}

/* Developer Grid Pattern Background */
.bg-grid-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

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

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

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

code, kbd, pre {
  font-family: var(--font-mono);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
}

/* ==========================================================================
   GLOBAL HEADER (Sticky, Translucent, Backdrop-Blurred)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--header-border);
  transition: all var(--transition-smooth);
}

.site-header.scrolled {
  box-shadow: var(--header-shadow);
  border-bottom-color: var(--border-default);
}

.header-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand Logo */
.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  transition: transform var(--transition-fast);
}

.header-brand:hover {
  transform: translateY(-1px);
}

.brand-logo-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.brand-icon {
  width: 100%;
  height: 100%;
}

.brand-accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation Links */
.nav-desktop {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.nav-link.active {
  color: var(--brand-primary);
  background-color: var(--primary-glow);
  font-weight: 600;
}

/* Categories Dropdown */
.nav-item-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
}

.dropdown-chevron {
  transition: transform var(--transition-fast);
}

.dropdown-toggle[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: -20px;
  width: 340px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  pointer-events: none;
  z-index: 105;
}

.dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-inner {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-subtle);
  transform: translateX(2px);
}

.dropdown-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--brand-primary);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.dropdown-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.dropdown-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Header Actions (Search & Theme Toggle) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.header-search-btn:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-active);
  color: var(--text-primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.header-kbd {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  box-shadow: var(--shadow-xs);
}


/* Mobile Hamburger Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  gap: 5px;
  transition: background-color var(--transition-fast);
}

.mobile-menu-btn:hover {
  background-color: var(--bg-active);
}

.hamburger-bar {
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-btn.is-active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.is-active .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.is-active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99;
  overflow-y: auto;
}

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

.mobile-nav-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-search-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-muted);
}


.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-link {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

.mobile-link:hover, .mobile-link.active {
  background-color: var(--primary-glow);
  color: var(--brand-primary);
}

.mobile-nav-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.25rem;
}

.mobile-sublink {
  display: block;
  padding: 0.45rem 0.75rem 0.45rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.mobile-sublink:hover {
  color: var(--brand-primary);
  background-color: var(--bg-subtle);
}

.mobile-nav-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 0.5rem 0;
}

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background-color: rgba(7, 11, 20, 0.6);
  backdrop-filter: blur(4px);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mobile-nav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   HOMEPAGE HERO SECTION (Modern Developer Atmosphere)
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 5rem 0 4rem;
  background: var(--hero-glow);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  overflow: hidden;
}

/* Floating Syntax Elements (Subtle Decorative CSS Badges) */
.hero-floating-syntax {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  opacity: 0.65;
  pointer-events: none;
  user-select: none;
  animation: floatSyntax 6s ease-in-out infinite alternate;
  z-index: 1;
}

.syntax-1 { top: 18%; left: 8%; animation-delay: 0s; }
.syntax-2 { top: 28%; right: 9%; animation-delay: 1.5s; color: var(--brand-cyan); }
.syntax-3 { bottom: 22%; left: 12%; animation-delay: 2.5s; color: var(--brand-purple); }
.syntax-4 { bottom: 26%; right: 11%; animation-delay: 3.5s; }
.syntax-5 { top: 60%; left: 5%; animation-delay: 4.5s; color: var(--brand-cyan); }
.syntax-6 { top: 58%; right: 6%; animation-delay: 5s; color: var(--brand-purple); }

@keyframes floatSyntax {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(2deg); }
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Badge above H1 */
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.hero-badge-pill:hover {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-cyan);
  box-shadow: 0 0 8px var(--brand-cyan);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.hero-title-gradient {
  background: var(--brand-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

/* Command Palette Styled Search Bar */
.hero-search-wrapper {
  max-width: 680px;
  margin: 0 auto 1.25rem;
  position: relative;
}

.search-box-outer {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.85rem 0.65rem 1.25rem;
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-subtle);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.search-box-outer:focus-within {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-glow), var(--shadow-lg), 0 0 0 2px var(--brand-primary);
  transform: translateY(-1px);
}

.search-icon-left {
  color: var(--brand-primary);
  flex-shrink: 0;
  margin-right: 0.85rem;
  display: flex;
  align-items: center;
}

.tool-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
}

.tool-search-input::placeholder {
  color: var(--text-dim);
}

.search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  margin-right: 0.6rem;
  transition: all var(--transition-fast);
}

.search-clear-btn:hover {
  background-color: var(--bg-active);
  color: var(--text-primary);
}

.search-clear-btn.is-active {
  display: inline-flex;
}

.search-shortcut-badge {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  user-select: none;
  box-shadow: var(--shadow-xs);
}

/* Quick Search Chips */
.quick-search-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.chips-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.quick-chip {
  padding: 0.28rem 0.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.quick-chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background-color: var(--primary-glow);
  transform: translateY(-1px);
}

/* Hero CTAs */
.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow), 0 4px 16px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   PRODUCT STATS STRIP
   ========================================================================== */
.stats-strip-section {
  padding: 1.5rem 0;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.stat-value-accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   DEVELOPER WORKSPACE VISUAL (Non-Interactive Preview Section)
   ========================================================================== */
.workspace-visual-section {
  padding: 4.5rem 0 3.5rem;
  position: relative;
  background-color: var(--bg-canvas);
}

.workspace-preview-shell {
  max-width: 980px;
  margin: 0 auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 30px var(--primary-glow);
  overflow: hidden;
}

.workspace-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.workspace-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #f59e0b; }
.dot-green { background-color: #10b981; }

.workspace-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
}

.workspace-panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  background-color: var(--bg-card);
}

.workspace-panel {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  font-family: var(--font-mono);
}

.code-snippet {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-subtle);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: pre;
}

.code-hl-key { color: var(--brand-primary); }
.code-hl-str { color: #10b981; }
.code-hl-num { color: #f59e0b; }
.code-hl-bool { color: #8b5cf6; }

/* Middle Flow Indicator */
.workspace-flow-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  gap: 0.5rem;
}

.flow-step-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-primary);
  background-color: var(--primary-glow);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.flow-arrow-icon {
  color: var(--brand-primary);
}

/* ==========================================================================
   POPULAR DEVELOPER TOOLS SECTION
   ========================================================================== */
.section {
  padding: 4.5rem 0;
  position: relative;
}

.section-muted {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.section-header-centered {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.22;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Popular Card Upgrade */
.popular-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.popular-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.popular-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.popular-card:hover::before {
  opacity: 1;
}

.popular-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.tool-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  font-family: var(--font-mono);
  font-weight: 700;
  transition: transform var(--transition-fast);
}

.popular-card:hover .tool-icon-badge {
  transform: scale(1.05);
}

.badge-json { background-color: var(--cat-json-bg); color: var(--cat-json); border: 1px solid rgba(56, 189, 248, 0.2); }
.badge-encode { background-color: var(--cat-encode-bg); color: var(--cat-encode); border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-security { background-color: var(--cat-security-bg); color: var(--cat-security); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-utils { background-color: var(--cat-utils-bg); color: var(--cat-utils); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-code { background-color: var(--cat-code-bg); color: var(--cat-code); border: 1px solid rgba(244, 63, 94, 0.2); }
.badge-text { background-color: var(--cat-text-bg); color: var(--cat-text); border: 1px solid rgba(99, 102, 241, 0.2); }

.category-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.popular-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.popular-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.tool-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-top: auto;
  transition: gap var(--transition-fast);
}

.tool-action-link svg {
  transition: transform var(--transition-fast);
}

.popular-card:hover .tool-action-link svg,
.tool-card:hover .tool-action-link svg {
  transform: translateX(4px);
}

/* ==========================================================================
   CATEGORY SECTION (6 Identity Cards)
   ========================================================================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: var(--border-hover);
}

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.cat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.category-card:hover .cat-icon-wrap {
  transform: scale(1.06);
}

.cat-count-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.cat-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cat-card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.cat-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
}

.cat-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--transition-fast);
}

.cat-link:hover {
  gap: 0.6rem;
}

/* ==========================================================================
   50 TOOL DIRECTORY & CLIENT-SIDE SEARCH
   ========================================================================== */
.directory-section {
  padding: 5rem 0;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
}

.directory-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.category-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background-color: var(--bg-subtle);
}

.filter-pill.active {
  background: var(--brand-gradient);
  color: #ffffff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.directory-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}

.tools-count-text strong {
  color: var(--text-primary);
}

/* 50 Tool Grid */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Tool Card Upgrade (Public Website View - No "Foundation" badge) */
.tool-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  position: relative;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 16px var(--primary-glow);
  border-color: var(--border-hover);
}

.tool-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.tool-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.tool-card-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.tool-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.tool-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.tool-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

/* Empty State */
.no-tools-found {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
}

.no-tools-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.no-tools-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.no-tools-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   WHY CODECRATE (4 Premium Feature Blocks)
   ========================================================================== */
.why-section {
  padding: 5rem 0;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.why-card {
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  transition: all var(--transition-smooth);
  position: relative;
}

.why-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.why-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--primary-glow);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
}

.why-card-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.why-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   PRE-FOOTER CTA SECTION (Premium Dark Gradient Panel)
   ========================================================================== */
.cta-panel-section {
  padding: 4.5rem 0 5.5rem;
  background-color: var(--bg-canvas);
}

.cta-panel {
  position: relative;
  background: linear-gradient(135deg, #0c1424 0%, #111e38 50%, #0d1526 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(56, 189, 248, 0.12);
  overflow: hidden;
}

.cta-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 20%;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
}

.cta-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.cta-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.cta-desc {
  font-size: 1.05rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* ==========================================================================
   GLOBAL FOOTER (Dark Premium Theme by Design)
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background-color: #070b14;
  color: #94a3b8;
  border-top: 1px solid #1a2538;
  padding: 4.5rem 0 2rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1.1fr 1.1fr 1fr 1fr;
  gap: 2.25rem;
  margin-bottom: 3.5rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

.footer-description {
  font-size: 0.875rem;
  line-height: 1.65;
  color: #8da2c0;
  max-width: 360px;
  margin-bottom: 1.5rem;
}

.footer-badge-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.trust-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background-color: #111a2e;
  color: #cbd5e1;
  border: 1px solid #223455;
}

.footer-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f1f5f9;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: #8da2c0;
  transition: color var(--transition-fast), transform var(--transition-fast);
  display: inline-block;
}

.footer-links a:hover {
  color: #38bdf8;
  transform: translateX(2px);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid #141f33;
  font-size: 0.8125rem;
  color: #556987;
}

.footer-bottom-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-disclaimer-note {
  font-size: 0.75rem;
  color: #556987;
  max-width: 520px;
}

/* ==========================================================================
   PAGE LAYOUT / LEGAL / SHELL STYLES
   ========================================================================== */
.page-header {
  padding: 4rem 0 2.5rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.page-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 740px;
  line-height: 1.6;
}

.page-content-wrap {
  padding: 3.5rem 0 5.5rem;
  background-color: var(--bg-canvas);
}

.prose {
  max-width: 840px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--shadow-xs);
  line-height: 1.7;
  color: var(--text-secondary);
}

.prose h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.prose a:hover {
  color: var(--brand-primary-hover);
}

.legal-placeholder-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.contact-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.contact-item-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
}

.contact-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* About Page Feature Cards & Values */
.about-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.about-feature-card {
  padding: 1.35rem 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.about-feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.about-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  color: var(--brand-primary);
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border-subtle);
}

.about-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.about-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.about-values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.about-value-item {
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--brand-primary);
}

.about-value-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-value-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Modal Dialog for Planned Tool Preview */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(7, 11, 20, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.is-open {
  display: flex;
}

.tool-modal-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border: 1px solid var(--border-default);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  font-size: 1.5rem;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background-color: var(--primary-glow);
  color: var(--brand-primary);
  border: 1px solid var(--border-default);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.modal-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.modal-meta-list {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-subtle);
}

.modal-meta-list div {
  margin-bottom: 0.35rem;
}

.modal-meta-list div:last-child {
  margin-bottom: 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Global Search Modal & Command Palette
   ========================================================================== */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 11, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1rem 2rem;
  overflow-y: auto;
}

.search-modal-overlay.is-open {
  display: flex;
}

.search-modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow-lg), 0 0 35px rgba(56, 189, 248, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: searchModalSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchModalSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-elevated);
}

.search-modal-icon {
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.search-modal-input::placeholder {
  color: var(--text-dim);
}

.search-modal-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-modal-clear:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

.search-modal-clear.is-active {
  display: inline-flex;
}

.search-modal-esc {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

.search-modal-esc:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
}

.search-modal-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-modal-results::-webkit-scrollbar,
.hero-search-results::-webkit-scrollbar {
  width: 6px;
}
.search-modal-results::-webkit-scrollbar-track,
.hero-search-results::-webkit-scrollbar-track {
  background: transparent;
}
.search-modal-results::-webkit-scrollbar-thumb,
.hero-search-results::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  gap: 0.75rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  border: 1px solid transparent;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.is-selected {
  background-color: var(--bg-subtle);
  border-color: var(--border-subtle);
}

.search-result-item.is-selected {
  border-left: 3px solid var(--brand-primary);
}

.search-result-main {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-title mark {
  background: transparent;
  color: var(--brand-primary);
  font-weight: 700;
}

.search-result-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.search-result-category {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: var(--bg-active);
  color: var(--text-muted);
}

.search-result-category.cat-json-data {
  background-color: var(--cat-json-bg);
  color: var(--cat-json);
}
.search-result-category.cat-encoding-decoding {
  background-color: var(--cat-encode-bg);
  color: var(--cat-encode);
}
.search-result-category.cat-security-generators {
  background-color: var(--cat-security-bg);
  color: var(--cat-security);
}
.search-result-category.cat-developer-utilities {
  background-color: var(--cat-utils-bg);
  color: var(--cat-utils);
}
.search-result-category.cat-code-tools {
  background-color: var(--cat-code-bg);
  color: var(--cat-code);
}
.search-result-category.cat-text-conversion {
  background-color: var(--cat-text-bg);
  color: var(--cat-text);
}

.search-result-arrow {
  color: var(--text-dim);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.search-result-item:hover .search-result-arrow,
.search-result-item.is-selected .search-result-arrow {
  color: var(--brand-primary);
  transform: translateX(2px);
}

.search-no-results {
  padding: 2.25rem 1.5rem;
  text-align: center;
}

.search-no-results-icon {
  margin: 0 auto 0.65rem;
  color: var(--text-dim);
  display: flex;
  justify-content: center;
}

.search-no-results-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.search-no-results-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.15rem;
  background-color: var(--bg-canvas);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.search-modal-footer kbd {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 0.2rem;
}

/* ==========================================================================
   Hero Search Results Dropdown (Homepage & Directory)
   ========================================================================== */
.hero-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(56, 189, 248, 0.18);
  z-index: 150;
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
  display: none;
  animation: searchModalSlideDown 0.15s ease-out;
}

.hero-search-results.is-open {
  display: block;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
