/* ============================================================
   arattai.it.com — JSON Tools | Global Stylesheet
   ============================================================ */

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

/* ---------- CSS Variables ---------- */
:root {
  /* ---- Light mode (default) ---- */
  --bg-base: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-card: rgba(0,0,0,0.035);
  --bg-card-hover: rgba(0,0,0,0.06);
  --border-subtle: rgba(0,0,0,0.09);
  --border-accent: rgba(79,157,232,0.4);

  --accent-primary: #3a87d4;
  --accent-secondary: #6a3fcb;
  --accent-success: #1fa97a;
  --accent-warning: #d4920a;
  --accent-danger: #d9534f;

  --grad-primary: linear-gradient(135deg, #3a87d4 0%, #6a3fcb 100%);
  --grad-surface: linear-gradient(145deg, rgba(79,157,232,0.08) 0%, rgba(124,92,252,0.05) 100%);

  --text-primary: #0f1623;
  --text-secondary: #4a5a78;
  --text-muted: #8a9ab8;

  --nav-bg: rgba(255,255,255,0.88);
  --dropdown-bg: rgba(255,255,255,0.98);
  --mobile-nav-bg: rgba(245,247,252,0.97);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-soft: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-glow: 0 0 40px rgba(79,157,232,0.12);

  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Dark mode overrides ---- */
[data-theme="dark"] {
  --bg-base: #080c14;
  --bg-surface: #0d1220;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border-subtle: rgba(255,255,255,0.07);
  --border-accent: rgba(99,179,237,0.35);

  --accent-primary: #4f9de8;
  --accent-secondary: #7c5cfc;
  --accent-success: #34d399;
  --accent-warning: #fbbf24;
  --accent-danger: #f87171;

  --grad-primary: linear-gradient(135deg, #4f9de8 0%, #7c5cfc 100%);
  --grad-surface: linear-gradient(145deg, rgba(79,157,232,0.12) 0%, rgba(124,92,252,0.08) 100%);

  --text-primary: #f0f4ff;
  --text-secondary: #8a9ac0;
  --text-muted: #4a5568;

  --nav-bg: rgba(8,12,20,0.85);
  --dropdown-bg: rgba(12,18,32,0.97);
  --mobile-nav-bg: rgba(8,12,20,0.97);

  --shadow-soft: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 40px rgba(79,157,232,0.15);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* animated background gradient orbs */
body::before, body::after {
  content:'';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 18s ease-in-out infinite alternate;
}
body::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(79,157,232,0.08) 0%, transparent 70%);
  top: -100px; left: -100px;
}
body::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,92,252,0.07) 0%, transparent 70%);
  bottom: -60px; right: -60px;
  animation-delay: -9s;
}
[data-theme="dark"] body::before {
  background: radial-gradient(circle, rgba(79,157,232,0.13) 0%, transparent 70%);
}
[data-theme="dark"] body::after {
  background: radial-gradient(circle, rgba(124,92,252,0.12) 0%, transparent 70%);
}
@keyframes orb-drift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(40px,40px) scale(1.15); }
}

/* ---------- Layout ---------- */
.page-wrapper { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  transition: background var(--transition), border-color var(--transition);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.nav-logo-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  box-shadow: 0 0 20px rgba(79,157,232,0.4);
}
.nav-logo-text { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.nav-logo-text span { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.nav-links {
  display: flex; align-items: center; gap: 2px;
  list-style: none;
}
.nav-links > li { position: relative; }
.nav-links > li > a,
.nav-drop-trigger {
  text-decoration: none; color: var(--text-secondary);
  font-size: 0.95rem; font-weight: 500;
  padding: 7px 12px; border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; font-family: var(--font-sans);
}
.nav-links > li > a:hover,
.nav-drop-trigger:hover,
.nav-links > li:hover > .nav-drop-trigger {
  color: var(--text-primary); background: var(--bg-card-hover);
}
.nav-links > li > a.active,
.nav-drop-trigger.active { color: var(--accent-primary); }
.nav-drop-arrow { font-size: 0.6rem; opacity: 0.6; transition: transform var(--transition); }
.nav-links > li:hover .nav-drop-arrow { transform: rotate(180deg); }

/* Dropdown menu */
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 200px; z-index: 200;
  background: var(--dropdown-bg); backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 6px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  pointer-events: none; opacity: 0;
  transform: translateY(-4px);
  transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
}
/* Invisible hover bridge: fills the 8px gap between trigger and dropdown */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px; left: 0; right: 0;
  height: 8px;
}
.nav-links > li:hover .nav-dropdown-menu {
  pointer-events: auto; opacity: 1; transform: translateY(0);
}
.nav-dropdown-menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-secondary);
  font-size: 0.82rem; font-weight: 500;
  transition: all var(--transition); white-space: nowrap;
}
.nav-dropdown-menu a:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.nav-dropdown-menu a.active { color: var(--accent-primary); }
.nav-dropdown-menu .drop-divider {
  height: 1px; background: var(--border-subtle); margin: 4px 0;
}
.nav-drop-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  padding: 6px 12px 2px;
}

.nav-hamburger {
  display: none; background: none; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 6px; cursor: pointer;
  color: var(--text-secondary); flex-direction: column; gap: 4px;
}
.nav-hamburger span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: all var(--transition); }

/* ---------- Nav Search ---------- */
.nav-search-wrap {
  position: relative; display: flex; align-items: center;
  flex-shrink: 0;
}
.nav-search-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.nav-search-btn:hover { color: var(--accent-primary); border-color: var(--border-accent); }
.nav-search-box {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 0; overflow: hidden; transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
}
.nav-search-box.open { width: 260px; }
.nav-search-box input {
  width: 100%; padding: 8px 16px 8px 38px;
  background: var(--bg-surface); border: 1.5px solid var(--accent-primary);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 0.85rem; outline: none;
  box-shadow: 0 0 0 3px rgba(58,135,212,0.12);
}
.nav-search-box input::placeholder { color: var(--text-muted); }
.nav-search-icon-inner {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; pointer-events: none; color: var(--text-muted);
}
/* Nav search dropdown results */
.nav-search-results {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px; background: var(--dropdown-bg);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  max-height: 380px; overflow-y: auto;
  display: none; z-index: 300;
  padding: 6px;
}
.nav-search-results.visible { display: block; }
.nav-search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-primary);
  font-size: 0.84rem; font-weight: 500;
  transition: background var(--transition);
}
.nav-search-result-item:hover { background: var(--bg-card-hover); color: var(--accent-primary); }
.nav-search-result-icon { font-size: 18px; flex-shrink: 0; }
.nav-search-result-name { flex: 1; }
.nav-search-result-cat { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }
.nav-search-no-result { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Hero Search ---------- */
.hero-search-wrap {
  position: relative; max-width: 620px; margin: 32px auto 0;
}
.hero-search-inner {
  display: flex; align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 6px 6px 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 0 0 0 rgba(58,135,212,0);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search-inner:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 0 0 4px rgba(58,135,212,0.14);
}
.hero-search-inner input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font-sans); font-size: 1rem;
  color: var(--text-primary); padding: 6px 0;
}
.hero-search-inner input::placeholder { color: var(--text-muted); }
.hero-search-btn {
  background: var(--grad-primary); color: #fff;
  border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700;
  font-family: var(--font-sans);
  display: flex; align-items: center; gap: 6px;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.hero-search-btn:hover { opacity: 0.9; transform: scale(1.03); }
.hero-search-icon { font-size: 15px; }
/* Pill tag suggestions below search */
.hero-search-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-top: 16px;
}
.hero-tag {
  padding: 5px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition); text-decoration: none; display: inline-block;
}
.hero-tag:hover { background: rgba(58,135,212,0.1); border-color: var(--accent-primary); color: var(--accent-primary); }
/* "No results" state in tool grid */
.tools-no-results {
  grid-column: 1 / -1; text-align: center;
  padding: 60px 20px; color: var(--text-muted);
}
.tools-no-results .no-res-icon { font-size: 48px; margin-bottom: 12px; }
.tools-no-results p { font-size: 1rem; }

/* ---------- Mobile Nav ---------- */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--mobile-nav-bg); backdrop-filter: blur(24px);
  flex-direction: column; align-items: center;
  padding: 70px 20px 30px; overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav-group { width: 100%; max-width: 320px; margin-bottom: 8px; }
.mobile-nav-group-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  padding: 10px 4px 4px; margin-bottom: 2px;
}
.mobile-nav a {
  text-decoration: none; color: var(--text-secondary);
  font-size: 0.95rem; font-weight: 500; padding: 10px 16px;
  border-radius: var(--radius-sm); display: flex; align-items: center; gap: 9px;
  transition: all var(--transition); width: 100%;
}
.mobile-nav a:hover, .mobile-nav a.active { color: var(--accent-primary); background: rgba(79,157,232,0.08); }
.mobile-nav-close {
  position: fixed; top: 18px; right: 22px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); width: 36px; height: 36px;
  border-radius: var(--radius-sm); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition);
}
.mobile-nav-close:hover { color: var(--text-primary); }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 20px 60px;
  text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  background: rgba(79,157,232,0.1); border: 1px solid rgba(79,157,232,0.25);
  font-size: 0.78rem; font-weight: 600; color: var(--accent-primary);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 24px;
}
.hero-badge::before { content:''; width:7px; height:7px; border-radius:50%; background:var(--accent-primary); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:0.5; transform:scale(0.7); } }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -0.02em; margin-bottom: 16px;
}
.hero h1 .grad { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px;
}

/* ============================================================
   HERO V2 — two-column with floating particles & stats strip
   ============================================================ */
.hero-v2 {
  padding: 0 0 0; margin: 0; text-align: left;
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--bg-page) 0%, var(--bg-surface) 100%);
}
.hero-v2-inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  align-items: center;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 56px;
}
/* Left column */
.hero-v2-content { display: flex; flex-direction: column; gap: 0; }
.hero-badge-v2 {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-primary);
  background: rgba(58,135,212,0.1);
  border: 1px solid rgba(58,135,212,0.25);
  border-radius: 999px; padding: 5px 14px;
  width: fit-content; margin-bottom: 20px;
}
.hero-v2-title {
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  font-weight: 900; line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 18px;
}
.hero-grad-wrap { display: inline-block; }
.hero-v2-sub {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--text-secondary); max-width: 520px;
  line-height: 1.7; margin-bottom: 28px;
}
/* Hero search v2 */
.hero-search-v2 { max-width: 540px; margin: 0 0 16px; }
.hero-search-v2 .hero-search-inner {
  border-radius: var(--radius-md);
  padding: 5px 5px 5px 18px;
  display: flex; align-items: center; gap: 10px;
}
.hero-search-prefix { font-size: 17px; flex-shrink: 0; color: var(--text-muted); }
.hero-search-v2 .hero-search-btn {
  border-radius: var(--radius-sm);
  padding: 10px 24px;
}
.hero-search-v2 .hero-search-tags { justify-content: flex-start; }
/* Right column: mini preview cards */
.hero-v2-preview {
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.hero-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  animation: hpc-float 4s ease-in-out infinite;
}
.hpc-2 { animation-delay: 1.3s; }
.hpc-3 { animation-delay: 2.6s; }
@keyframes hpc-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}
.hpc-icon { font-size: 20px; }
.hpc-name { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hpc-demo {
  font-family: var(--font-mono); font-size: 0.8rem;
  background: var(--bg-surface); border-radius: var(--radius-sm);
  padding: 8px 12px; line-height: 1.6;
}
.hpc-k { color: var(--accent-primary); font-weight: 700; }
.hpc-s { color: var(--accent-success); }
.hpc-v { color: var(--accent-secondary); }
.hpc-mono { letter-spacing: 0.06em; }

/* Floating code particles */
.hero-particles { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hp {
  position: absolute; font-family: var(--font-mono); font-weight: 700;
  opacity: 0.06; color: var(--accent-primary);
  animation: hp-drift 20s ease-in-out infinite;
}
.hp1 { font-size: 3rem; top: 10%; left: 5%; animation-duration: 22s; }
.hp2 { font-size: 2rem; top: 60%; left: 80%; animation-duration: 18s; animation-delay: -4s; }
.hp3 { font-size: 2.5rem; top: 30%; left: 60%; animation-duration: 25s; animation-delay: -8s; }
.hp4 { font-size: 1.8rem; top: 75%; left: 15%; animation-duration: 20s; animation-delay: -12s; }
.hp5 { font-size: 2.2rem; top: 15%; left: 85%; animation-duration: 28s; animation-delay: -5s; }
.hp6 { font-size: 1.6rem; top: 50%; left: 40%; animation-duration: 16s; animation-delay: -3s; }
@keyframes hp-drift {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  33% { transform: translate(20px,-15px) rotate(5deg); }
  66% { transform: translate(-15px,10px) rotate(-3deg); }
}
/* Stats strip */
.hero-stats {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 20px 0;
  position: relative; z-index: 1;
}
.hero-stats-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap;
}
.hero-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 36px;
}
.hero-stat-num {
  font-size: 1.6rem; font-weight: 900;
  background: var(--grad-primary); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1;
}
.hero-stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.hero-stat-div { width: 1px; height: 36px; background: var(--border-subtle); flex-shrink: 0; }

/* ============================================================
   SECTION HEADERS v2
   ============================================================ */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; margin-top: 48px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap; gap: 12px;
}
#tools-main > .tools-grid:first-child { margin-top: 0; padding-top: 0; }

.section-hdr-left {
  display: flex; align-items: center; gap: 16px;
}
.section-hdr-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.section-hdr .section-label { margin-bottom: 2px; }
.section-hdr .section-title { margin-bottom: 0; font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
.section-hdr-count {
  font-size: 0.8rem; font-weight: 700; color: var(--accent-primary);
  background: rgba(58,135,212,0.1); border: 1px solid rgba(58,135,212,0.2);
  border-radius: 999px; padding: 4px 14px;
  white-space: nowrap; flex-shrink: 0;
}

/* ============================================================
   WHY SECTION v2 — 6-card grid
   ============================================================ */
.why-section {
  padding: 64px 0 80px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
}
.why-section-hdr { text-align: center; margin-bottom: 48px; }
.why-section-sub { color: var(--text-secondary); max-width: 520px; margin: 12px auto 0; font-size: 0.95rem; line-height: 1.7; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex; align-items: flex-start; gap: 18px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.why-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  opacity: 0; transition: opacity var(--transition);
}
.why-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
.why-card:hover::before { opacity: 1; }
.why-card-icon-wrap {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.why-icon-blue  { background: rgba(58,135,212,0.12); }
.why-icon-purple{ background: rgba(124,92,252,0.12); }
.why-icon-teal  { background: rgba(20,184,166,0.12); }
.why-icon-green { background: rgba(52,211,153,0.12); }
.why-icon-orange{ background: rgba(251,146,60,0.12); }
.why-icon-pink  { background: rgba(236,72,153,0.12); }
.why-card:nth-child(1)::before { background: var(--grad-primary); }
.why-card:nth-child(2)::before { background: linear-gradient(90deg,#7c5cfc,#a78bfa); }
.why-card:nth-child(3)::before { background: linear-gradient(90deg,#14b8a6,#34d399); }
.why-card:nth-child(4)::before { background: linear-gradient(90deg,#34d399,#6ee7b7); }
.why-card:nth-child(5)::before { background: linear-gradient(90deg,#fb923c,#fbbf24); }
.why-card:nth-child(6)::before { background: linear-gradient(90deg,#ec4899,#f472b6); }
.why-card-body h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.why-card-body p  { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.65; }


.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px; padding: 0;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: row;
  align-items: center; gap: 14px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.tool-card::after {
  content: ''; position: absolute; inset: 0;
  background: var(--grad-surface);
  opacity: 0; transition: opacity var(--transition);
  z-index: 0;
}
.tool-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateX(3px);
}
.tool-card:hover::after { opacity: 1; }

/* Left-border color by category */
.tool-card[data-cat="JSON"]:hover     { border-left-color: #4f9de8; }
.tool-card[data-cat="Encode"]:hover   { border-left-color: #22d3ee; }
.tool-card[data-cat="Formatter"]:hover{ border-left-color: #7c5cfc; }
.tool-card[data-cat="Color"]:hover    { border-left-color: #f472b6; }
.tool-card[data-cat="Text"]:hover     { border-left-color: #34d399; }

.tool-card-icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; position: relative; z-index: 1;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.tool-card:hover .tool-card-icon { transform: scale(1.08); }

.tool-card-body {
  flex: 1; min-width: 0; position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.tool-card-title {
  font-size: 0.9rem; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tool-card-desc {
  font-size: 0.77rem; color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
  transition: color var(--transition);
}
.tool-card:hover .tool-card-desc { color: var(--text-secondary); }

.tool-card-arrow {
  display: flex; align-items: center;
  font-size: 1rem; color: var(--text-muted);
  position: relative; z-index: 1;
  transition: all var(--transition);
  flex-shrink: 0;
}
.tool-card:hover .tool-card-arrow {
  color: var(--accent-primary);
  transform: translateX(3px);
}

/* color variants */
.icon-blue { background: rgba(79,157,232,0.15); color: #4f9de8; }
.icon-purple { background: rgba(124,92,252,0.15); color: #7c5cfc; }
.icon-green { background: rgba(52,211,153,0.15); color: #34d399; }
.icon-orange { background: rgba(251,191,36,0.15); color: #fbbf24; }
.icon-pink { background: rgba(248,113,113,0.15); color: #f87171; }
.icon-teal { background: rgba(34,211,238,0.15); color: #22d3ee; }

/* ---------- Tool Page Layout ---------- */
.tool-hero {
  padding: 48px 20px 32px;
  max-width: 1200px; margin: 0 auto;
}
.tool-hero-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px;
  flex-wrap: wrap;
}
.tool-hero-breadcrumb a { color: var(--accent-primary); text-decoration: none; }
.tool-hero-breadcrumb a:hover { text-decoration: underline; }
.tool-hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px; border-radius: 999px;
  background: rgba(79,157,232,0.1); border: 1px solid rgba(79,157,232,0.2);
  font-size: 0.75rem; font-weight: 600; color: var(--accent-primary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;
}
.tool-hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 8px; }
.tool-hero-title .grad { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.tool-hero-desc { color: var(--text-secondary); font-size: 0.95rem; max-width: 600px; }

/* ---------- Tool Workspace ---------- */
.tool-workspace {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px 80px;
  display: grid; gap: 20px;
}
.workspace-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02); flex-wrap: wrap; gap: 10px;
}
.panel-title {
  font-size: 0.82rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.panel-title-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-primary); }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition);
  font-family: var(--font-sans); white-space: nowrap;
}
.btn-primary {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 4px 16px rgba(79,157,232,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(79,157,232,0.45); }
.btn-secondary {
  background: var(--bg-card-hover); color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--border-accent); }
.btn-success { background: rgba(52,211,153,0.15); color: var(--accent-success); border: 1px solid rgba(52,211,153,0.2); }
.btn-success:hover { background: rgba(52,211,153,0.25); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--accent-danger); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.25); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn:active { transform: scale(0.97) !important; }

/* ---------- Textarea / Editor ---------- */
.code-area {
  width: 100%; min-height: 300px; padding: 18px 20px;
  background: transparent; border: none; outline: none; resize: vertical;
  font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.7;
  color: var(--text-primary); tab-size: 2;
}
.code-area::placeholder { color: var(--text-muted); }

.output-area {
  min-height: 300px; padding: 18px 20px;
  font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.7;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  color: var(--text-primary);
}

/* ---------- Action Bar ---------- */
.action-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 24px 20px;
  flex-wrap: wrap;
}

/* ---------- Status Badge ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
}
.status-valid { background: rgba(52,211,153,0.12); color: var(--accent-success); border: 1px solid rgba(52,211,153,0.25); }
.status-invalid { background: rgba(248,113,113,0.12); color: var(--accent-danger); border: 1px solid rgba(248,113,113,0.25); }
.status-idle { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* ---------- Result / Messages ---------- */
.result-msg {
  padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 0.875rem; display: flex; align-items: flex-start; gap: 10px;
  line-height: 1.5;
}
.result-success { background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2); color: var(--accent-success); }
.result-error { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); color: var(--accent-danger); }
.result-info { background: rgba(79,157,232,0.08); border: 1px solid rgba(79,157,232,0.2); color: var(--accent-primary); }

/* ---------- Two column layout for tool ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ---------- Stats Row ---------- */
.stats-row {
  display: flex; gap: 16px; flex-wrap: wrap; padding: 16px 20px;
  border-top: 1px solid var(--border-subtle); background: rgba(255,255,255,0.01);
}
.stat-item { display: flex; flex-direction: column; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 2px; }
.stat-value { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }

/* ---------- Table (CSV Preview) ---------- */
.csv-table-wrap { overflow-x: auto; max-height: 400px; overflow-y: auto; padding: 16px 20px; }
.csv-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.82rem; font-family: var(--font-mono);
}
.csv-table th {
  background: rgba(79,157,232,0.1); color: var(--accent-primary);
  padding: 9px 16px; text-align: left; font-weight: 600;
  border-bottom: 1px solid rgba(79,157,232,0.2);
  white-space: nowrap; position: sticky; top: 0;
}
.csv-table td {
  padding: 8px 16px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary); white-space: nowrap;
}
.csv-table tr:last-child td { border-bottom: none; }
.csv-table tr:hover td { background: var(--bg-card-hover); color: var(--text-primary); }

/* ---------- Info Section ---------- */
.info-section {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px 80px;
}
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.info-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 22px 20px;
}
.info-card-icon { font-size: 22px; margin-bottom: 10px; }
.info-card-title { font-size: 0.92rem; font-weight: 700; margin-bottom: 6px; }
.info-card-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }

/* ---------- Section Headings ---------- */
.section-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent-primary); margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800;
  margin-bottom: 12px; line-height: 1.2;
}
.section-title .grad { background: var(--grad-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  position: relative;
  background: linear-gradient(180deg, rgba(220,225,240,0.0) 0%, rgba(220,225,240,0.95) 100%),
              rgba(0,0,0,0.01);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 64px 24px 0;
  overflow: hidden;
}
[data-theme="dark"] .footer {
  background: linear-gradient(180deg, rgba(10,12,24,0.0) 0%, rgba(10,12,24,0.95) 100%),
              rgba(255,255,255,0.015);
  border-top: 1px solid transparent;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), var(--accent-success), transparent);
  opacity: 0.7;
}
.footer::after {
  content: '';
  position: absolute;
  top: -120px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 200px;
  background: radial-gradient(ellipse at center, rgba(124,92,252,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: 280px repeat(4, 1fr);
  gap: 40px 32px;
  align-items: start;
  position: relative;
}
/* Brand column */
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand .nav-logo { margin-bottom: 4px; }
.footer-brand-desc {
  font-size: 0.84rem; color: var(--text-secondary);
  line-height: 1.7; max-width: 240px;
}
.footer-tagline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-primary);
  background: rgba(124,92,252,0.08);
  border: 1px solid rgba(124,92,252,0.2);
  border-radius: 999px; padding: 4px 12px;
  width: fit-content;
}
.footer-social { display: flex; gap: 10px; margin-top: 4px; }
.footer-social-link {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; text-decoration: none;
  color: var(--text-muted); transition: all var(--transition);
}
.footer-social-link:hover {
  background: rgba(124,92,252,0.12);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}
/* Link columns */
.footer-col { display: flex; flex-direction: column; gap: 0; }
.footer-col-title {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-primary); margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 7px;
}
.footer-col-title span { font-size: 0.9rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.footer-col ul li a {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.83rem; color: var(--text-primary);
  text-decoration: none; padding: 5px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  opacity: 0.75;
}
.footer-col ul li a:hover {
  color: var(--accent-primary);
  background: rgba(58,135,212,0.07);
  padding-left: 10px;
  opacity: 1;
}
.footer-col ul li a .fi { font-size: 0.78rem; opacity: 0.7; }
/* Divider */
.footer-divider {
  max-width: 1200px; margin: 40px auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), var(--border-subtle), transparent);
}
/* Bottom bar */
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding: 20px 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-secondary); flex-wrap: wrap; gap: 12px;
}
.footer-bottom-left { display: flex; align-items: center; gap: 6px; }
.footer-bottom-left a { color: var(--accent-primary); text-decoration: none; font-weight: 600; }
.footer-bottom-right { display: flex; align-items: center; gap: 16px; }
.footer-bottom-right a {
  color: var(--text-secondary); text-decoration: none;
  transition: color var(--transition); font-size: 0.78rem;
}
.footer-bottom-right a:hover { color: var(--accent-primary); }
.footer-bottom-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2);
  border-radius: 999px; padding: 3px 10px;
  font-size: 0.72rem; font-weight: 600; color: var(--accent-success);
}
/* Footer links (legacy compat) */
.footer-links h3 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.875rem; color: var(--text-secondary); text-decoration: none; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent-primary); }

/* ---------- Syntax highlighting shades ---------- */
.json-key    { color: #79c0ff; }
.json-string { color: #a5d6a7; }
.json-number { color: #ffb74d; }
.json-bool   { color: #f48fb1; }
.json-null   { color: #90a4ae; }
.json-punctuation { color: var(--text-secondary); }

/* ---------- Tooltip ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #1a2035; border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-size: 0.75rem; padding: 5px 10px;
  border-radius: 6px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--transition);
}
[data-tooltip]:hover::after { opacity: 1; }

/* ---------- Copy notification ---------- */
.copy-toast {
  position: fixed; bottom: 30px; right: 30px; z-index: 500;
  background: rgba(52,211,153,0.15); border: 1px solid rgba(52,211,153,0.3);
  color: var(--accent-success); padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: blur(12px);
}
.copy-toast.show { transform: translateY(0); opacity: 1; }

/* ---------- Responsive ---------- */

/* ---- Global overflow safety — prevents horizontal scroll on all tool pages ---- */
.tool-workspace * { box-sizing: border-box; }
textarea, select, input { max-width: 100%; }
.tool-workspace img { height: auto; max-width: 100%; }

/* ----- 1024px — large tablet / small laptop ----- */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px 24px;
  }
  .footer-brand { grid-column: 1 / -1; }
}

/* ----- 900px — tablet landscape ----- */
@media (max-width: 900px) {
  /* Hero v2 */
  .hero-v2-inner { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-v2-preview { display: none; }
  .hero-v2-title { font-size: clamp(2rem, 7vw, 3rem); }
  .hero-v2 { text-align: center; }
  .hero-badge-v2 { margin: 0 auto 20px; }
  .hero-v2-sub { margin-left: auto; margin-right: auto; }
  .hero-search-v2 { max-width: 100%; }
  .hero-search-v2 .hero-search-tags { justify-content: center; }

  /* Stats strip */
  .hero-stat { padding: 8px 20px; }

  /* Why section */
  .why-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tool workspace — stack two-col panels vertically */
  .two-col { grid-template-columns: 1fr; }
  .tool-workspace { padding: 0 16px 60px; gap: 14px; }
  /* Option/control rows wrap on tablet */
  .tool-workspace > div { flex-wrap: wrap; }
  input[type="range"] { width: 100%; }

  /* Footer */
  .footer-inner { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 20px; }
  .footer-brand-desc { max-width: 100%; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-bottom-right { flex-wrap: wrap; gap: 10px; }
}

/* ----- 680px — mobile landscape / large phone ----- */
@media (max-width: 680px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-inner { gap: 10px; }
  .nav-search-wrap { display: none; }

  /* Hero */
  .hero { padding: 48px 16px 36px; }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .hero-search-inner { padding: 5px 5px 5px 16px; }
  .hero-badge { margin-bottom: 16px; }

  /* Hero v2 */
  .hero-v2-inner { padding-top: 36px; padding-bottom: 40px; }
  .hero-v2-title { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .hero-stats-inner { flex-wrap: wrap; gap: 0; }
  .hero-stat { padding: 6px 14px; }
  .hero-stat-div { display: none; }
  .hero-stat-num { font-size: 1.3rem; }

  /* Section headers */
  .section-hdr { margin-top: 36px; flex-direction: column; align-items: flex-start; }
  .section-hdr-count { align-self: flex-start; }

  /* Tool page hero */
  .tool-hero { padding: 28px 16px 16px; }
  .tool-hero-title { font-size: clamp(1.4rem, 6vw, 2rem); }
  .tool-workspace { padding: 0 12px 48px; gap: 12px; }

  /* Panel headers — stack title + actions vertically */
  .panel-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .panel-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .panel-actions .btn { font-size: 0.75rem; }

  /* ---- All option/control rows inside tool workspace wrap on mobile ---- */
  .tool-workspace > div { flex-wrap: wrap; gap: 8px; }
  .tool-workspace select {
    max-width: 100%; min-width: 0; flex: 1 1 auto; width: auto;
  }
  .tool-workspace input[type="number"],
  .tool-workspace input[type="text"] {
    max-width: 100%; min-width: 0; flex: 1 1 auto;
  }
  input[type="range"] { width: 100% !important; }

  /* Buttons / action bar — full width stacked */
  .action-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 12px; }
  .action-bar .btn { justify-content: center; width: 100%; }

  /* Stats row */
  .stats-row { gap: 10px; padding: 12px 14px; }

  /* Code & output areas */
  .code-area { font-size: 0.82rem; padding: 14px; min-height: 200px; }
  .output-area { font-size: 0.82rem; padding: 14px; min-height: 200px; }

  /* Info grid — 2 columns */
  .info-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .info-card { padding: 16px 14px; }

  /* Footer */
  .footer { padding: 48px 16px 0; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .footer-brand { flex-direction: column; gap: 12px; }
  .footer-col-title { font-size: 0.68rem; }

  /* SEO article */
  .tool-article { padding: 36px 16px 48px; font-size: 0.93rem; }
  .tool-article h2 { font-size: clamp(1.1rem, 5vw, 1.45rem); }
  .tool-article pre { padding: 12px 14px; font-size: 0.8rem; overflow-x: auto; }

  /* Why grid — single column */
  .why-grid { grid-template-columns: 1fr; }

  /* Status badge smaller */
  .status-badge { font-size: 0.75rem; padding: 4px 10px; }
}

/* ----- 480px — standard phone portrait ----- */
@media (max-width: 480px) {
  /* Nav */
  .nav { padding: 0 12px; }
  .nav-logo-text { font-size: 1rem; }

  /* Tool workspace */
  .tool-workspace { padding: 0 10px 40px; gap: 10px; }

  /* ---- All option/control rows become full-width single column ---- */
  .tool-workspace > div { flex-wrap: wrap !important; }
  .tool-workspace select { width: 100% !important; flex: 1 1 100%; min-width: 0; }
  .tool-workspace input[type="range"] { width: 100% !important; }

  /* Panels */
  .workspace-panel { border-radius: var(--radius-md); }

  /* Info grid — single column */
  .info-grid { grid-template-columns: 1fr; }

  /* Tools grid — single column */
  .tools-grid { grid-template-columns: 1fr; gap: 8px; }
  .tool-card { padding: 12px 14px; }

  /* Hero */
  .hero { padding: 40px 12px 28px; }
  .hero-search-inner { padding: 4px 4px 4px 14px; }
  .hero-search-btn { padding: 9px 14px; font-size: 0.82rem; }
  .hero-search-tags { gap: 6px; }
  .hero-tag { font-size: 0.72rem; padding: 4px 10px; }

  /* Hero stats */
  .hero-stats { padding: 14px 0; }
  .hero-stat { padding: 6px 10px; }

  /* Code areas — shorter on small phones */
  .code-area { min-height: 160px; font-size: 0.8rem; }
  .output-area { min-height: 160px; font-size: 0.8rem; }

  /* Footer — single column */
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .footer-bottom-right { gap: 8px; font-size: 0.73rem; }

  /* SEO article */
  .tool-article { padding: 28px 12px 40px; }

  /* Action bar */
  .action-bar { padding: 12px 10px; }

  /* Copy toast — full width */
  .copy-toast { bottom: 16px; right: 12px; left: 12px; justify-content: center; }
}

/* ----- 360px — very small phones ----- */
@media (max-width: 360px) {
  .nav-logo-text { display: none; }
  .tool-hero-title { font-size: 1.3rem; }
  .btn { padding: 7px 12px; font-size: 0.8rem; }
  .btn-sm { padding: 4px 9px; font-size: 0.72rem; }
  .hero-search-btn { padding: 8px 10px; }
  .footer-inner { gap: 12px; }
  .code-area, .output-area { font-size: 0.76rem; min-height: 120px; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); opacity: 0.5; }

/* ---------- Night mode toggle switch (adjustbar) ---------- */
.theme-switch-wrap {
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0; cursor: pointer; user-select: none;
}
.theme-switch-icon {
  font-size: 14px; line-height: 1; transition: opacity var(--transition);
  width: 18px; text-align: center;
}
.theme-switch {
  position: relative; width: 46px; height: 26px; flex-shrink: 0;
}
.theme-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.theme-switch-track {
  position: absolute; inset: 0;
  background: var(--border-subtle);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.theme-switch input:checked + .theme-switch-track {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
}
.theme-switch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--transition);
  pointer-events: none;
}
.theme-switch input:checked + .theme-switch-track + .theme-switch-thumb {
  transform: translateX(20px);
}
/* Mobile nav theme row */
.mobile-nav-theme-row {
  width: 100%; max-width: 320px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
}
.mobile-nav-theme-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.93rem; font-weight: 600; color: var(--text-primary);
}

/* ----------  Loading shimmer ---------- */
.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 0%, rgba(255,255,255,0.06) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }

/* ============================================================
   TOOL ARTICLE — SEO content block below each tool
   ============================================================ */
.tool-article {
  max-width: 860px; margin: 0 auto;
  padding: 56px 24px 72px;
  color: var(--text-primary);
  font-size: 1rem; line-height: 1.75;
}
.tool-article h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800; color: var(--text-primary);
  margin: 2.4em 0 0.6em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--border-subtle);
}
.tool-article h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700; color: var(--text-primary);
  margin: 1.8em 0 0.5em;
}
.tool-article p { margin: 1em 0; color: var(--text-secondary); }
.tool-article strong { color: var(--text-primary); font-weight: 700; }
.tool-article ul, .tool-article ol {
  padding-left: 1.5em; margin: 0.8em 0;
  color: var(--text-secondary);
}
.tool-article li { margin-bottom: 0.4em; }
.tool-article pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.87rem; line-height: 1.6;
  margin: 1.2em 0;
}
.tool-article code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent-primary);
}
.tool-article pre code {
  background: none; border: none; padding: 0;
  color: var(--text-primary);
}
.tool-article .art-cta {
  display: flex; justify-content: center; margin: 2em 0;
}
.tool-article .art-cta a {
  display: inline-block;
  background: var(--grad-primary);
  color: #fff; text-decoration: none;
  padding: 14px 36px;
  border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(58,135,212,0.35);
  transition: opacity var(--transition), transform var(--transition);
}
.tool-article .art-cta a:hover { opacity: 0.9; transform: translateY(-2px); }
.tool-article .art-divider {
  border: none; border-top: 1px solid var(--border-subtle);
  margin: 2.5em 0;
}
