/* ===================================================================
   XILXIL TOOLS HUB - DESIGN SYSTEM
   Theme: Futuristic / Cyberpunk / AI Dashboard / Glassmorphism
   =================================================================== */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Core palette - Cyberpunk neon on deep space */
  --bg-deep: #050514;
  --bg-base: #0a0a1f;
  --bg-elevated: #11112a;
  --bg-glass: rgba(20, 20, 50, 0.45);
  --bg-glass-hover: rgba(30, 30, 70, 0.65);
  --bg-neumorph: #0d0d22;
  --bg-neumorph-raised: #14142e;

  /* Neon accent system */
  --neon-cyan: #00f0ff;
  --neon-magenta: #ff00e5;
  --neon-green: #00ff9d;
  --neon-amber: #ffb800;
  --neon-purple: #a855f7;
  --neon-blue: #3b82f6;
  --neon-red: #ef4444;

  /* Semantic colors */
  --text-primary: #e8e8ff;
  --text-secondary: #a0a0c8;
  --text-muted: #6c6c8c;
  --text-inverse: #0a0a1f;
  --success: #00ff9d;
  --warning: #ffb800;
  --danger: #ff4477;
  --info: #00f0ff;

  /* Brand gradient */
  --gradient-primary: linear-gradient(135deg, #00f0ff 0%, #ff00e5 100%);
  --gradient-secondary: linear-gradient(135deg, #a855f7 0%, #00f0ff 100%);
  --gradient-accent: linear-gradient(135deg, #00ff9d 0%, #00f0ff 100%);
  --gradient-warm: linear-gradient(135deg, #ffb800 0%, #ff00e5 100%);
  --gradient-rainbow: linear-gradient(90deg, #00f0ff, #a855f7, #ff00e5, #ffb800, #00ff9d);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.15), transparent 70%);

  /* Glassmorphism */
  --glass-blur: 20px;
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  --glass-shadow-hover: 0 12px 48px rgba(0, 240, 255, 0.15);

  /* Neomorphism */
  --neumorph-shadow-dark: rgba(0, 0, 0, 0.6);
  --neumorph-shadow-light: rgba(100, 100, 200, 0.05);

  /* Glow effects */
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.2);
  --glow-magenta: 0 0 20px rgba(255, 0, 229, 0.5), 0 0 40px rgba(255, 0, 229, 0.2);
  --glow-green: 0 0 20px rgba(0, 255, 157, 0.5), 0 0 40px rgba(0, 255, 157, 0.2);

  /* Typography */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Layout */
  --container-max: 1280px;
  --header-h: 70px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.15s;
  --dur-base: 0.25s;
  --dur-slow: 0.4s;

  /* Z-index scale */
  --z-bg: -1;
  --z-base: 1;
  --z-elevated: 10;
  --z-header: 100;
  --z-modal: 1000;
  --z-toast: 2000;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Animated cosmic background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(168, 85, 247, 0.15), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(0, 240, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(255, 0, 229, 0.10), transparent 60%),
    var(--bg-deep);
  z-index: var(--z-bg);
  pointer-events: none;
}

/* Grid overlay - subtle cyberpunk grid */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.025) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: var(--z-bg);
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

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

a {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--neon-magenta); }

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

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

ul, ol { list-style: none; }

::selection {
  background: var(--neon-cyan);
  color: var(--text-inverse);
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

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

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

.mono { font-family: var(--font-mono); }

/* ---------- LAYOUT ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  width: 100%;
}

.section {
  padding: var(--space-3xl) 0;
  position: relative;
}

.section-tight { padding: var(--space-2xl) 0; }

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(10, 10, 31, 0.7);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
  transition: all var(--dur-base) var(--ease-out);
}

.site-header.scrolled {
  background: rgba(10, 10, 31, 0.92);
  box-shadow: 0 4px 30px rgba(0, 240, 255, 0.05);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-inverse);
  position: relative;
  box-shadow: var(--glow-cyan);
  animation: pulse-glow 3s var(--ease-in-out) infinite;
}

.logo-mark::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gradient-primary);
  z-index: -1;
  filter: blur(8px);
  opacity: 0.6;
}

.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text small {
  font-size: 0.625rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-main {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 240, 255, 0.08);
}

.nav-link.active {
  color: var(--neon-cyan);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  border-radius: 1px;
}

.header-search {
  position: relative;
  width: 260px;
}

.header-search input {
  width: 100%;
  background: var(--bg-glass);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  backdrop-filter: blur(8px);
  transition: all var(--dur-base) var(--ease-out);
}

.header-search input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.header-search svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: var(--glass-border);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .nav-main, .header-search { display: none; }
  .menu-toggle { display: flex; }
}

/* Mobile nav */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(5, 5, 20, 0.97);
  backdrop-filter: blur(20px);
  z-index: var(--z-header);
  padding: var(--space-2xl);
  transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  overflow-y: auto;
}

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

.mobile-nav .nav-link {
  font-size: 1.25rem;
  padding: var(--space-md);
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
  border-radius: 0;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  border: none;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 240, 255, 0.5);
  color: var(--text-inverse);
}

.btn-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: var(--glass-border);
  color: var(--text-primary);
}
.btn-glass:hover {
  background: var(--bg-glass-hover);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.05);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.0625rem; }
.btn-block { width: 100%; }

/* ---------- GLASS CARD ---------- */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--dur-base) var(--ease-out);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.5), transparent);
}

.glass-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

/* ---------- NEUMORPH CARD ---------- */
.neumorph-card {
  background: var(--bg-neumorph);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow:
    8px 8px 16px var(--neumorph-shadow-dark),
    -2px -2px 8px var(--neumorph-shadow-light);
  transition: all var(--dur-base) var(--ease-out);
}

.neumorph-card:hover {
  box-shadow:
    10px 10px 20px var(--neumorph-shadow-dark),
    -2px -2px 10px var(--neumorph-shadow-light);
}

/* ---------- TOOL CARD ---------- */
.tool-card {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.4);
  background: var(--bg-glass-hover);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.15);
  color: inherit;
}

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

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.1);
  display: grid;
  place-items: center;
  margin-bottom: var(--space-md);
  color: var(--neon-cyan);
  transition: all var(--dur-base) var(--ease-out);
}

.tool-card:hover .tool-card-icon {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: var(--glow-cyan);
}

.tool-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.tool-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tool-card-cat {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 240, 255, 0.08);
  color: var(--neon-cyan);
  font-weight: 500;
  text-transform: capitalize;
}

/* ---------- CATEGORY CARD ---------- */
.cat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: block;
  color: inherit;
  text-decoration: none;
}

.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity var(--dur-base);
  pointer-events: none;
}

.cat-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent-color, var(--neon-cyan));
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.2);
  color: inherit;
}
.cat-card:hover::after { opacity: 1; }

.cat-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--accent-color, var(--neon-cyan));
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.75rem;
}

.cat-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.cat-card-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---------- BADGE / CHIP ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-primary { background: rgba(0, 240, 255, 0.12); color: var(--neon-cyan); }
.badge-success { background: rgba(0, 255, 157, 0.12); color: var(--neon-green); }
.badge-warning { background: rgba(255, 184, 0, 0.12); color: var(--neon-amber); }
.badge-danger { background: rgba(255, 68, 119, 0.12); color: var(--danger); }
.badge-purple { background: rgba(168, 85, 247, 0.12); color: var(--neon-purple); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.chip:hover, .chip.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* ---------- INPUTS ---------- */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-glass);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--dur-base) var(--ease-out);
  backdrop-filter: blur(8px);
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
  background: var(--bg-glass-hover);
}

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

.textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  line-height: 1.5;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
}

.field {
  margin-bottom: var(--space-md);
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
  overflow: hidden;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: var(--glass-border);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.hero-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: var(--glow-green);
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-lg);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.6;
}

.hero-search {
  max-width: 640px;
  margin: 0 auto var(--space-2xl);
  position: relative;
}

.hero-search input {
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-full);
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  font-size: 1.0625rem;
  color: var(--text-primary);
  transition: all var(--dur-base) var(--ease-out);
}

.hero-search input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 4px rgba(0, 240, 255, 0.15), 0 12px 40px rgba(0, 240, 255, 0.2);
}

.hero-search svg {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.hero-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(15, 15, 40, 0.95);
  backdrop-filter: blur(20px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  max-height: 400px;
  overflow-y: auto;
  z-index: var(--z-elevated);
  display: none;
}

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

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid rgba(0, 240, 255, 0.06);
  color: var(--text-secondary);
  transition: all var(--dur-fast);
  text-decoration: none;
}

.search-result-item:hover {
  background: rgba(0, 240, 255, 0.08);
  color: var(--text-primary);
}

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

/* ---------- STATS ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  padding: var(--space-2xl) 0;
}

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

.stat {
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

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

/* ---------- TOOL LAYOUT ---------- */
.tool-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-xl);
  padding: var(--space-2xl) 0;
  align-items: start;
}

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

.tool-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--space-lg));
}

.tool-main {
  min-width: 0;
}

.tool-header {
  margin-bottom: var(--space-xl);
}

.tool-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: var(--space-sm);
}

.tool-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.tool-header-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 720px;
}

/* ---------- TOOL WORKSPACE ---------- */
.workspace {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.workspace::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0.5;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

@media (max-width: 700px) {
  .workspace-grid { grid-template-columns: 1fr; }
}

/* ---------- RESULT BOX ---------- */
.result-box {
  background: var(--bg-deep);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  min-height: 120px;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--neon-green);
}

.result-box.empty {
  color: var(--text-muted);
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-body);
}

/* ---------- ALERT / TOAST ---------- */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.alert-info { background: rgba(0, 240, 255, 0.1); border: 1px solid rgba(0, 240, 255, 0.3); color: var(--neon-cyan); }
.alert-success { background: rgba(0, 255, 157, 0.1); border: 1px solid rgba(0, 255, 157, 0.3); color: var(--neon-green); }
.alert-warning { background: rgba(255, 184, 0, 0.1); border: 1px solid rgba(255, 184, 0, 0.3); color: var(--neon-amber); }
.alert-error { background: rgba(255, 68, 119, 0.1); border: 1px solid rgba(255, 68, 119, 0.3); color: var(--danger); }

.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: rgba(15, 15, 40, 0.95);
  backdrop-filter: blur(20px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: slideIn var(--dur-base) var(--ease-spring);
  pointer-events: auto;
  min-width: 240px;
  border-left: 3px solid var(--neon-cyan);
}

.toast.success { border-left-color: var(--neon-green); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--neon-amber); }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--bg-glass);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
  transition: all var(--dur-base) var(--ease-out);
}

.faq-item[open] {
  border-color: rgba(0, 240, 255, 0.3);
}

.faq-item summary {
  padding: var(--space-lg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--neon-cyan);
  transition: transform var(--dur-base);
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item-body {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ---------- BREADCRUMB ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--neon-cyan); }
.breadcrumb-sep { opacity: 0.5; }

/* ---------- FOOTER ---------- */
.site-footer {
  margin-top: var(--space-4xl);
  padding: var(--space-3xl) 0 var(--space-2xl);
  border-top: 1px solid rgba(0, 240, 255, 0.1);
  background: rgba(5, 5, 20, 0.5);
  backdrop-filter: blur(10px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

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

.footer-col h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-col a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.footer-col a:hover { color: var(--neon-cyan); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(0, 240, 255, 0.08);
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: var(--glass-border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
}

.footer-social a:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  transform: translateY(-2px);
}

/* ---------- UTILITIES ---------- */
.hidden { display: none !important; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }

/* ---------- LOADING / SKELETON ---------- */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 20, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 10;
  border-radius: inherit;
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 5px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.4);
}

/* ---------- ACCESSIBILITY ---------- */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--neon-cyan);
  color: var(--text-inverse);
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-toast);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
