/* ================================================
   EASIFYME — DESIGN SYSTEM
   Premium Modern Utility Tools Website
   ================================================ */

/* ---- 1. GOOGLE FONTS IMPORT ---- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

/* ---- 2. CSS CUSTOM PROPERTIES (LIGHT MODE) ---- */
:root {
  /* Background Colors */
  --color-bg: #F8FAFC;
  --color-bg-secondary: #EDF1F7;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F3F7FB;
  --color-surface-raised: #FFFFFF;

  /* Text Colors */
  --color-text: #0F172A;
  --color-text-secondary: #334155;
  --color-text-muted: #64748B;
  --color-text-subtle: #94A3B8;
  --color-text-inverse: #FFFFFF;

  /* Border Colors */
  --color-border: #E2E8F0;
  --color-border-light: #E8EDF4;
  --color-border-focus: #3B82F6;

  /* Brand Colors */
  --color-primary: #0F172A;
  --color-accent: #3B82F6;
  --color-accent-dark: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-accent-light: #DBEAFE;
  --color-accent-purple: #8B5CF6;
  --color-accent-purple-light: #EDE9FE;

  /* Status Colors */
  --color-success: #10B981;
  --color-success-light: #D1FAE5;
  --color-warning: #F59E0B;
  --color-warning-light: #FEF3C7;
  --color-error: #EF4444;
  --color-error-light: #FEE2E2;
  --color-info: #06B6D4;
  --color-info-light: #CFFAFE;

  /* Gradients */
  --gradient-accent: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
  --gradient-accent-hover: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --gradient-hero: linear-gradient(135deg, #EFF6FF 0%, #F5F3FF 50%, #ECFDF5 100%);
  --gradient-header-line: linear-gradient(90deg, #3B82F6 0%, #8B5CF6 50%, #EC4899 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(59,130,246,0.04) 0%, rgba(139,92,246,0.04) 100%);

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Type Scale */
  --text-xs: 0.75rem;       /* 12px */
  --text-sm: 0.875rem;      /* 14px */
  --text-base: 1rem;        /* 16px */
  --text-lg: 1.125rem;      /* 18px */
  --text-xl: 1.25rem;       /* 20px */
  --text-2xl: 1.5rem;       /* 24px */
  --text-3xl: 1.875rem;     /* 30px */
  --text-4xl: 2.25rem;      /* 36px */
  --text-5xl: 3rem;         /* 48px */
  --text-6xl: 3.75rem;      /* 60px */

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  --shadow-accent: 0 4px 14px rgba(59, 130, 246, 0.25);
  --shadow-accent-hover: 0 8px 25px rgba(59, 130, 246, 0.35);
  --shadow-card-hover: 0 12px 28px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.06);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Layout */
  --header-height: 72px;
  --sidebar-width: 300px;
  --container-max: 1280px;
  --container-padding: clamp(1rem, 4vw, 1.5rem);
}

/* ---- 3. DARK MODE VARIABLES ---- */
[data-theme="dark"] {
  --color-bg: #0F172A;
  --color-bg-secondary: #0D1526;
  --color-surface: #1E293B;
  --color-surface-alt: #162032;
  --color-surface-raised: #243447;

  --color-text: #F1F5F9;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #94A3B8;
  --color-text-subtle: #64748B;

  --color-border: #334155;
  --color-border-light: #243447;

  --color-accent-light: rgba(59, 130, 246, 0.15);
  --color-accent-purple-light: rgba(139, 92, 246, 0.15);
  --color-success-light: rgba(16, 185, 129, 0.15);
  --color-warning-light: rgba(245, 158, 11, 0.15);
  --color-error-light: rgba(239, 68, 68, 0.15);

  --gradient-hero: linear-gradient(135deg, #0F172A 0%, #162032 50%, #0F1F1A 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(139,92,246,0.08) 100%);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ---- 4. BASE RESET & GLOBAL ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-subtle); }

::selection { background-color: var(--color-accent-light); color: var(--color-accent-dark); }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- 5. TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); font-weight: 800; }
h2 { font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl)); font-weight: 700; }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl)); font-weight: 700; }
h4 { font-size: var(--text-xl); font-weight: 600; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; }

p { margin-bottom: var(--space-4); color: var(--color-text-secondary); }
p:last-child { margin-bottom: 0; }

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-accent-dark); }

img { max-width: 100%; height: auto; display: block; }

strong { font-weight: 600; color: var(--color-text); }
small { font-size: var(--text-sm); }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-secondary);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-accent-purple);
}

pre {
  font-family: var(--font-mono);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  font-size: var(--text-sm);
}

/* ---- 6. FOCUS STYLES (ACCESSIBILITY) ---- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- 7. LAYOUT UTILITIES ---- */
.container-main {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section { padding: var(--space-16) 0; }
.section-sm { padding: var(--space-10) 0; }
.section-lg { padding: var(--space-24) 0; }

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .glass-effect {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ---- 8. BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn-sm { padding: 0.5rem 1rem; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-lg { padding: 0.875rem 1.75rem; font-size: var(--text-base); border-radius: var(--radius-lg); }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  box-shadow: var(--shadow-accent-hover);
  transform: translateY(-1px);
  color: #fff;
}

.btn-gradient {
  background: var(--gradient-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}
.btn-gradient:hover {
  background: var(--gradient-accent-hover);
  box-shadow: var(--shadow-accent-hover);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.btn-icon:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

/* ---- 9. BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2em 0.65em;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-full);
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.badge-category {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}
.badge-new {
  background: var(--color-success-light);
  color: var(--color-success);
}
.badge-popular {
  background: var(--color-warning-light);
  color: #92400E;
}
.badge-count {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
}
.badge-dark {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
}

/* ---- 10. CARDS ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: transparent;
}

.card-body { padding: var(--space-6); }
.card-body-sm { padding: var(--space-4); }
.card-body-lg { padding: var(--space-8); }

/* ---- 11. FORM INPUTS ---- */
.form-control {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}
.form-control::placeholder { color: var(--color-text-subtle); }

textarea.form-control { resize: vertical; min-height: 120px; }

/* ---- 12. STICKY HEADER ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.header-accent-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-header-line);
  z-index: 1;
}

.header-inner {
  display: flex;
  align-items: center;
  height: calc(var(--header-height) - 3px);
  margin-top: 3px;
  gap: var(--space-6);
}

/* Header scrolled state — strengthens the existing base */
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .site-header.scrolled {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: var(--color-border);
}

/* ---- 13. LOGO ---- */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--gradient-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-heading);
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo-text span { color: var(--color-accent); }

/* ---- 14. MAIN NAVIGATION ---- */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  justify-content: center;
  overflow: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.5rem 0.875rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.nav-link i { font-size: 12px; transition: transform var(--transition-fast); }
.nav-link:hover i { transform: rotate(180deg); }

/* ---- 15. MEGA MENU ---- */
.mega-menu-wrapper {
  /* No position: relative — let the fixed header be the containing block
     so the menu can center itself against the full viewport width. */
  position: static;
}

.mega-menu {
  position: fixed;
  top: var(--header-height);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(900px, 92vw);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-base),
              visibility var(--transition-base),
              transform var(--transition-base);
  z-index: 1100;
}

.mega-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.mega-menu-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.mega-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.mega-menu-item:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

.mega-menu-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mega-menu-item-info { flex: 1; min-width: 0; }

.mega-menu-item-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  display: block;
}

.mega-menu-item-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 1px;
  display: block;
}

/* ---- 16. HEADER SEARCH BAR ---- */
.header-search {
  position: relative;
  flex: 0 1 260px;
}

.header-search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: var(--color-bg-secondary);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  transition: all var(--transition-fast);
  outline: none;
}

.header-search-input:focus {
  background: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
  flex: 0 1 320px;
}

.header-search-input::placeholder { color: var(--color-text-subtle); }

.header-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* ---- 17. DARK MODE TOGGLE ---- */
.dark-mode-toggle {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  /* Button-level transitions: bg/border on hover, scale on press */
  transition: background var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast),
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dark-mode-toggle:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border-color: var(--color-text-subtle);
}

.dark-mode-toggle:active {
  transform: scale(0.85);
}

/* Both icons sit at the button center — only transform/opacity changes */
.dark-mode-toggle .icon-moon,
.dark-mode-toggle .icon-sun {
  position: absolute;
  top: 50%; left: 50%;
  font-size: 15px;
  transition: opacity 0.2s ease,
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, opacity;
  pointer-events: none;
}

/* ── LIGHT mode: moon visible, sun hidden (behind, rotated) ── */
.dark-mode-toggle .icon-moon {
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 1;
}
.dark-mode-toggle .icon-sun {
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.2);
  opacity: 0;
}

/* ── DARK mode: sun visible, moon hidden (above, rotated) ── */
[data-theme="dark"] .dark-mode-toggle .icon-moon {
  transform: translate(-50%, -50%) rotate(90deg) scale(0.2);
  opacity: 0;
}
[data-theme="dark"] .dark-mode-toggle .icon-sun {
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 1;
}

/* ---- 18. HAMBURGER / MOBILE NAV ---- */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.hamburger:hover { background: var(--color-bg-secondary); }

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--color-bg);
  flex-direction: column;
  padding: var(--space-6);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}

.mobile-menu-overlay.open {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.mobile-menu-close {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text);
  font-size: 18px;
  transition: all var(--transition-fast);
}

.mobile-menu-close:hover { background: var(--color-bg-secondary); }

.mobile-nav-section {
  margin-bottom: var(--space-6);
}

.mobile-nav-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-3);
  padding: 0 var(--space-3);
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.75rem var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.mobile-nav-item:hover {
  background: var(--color-bg-secondary);
  color: var(--color-accent);
}

.mobile-nav-item .nav-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

/* ---- 19. FOOTER ---- */
.site-footer {
  background: var(--color-primary);
  color: #94A3B8;
  padding: var(--space-16) 0 0;
  margin-top: var(--space-24);
}

[data-theme="dark"] .site-footer {
  background: #060D1A;
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand-desc {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: #64748B;
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: var(--space-2);
}

.footer-social-link {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  font-size: 15px;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.footer-social-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #E2E8F0;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: var(--space-2); }

.footer-links a {
  font-size: var(--text-sm);
  color: #64748B;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: #CBD5E1; }

.footer-newsletter-input-wrap {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.footer-newsletter-input {
  flex: 1;
  padding: 0.6rem 0.875rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: #E2E8F0;
  outline: none;
  transition: all var(--transition-fast);
}

.footer-newsletter-input:focus {
  border-color: var(--color-accent);
  background: rgba(59,130,246,0.08);
}

.footer-newsletter-input::placeholder { color: #475569; }

.footer-bottom {
  padding: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-bottom-text {
  font-size: var(--text-xs);
  color: #475569;
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-4);
}

.footer-bottom-links a {
  font-size: var(--text-xs);
  color: #475569;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover { color: #94A3B8; }

/* ---- 20. MAIN CONTENT OFFSET ---- */
.main-content { padding-top: var(--header-height); }

/* ---- 21. HERO SECTION ---- */
.hero-section {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  padding: var(--space-20) 0;
  overflow: hidden;
  background: var(--gradient-hero);
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ---- Animated gradient orbs ---- */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}

.hero-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle at 40% 40%, #3B82F6, transparent 70%);
  top: -160px; right: -120px;
  opacity: 0.45;
  animation: hero-drift-a 13s ease-in-out infinite;
}
.hero-orb-2 {
  width: 520px; height: 520px;
  background: radial-gradient(circle at 55% 55%, #8B5CF6, transparent 70%);
  bottom: -130px; left: -100px;
  opacity: 0.4;
  animation: hero-drift-b 16s ease-in-out infinite;
}
.hero-orb-3 {
  width: 340px; height: 340px;
  background: radial-gradient(circle at 50% 50%, #10B981, transparent 70%);
  top: 18%; left: 4%;
  opacity: 0.28;
  animation: hero-drift-c 11s ease-in-out infinite;
}
.hero-orb-4 {
  width: 260px; height: 260px;
  background: radial-gradient(circle at 50% 50%, #F59E0B, transparent 70%);
  bottom: 8%; right: 8%;
  opacity: 0.22;
  animation: hero-drift-a 14s ease-in-out infinite reverse;
}
.hero-orb-5 {
  width: 200px; height: 200px;
  background: radial-gradient(circle at 50% 50%, #EC4899, transparent 70%);
  top: 12%; right: 22%;
  opacity: 0.2;
  animation: hero-drift-b 10s ease-in-out infinite reverse;
}
.hero-orb-6 {
  width: 420px; height: 420px;
  background: radial-gradient(circle at 50% 50%, #06B6D4, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.1;
  animation: pulse-subtle 9s ease-in-out infinite;
}

@keyframes hero-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-28px, 18px) scale(1.04); }
  66%       { transform: translate(18px, -14px) scale(0.96); }
}
@keyframes hero-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(24px, -22px) scale(1.05); }
  66%       { transform: translate(-18px, 14px) scale(0.97); }
}
@keyframes hero-drift-c {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(14px, -22px); }
}

/* ---- Dot grid overlay ---- */
.hero-dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--color-border) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, black 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, black 20%, transparent 100%);
}

/* ---- Floating tool icons ---- */
.hero-floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-fi {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  font-size: 18px;
  opacity: 0.2;
  animation: hero-fi-float 6s ease-in-out infinite;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.hero-fi-1 { width: 50px; height: 50px; background: linear-gradient(135deg,#3B82F6,#6366F1); top: 11%; left: 7%; animation-delay: 0s;    animation-duration: 7s; }
.hero-fi-2 { width: 42px; height: 42px; background: linear-gradient(135deg,#10B981,#34D399); top: 32%; left: 3%; animation-delay: 1.1s;  animation-duration: 8s; }
.hero-fi-3 { width: 46px; height: 46px; background: linear-gradient(135deg,#F59E0B,#FBBF24); top: 56%; left: 8%; animation-delay: 2.2s;  animation-duration: 6.5s; }
.hero-fi-4 { width: 40px; height: 40px; background: linear-gradient(135deg,#EF4444,#F87171); bottom: 16%; left: 4%; animation-delay: 0.6s;  animation-duration: 9s; }
.hero-fi-5 { width: 54px; height: 54px; background: linear-gradient(135deg,#8B5CF6,#A78BFA); top: 9%;  right: 7%; animation-delay: 1.6s;  animation-duration: 7.5s; }
.hero-fi-6 { width: 44px; height: 44px; background: linear-gradient(135deg,#EC4899,#F9A8D4); top: 36%; right: 4%; animation-delay: 3.1s;  animation-duration: 8.5s; }
.hero-fi-7 { width: 46px; height: 46px; background: linear-gradient(135deg,#06B6D4,#22D3EE); top: 62%; right: 7%; animation-delay: 2.0s;  animation-duration: 7s; }
.hero-fi-8 { width: 38px; height: 38px; background: linear-gradient(135deg,#14B8A6,#2DD4BF); bottom: 14%; right: 5%; animation-delay: 0.9s;  animation-duration: 6s; }

@keyframes hero-fi-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-11px) rotate(4deg); }
  66%       { transform: translateY(7px) rotate(-3deg); }
}

/* ---- Word rotator ---- */
.hero-word-rotator { display: inline-block; }
#hero-rotator {
  display: inline-block;
  color: var(--color-accent);
  font-weight: 700;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#hero-rotator.hero-rotator-out {
  opacity: 0;
  transform: translateY(-6px);
}

.hero-content { position: relative; z-index: 1; text-align: center; max-width: 760px; margin: 0 auto; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.875rem;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-body);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-5);
}

.hero-title {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-5);
  color: var(--color-text);
}

.hero-subtitle {
  font-size: clamp(var(--text-base), 2vw, var(--text-xl));
  color: var(--color-text-muted);
  max-width: 580px;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}

/* Hero Search Bar */
.hero-search-wrap {
  position: relative;
  max-width: 580px;
  margin: 0 auto var(--space-8);
}

.hero-search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3.25rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-fast);
  outline: none;
}

.hero-search-input:focus {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--color-accent-light);
}

.hero-search-input::placeholder { color: var(--color-text-subtle); }

.hero-search-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 18px;
  pointer-events: none;
}

.hero-search-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Category Pills */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.875rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.hero-pill:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

/* ---- 22. SECTION TITLES ---- */
.section-header { text-align: center; margin-bottom: var(--space-10); }

.section-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

/* ---- 23. CATEGORY CARDS ---- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: transparent;
}

.category-card-accent {
  height: 5px;
  width: 100%;
  flex-shrink: 0;
}

.category-card-body {
  padding: var(--space-5) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  flex: 1;
}

.category-card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-card-info { flex: 1; min-width: 0; }

.category-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  display: block;
}

.category-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-card-count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

.category-card-arrow {
  font-size: 13px;
  color: var(--color-text-subtle);
  transition: transform var(--transition-fast);
}

.category-card:hover .category-card-arrow { transform: translateX(4px); }

/* ---- 24. TOOL CARDS ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-base);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-accent-light);
  background: var(--gradient-card-hover);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.tool-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.tool-card-badges { display: flex; gap: var(--space-1); flex-wrap: wrap; }

.tool-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}

.tool-card:hover .tool-card-name { color: var(--color-accent); }

.tool-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.tool-card-cta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

/* ---- 25. FEATURE CARDS ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent-light);
}

.feature-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin: 0 auto var(--space-4);
  box-shadow: var(--shadow-accent);
}

.feature-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* ---- 26. CTA SECTION ---- */
.cta-section {
  background: var(--gradient-accent);
  border-radius: var(--radius-2xl);
  padding: var(--space-12) var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 0 var(--container-padding);
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cta-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-4);
  position: relative;
}

.cta-desc {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-8);
  position: relative;
}

.cta-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; position: relative; }

.btn-cta-primary {
  background: #fff;
  color: var(--color-accent-dark);
  border: none;
  padding: 0.875rem 2rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  color: var(--color-accent-dark);
}

.btn-cta-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-cta-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
  color: #fff;
}

/* ---- 27. TOOL PAGE LAYOUT ---- */
.tool-page-wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-8) var(--container-padding);
}

.tool-main-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-8);
  align-items: start;
}

/* Bottom row: Related Tools (left) + Popular Tools (right) */
.tool-bottom-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-8);
  align-items: start;
  margin-top: var(--space-10);
}

.tool-bottom-row--no-related {
  grid-template-columns: 1fr;
  max-width: 400px;
}

/* Tool Header */
.tool-header {
  margin-bottom: var(--space-6);
}

.tool-header--split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  align-items: center;
}

.tool-header-main { min-width: 0; }

.tool-header-highlights {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;
  width: 260px;
}

.tool-highlight-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-3);
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.tool-highlight-item:hover {
  border-color: var(--color-accent);
  background: rgba(99,102,241,0.04);
  transform: translateX(2px);
}

.tool-highlight-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.tool-highlight-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-highlight-desc {
  display: none;
}

@media (max-width: 900px) {
  .tool-header--split {
    grid-template-columns: 1fr;
  }
  .tool-header-highlights {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }
}

.tool-category-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.75rem;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-full);
  text-decoration: none;
  margin-bottom: var(--space-4);
  transition: all var(--transition-fast);
}

.tool-category-badge:hover { background: var(--color-accent); color: #fff; }

.tool-title {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.tool-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 720px;
  margin-top: var(--space-2);
}

/* Tool Interface Card */
.tool-interface-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.tool-interface-header {
  padding: var(--space-3) var(--space-5);
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: linear-gradient(to right, rgba(99,102,241,0.06), transparent);
}

.tool-interface-title {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tool-interface-body { padding: var(--space-6); }

/* How to Use */
.how-to-use-section {
  margin-bottom: var(--space-6);
}

.how-to-use-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-5);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  align-items: stretch;
}

.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-top-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-top-color: var(--color-accent-hover, var(--color-accent));
}

.step-number {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-accent) 35%, transparent);
}

.step-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.step-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin: 0;
  flex: 1;
}

/* About Tool Section */
.about-tool-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.about-tool-header {
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
}

.about-tool-header:hover { background: var(--color-bg-secondary); }

.about-tool-header-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.about-tool-toggle {
  font-size: 16px;
  color: var(--color-text-muted);
  transition: transform var(--transition-base);
}

.about-tool-section.open { border-color: var(--color-accent); }
.about-tool-section.open .about-tool-header { background: var(--color-bg-secondary); }
.about-tool-section.open .about-tool-toggle { transform: rotate(180deg); }

.about-tool-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
  padding: 0 var(--space-6);
}

.about-tool-section.open .about-tool-body {
  max-height: 5000px;
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.about-tool-body h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin: var(--space-4) 0 var(--space-2);
}

.about-tool-body h3:first-child { margin-top: 0; }

.about-tool-body p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-3);
}

.about-tool-body ul, .about-tool-body ol {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  padding-left: var(--space-5);
  margin: 0 0 var(--space-3);
}

/* FAQ Section */
.faq-section {
  margin-bottom: var(--space-6);
}

.faq-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.faq-item.open { border-color: var(--color-accent); }
.faq-item.open .faq-question { background: var(--color-bg-secondary); }

.faq-question {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  cursor: pointer;
  text-align: left;
  border: none;
  transition: background var(--transition-fast);
}

.faq-question:hover { background: var(--color-bg-secondary); }

.faq-question-text {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: var(--leading-snug);
}

.faq-chevron {
  font-size: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
  background: var(--color-surface);
}

.faq-item.open .faq-answer {
  max-height: 600px;
  padding: var(--space-4) var(--space-6) var(--space-5);
}

.faq-answer-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* ---- 28. SIDEBAR ---- */
.tool-sidebar { position: sticky; top: calc(var(--header-height) + 24px); }

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.sidebar-card-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface-alt);
}

.sidebar-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sidebar-card-body { padding: var(--space-3) var(--space-4); }

.sidebar-tool-list { list-style: none; padding-left: 0; margin-bottom: 0; }

.sidebar-tool-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.sidebar-tool-item:hover { background: var(--color-bg-secondary); }

.sidebar-tool-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-tool-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}

.sidebar-tool-item:hover .sidebar-tool-name { color: var(--color-accent); }

.sidebar-ad-placeholder {
  background: var(--color-bg-secondary);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  margin-bottom: var(--space-4);
}

.sidebar-ad-text {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  font-style: italic;
}

/* ---- 29. BREADCRUMB ---- */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding: var(--space-3) 0;
  flex-wrap: wrap;
}

.breadcrumb-link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.breadcrumb-link:hover { color: var(--color-accent); }

.breadcrumb-sep {
  font-size: 10px;
  color: var(--color-text-subtle);
}

.breadcrumb-current {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 600;
}

/* ---- 30. RELATED TOOLS CAROUSEL ---- */
.related-tools-section {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--color-border-light);
  margin-top: var(--space-8);
}

.related-carousel {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
  scrollbar-width: none;
}

.related-carousel::-webkit-scrollbar { display: none; }

.related-carousel .tool-card {
  min-width: 220px;
  max-width: 260px;
  flex: 0 0 calc(25% - var(--space-4));
  scroll-snap-align: start;
  flex-shrink: 0;
}

.carousel-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.carousel-nav-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 4px 12px rgba(99,102,241,0.2);
  transform: translateY(-1px);
}

.carousel-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

/* ---- 31. CATEGORY PAGE ---- */
.category-page-header {
  padding: var(--space-10) 0;
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.category-page-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-lg);
}

.category-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.filter-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}

.filter-btn {
  padding: 0.4rem 1rem;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* ---- 32. TOAST NOTIFICATIONS ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 340px;
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.toast.toast-success { border-left: 4px solid var(--color-success); }
.toast.toast-error { border-left: 4px solid var(--color-error); }
.toast.toast-info { border-left: 4px solid var(--color-info); }
.toast.toast-warning { border-left: 4px solid var(--color-warning); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-error); }
.toast-info .toast-icon { color: var(--color-info); }
.toast-warning .toast-icon { color: var(--color-warning); }

.toast-dismiss {
  position: absolute;
  top: 8px; right: 8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.toast-dismiss:hover { background: var(--color-bg-secondary); color: var(--color-text); }

/* ---- 33. BACK TO TOP ---- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px; height: 44px;
  border-radius: var(--radius-lg);
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-base);
  z-index: 990;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover { transform: translateY(-3px); box-shadow: var(--shadow-accent-hover); }

/* ---- 34. SEARCH RESULTS DROPDOWN ---- */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1001;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}

.search-results-dropdown.visible { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--color-border);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--color-bg-secondary); }

.search-result-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.search-result-info { flex: 1; }
.search-result-name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
.search-result-category { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---- 35. CASE CONVERTER TOOL ---- */

/* Mode button grid */
.cc-modes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.cc-mode-btn {
  padding: 0.45rem 0.9rem;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast),
              background var(--transition-fast),
              color var(--transition-fast),
              box-shadow var(--transition-fast);
  white-space: nowrap;
}

.cc-mode-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.cc-mode-btn.active {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

/* Title case style sub-buttons */
.cc-title-styles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  animation: cc-slide-in 0.18s ease-out both;
}

@keyframes cc-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cc-title-styles-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-right: var(--space-1);
}

.cc-style-btn {
  padding: 0.28rem 0.7rem;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-body);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast),
              background var(--transition-fast),
              color var(--transition-fast);
}

.cc-style-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cc-style-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Field label */
.cc-field { margin-bottom: var(--space-1); }

.cc-field-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* Textareas */
.cc-textarea {
  width: 100%;
  min-height: 200px;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  resize: vertical;
  outline: none;
  display: block;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.cc-textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.cc-textarea::placeholder { color: var(--color-text-subtle); }

.cc-textarea-output {
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  cursor: default;
}

/* Word / char info */
.cc-meta {
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Toolbar */
.cc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-4);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.cc-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.cc-clear-btn { margin-left: auto; color: var(--color-error) !important; }
.cc-clear-btn:hover { background: rgba(239,68,68,0.08) !important; border-color: var(--color-error) !important; }

/* Dark mode overrides */
[data-theme="dark"] .cc-mode-btn {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}
[data-theme="dark"] .cc-mode-btn:hover {
  background: rgba(59,130,246,0.12);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
[data-theme="dark"] .cc-title-styles {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
}
[data-theme="dark"] .cc-style-btn {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
[data-theme="dark"] .cc-textarea {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .cc-textarea-output {
  background: var(--color-bg);
  color: var(--color-text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .cc-mode-btn { font-size: var(--text-xs); padding: 0.4rem 0.75rem; }
  .cc-toolbar { gap: var(--space-1); }
}

/* ---- 36. PRINT STYLES ---- */
@media print {
  .site-header, .site-footer, .tool-sidebar, .back-to-top, .toast-container { display: none !important; }
  .main-content { padding-top: 0; }
  .tool-main-layout { grid-template-columns: 1fr; }
  body { font-size: 12pt; background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* ---- 36. RESPONSIVE BREAKPOINTS ---- */

/* Prevent ANY element from causing horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
* { min-width: 0; }

/* Category page two-column layout — collapses on tablet/mobile */
.category-content-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-8);
  align-items: start;
}

/* XL: 1400px */
@media (max-width: 1400px) {
  :root { --container-max: 1180px; }
}

/* LG: 1200px */
@media (max-width: 1200px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .mega-menu-grid { grid-template-columns: repeat(3, 1fr); }
  :root { --sidebar-width: 260px; }
}

/* MD: 992px — tablet */
@media (max-width: 992px) {
  .site-nav { display: none; }
  .header-search { display: none; }
  .hamburger { display: flex; }
  .mobile-menu-overlay { display: flex; }
  /* push dark-mode toggle (and hamburger after it) to the right edge */
  .dark-mode-toggle { margin-left: auto; }

  /* Tool page: collapse sidebar below main content */
  .tool-main-layout { grid-template-columns: 1fr; }
  .tool-sidebar { position: static; }
  .tool-sidebar-col { display: none; } /* hide sidebar on tablet/mobile — too cramped */
  .tool-bottom-row { grid-template-columns: 1fr; }

  /* Category page: collapse sidebar below tools */
  .category-content-grid { grid-template-columns: 1fr; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

/* SM: 768px — large mobile */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --container-padding: 1rem;
    --space-16: 3rem;
    --space-20: 4rem;
    --space-24: 5rem;
  }

  /* Tool page spacing */
  .tool-page-wrap { padding: var(--space-5) var(--space-4); }
  .tool-interface-body { padding: var(--space-4); }
  .tool-interface-header { padding: var(--space-3) var(--space-4); }
  .tool-interface-title { font-size: var(--text-xs); letter-spacing: 0.04em; }
  .tool-title { font-size: var(--text-xl); }
  .tool-description { font-size: var(--text-sm); }

  /* Category page hero */
  .category-page-header { padding: var(--space-6) 0; }
  .category-page-icon { width: 52px; height: 52px; font-size: 20px; }

  /* General grids */
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: 1fr; }
  .mega-menu-grid { grid-template-columns: repeat(2, 1fr); }

  .hero-section { min-height: 380px; padding: var(--space-10) 0; }
  .hero-dot-grid { opacity: 0.4; }

  /* Show only 4 corner icons on mobile, smaller size */
  .hero-fi { width: 36px; height: 36px; font-size: 14px; opacity: 0.18; }
  .hero-fi-2, .hero-fi-3, .hero-fi-6, .hero-fi-7 { display: none; }

  /* Scale down orbs for mobile viewport */
  .hero-orb-1 { width: 320px; height: 320px; top: -80px; right: -60px; }
  .hero-orb-2 { width: 280px; height: 280px; bottom: -60px; left: -60px; }
  .hero-orb-3 { width: 200px; height: 200px; }
  .hero-orb-4, .hero-orb-5 { display: none; }

  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-brand-desc { max-width: 100%; }

  .cta-section { padding: var(--space-8) var(--space-5); margin: 0; border-radius: 0; }

  /* FAQ / About sections */
  .about-tool-header { padding: var(--space-4); }
  .about-tool-body { padding: var(--space-4); }
  .faq-question { padding: var(--space-4); }
  /* only reduce padding on OPEN answers — closed answers must keep padding:0 for proper collapse */
  .faq-item.open .faq-answer { padding: var(--space-3) var(--space-4) var(--space-4); }
  .faq-title { font-size: var(--text-lg); margin-bottom: var(--space-4); }

  /* How to Use */
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

/* XS: 480px — small mobile (iPhone SE etc.) */
@media (max-width: 480px) {
  :root { --container-padding: 0.875rem; }

  /* Header stays readable */
  .logo-text { font-size: var(--text-lg); }

  /* Tool page tighter padding */
  .tool-page-wrap { padding: var(--space-4) var(--space-3); }
  .tool-interface-body { padding: var(--space-3); }
  .tool-interface-header { padding: var(--space-3); }

  /* Breadcrumb wraps gracefully */
  .breadcrumb-nav { gap: var(--space-1); padding: var(--space-2) 0; }
  .breadcrumb-link span { display: none; } /* hide "Home" text, keep icon */

  /* Category page */
  .category-page-header { padding: var(--space-5) 0; }

  /* Grids */
  .categories-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .related-carousel { grid-template-columns: 1fr; }

  /* Typography */
  .hero-title { font-size: var(--text-3xl); }
  .section-title { font-size: var(--text-2xl); }

  /* Hero icons even smaller on iPhone SE */
  .hero-fi { width: 30px; height: 30px; font-size: 12px; opacity: 0.14; }
  .hero-orb-1 { width: 240px; height: 240px; }
  .hero-orb-2 { width: 200px; height: 200px; }

  /* Misc */
  .toast-container { bottom: 12px; right: 12px; left: 12px; max-width: none; }
  .back-to-top { bottom: 12px; right: 12px; width: 40px; height: 40px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: var(--space-2); }
}
