/* ============================================================
   ToolKit Pro — Global Design System
   Fonts: Syne (headings) + DM Sans (body)
   Theme: Dark, purple-accented, grid-lined atmosphere
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:       #0a0a0f;
  --surface:  #13131a;
  --surface2: #1c1c28;
  --border:   #2a2a3d;
  --accent:   #6c63ff;
  --accent2:  #ff6b6b;
  --accent3:  #43e97b;
  --accent4:  #f7971e;
  --text:     #e8e8f0;
  --muted:    #7a7a9a;

  --accent-glow:  rgba(108, 99, 255, 0.25);
  --accent2-glow: rgba(255, 107, 107, 0.2);
  --accent3-glow: rgba(67, 233, 123, 0.2);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);

  --nav-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Background System ─────────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(108,99,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,99,255,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #6c63ff, transparent 70%);
  top: -200px; left: -100px;
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #ff6b6b, transparent 70%);
  bottom: -150px; right: -100px;
  animation-delay: -7s;
}

.bg-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #43e97b, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -40px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.95); }
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ── Layout Wrapper ────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  animation: navFadeIn 0.6s var(--ease) both;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--border);
}

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

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-free {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent3);
  background: rgba(67, 233, 123, 0.12);
  border: 1px solid rgba(67, 233, 123, 0.25);
  padding: 6px 14px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease);
}

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

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
  animation: mobileMenuIn 0.25s var(--ease) both;
}

.nav-mobile.open { display: flex; }

@keyframes mobileMenuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-mobile .nav-link {
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: var(--radius);
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
  padding: calc(var(--nav-h) + 80px) 0 80px;
  text-align: center;
  overflow: hidden;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.2);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  animation: heroSlideUp 0.7s var(--ease) 0.1s both;
}

.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  animation: heroSlideUp 0.7s var(--ease) 0.2s both;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 50%, var(--accent4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
  animation: heroSlideUp 0.7s var(--ease) 0.3s both;
}

@keyframes heroSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Search Bar */
.hero-search {
  position: relative;
  max-width: 520px;
  margin: 0 auto 48px;
  animation: heroSlideUp 0.7s var(--ease) 0.4s both;
}

.hero-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.2s var(--ease);
}

.hero-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 20px 16px 50px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.hero-search-input::placeholder { color: var(--muted); }

.hero-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.hero-search-input:focus + .hero-search-icon,
.hero-search:focus-within .hero-search-icon { color: var(--accent); }

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
}

.search-results.visible { display: block; animation: fadeInDown 0.2s var(--ease) both; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface2); }

.search-result-icon {
  font-size: 1.3rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.search-result-info { flex: 1; }
.search-result-name { font-size: 0.9rem; font-weight: 500; }
.search-result-cat  { font-size: 0.75rem; color: var(--muted); }

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Stats Row */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  animation: heroSlideUp 0.7s var(--ease) 0.5s both;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  border-right: 1px solid var(--border);
}

.hero-stat:last-child { border-right: none; }

.hero-stat-icon { font-size: 1rem; }
.hero-stat strong { color: var(--text); font-weight: 600; }

/* ── Section Headers ───────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--muted);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Category Cards ────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 80px;
}

.category-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: cardFadeUp 0.6s var(--ease) both;
  text-decoration: none;
  display: block;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-color, var(--accent)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  border-radius: inherit;
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-color, var(--accent));
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px var(--card-color, var(--accent)), 0 0 40px rgba(108,99,255,0.15);
}

.category-card:hover::before { opacity: 0.05; }

.category-card:nth-child(1) { --card-color: var(--accent);  animation-delay: 0.1s; }
.category-card:nth-child(2) { --card-color: var(--accent2); animation-delay: 0.2s; }
.category-card:nth-child(3) { --card-color: var(--accent4); animation-delay: 0.3s; }

@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.category-icon {
  font-size: 2.8rem;
  margin-bottom: 20px;
  display: block;
  transition: transform 0.3s var(--ease-spring);
}

.category-card:hover .category-icon {
  transform: rotate(-3deg) scale(1.1);
}

.category-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.category-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--card-color, var(--accent));
  background: rgba(108,99,255,0.1);
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 12px;
}

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

.category-arrow {
  position: absolute;
  top: 28px; right: 28px;
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.category-card:hover .category-arrow {
  transform: translate(3px, -3px);
  color: var(--card-color, var(--accent));
}

/* ── Tool Cards Grid ───────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: cardFadeUp 0.5s var(--ease) both;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px var(--accent-glow);
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tool-icon {
  font-size: 2rem;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease-spring);
  flex-shrink: 0;
}

.tool-card:hover .tool-icon { transform: rotate(-3deg) scale(1.1); }

.tool-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}

.badge-new  { background: rgba(108,99,255,0.15); color: var(--accent); border: 1px solid rgba(108,99,255,0.25); }
.badge-free { background: rgba(67,233,123,0.12); color: var(--accent3); border: 1px solid rgba(67,233,123,0.2); }
.badge-hot  { background: rgba(255,107,107,0.12); color: var(--accent2); border: 1px solid rgba(255,107,107,0.2); }

.tool-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.tool-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-category-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.tool-arrow {
  font-size: 1rem;
  color: var(--muted);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.tool-card:hover .tool-arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

/* ── Sections ──────────────────────────────────────────────── */
.section {
  padding: 80px 0;
}

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(108,99,255,0.03), transparent);
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--text); }

/* ── Tool Page Layout ──────────────────────────────────────── */
.tool-page {
  padding: calc(var(--nav-h) + 48px) 0 80px;
}

.tool-page-header {
  margin-bottom: 40px;
}

.tool-page-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.tool-page-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 560px;
}

/* ── Upload Zone ───────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  background: var(--surface);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(108, 99, 255, 0.05);
  box-shadow: 0 0 30px var(--accent-glow);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  transition: transform 0.3s var(--ease-spring);
}

.upload-zone:hover .upload-icon { transform: scale(1.1) translateY(-4px); }

.upload-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Tool UI Components ────────────────────────────────────── */
.tool-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
}

.tool-box-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Slider */
.slider-wrap {
  margin-bottom: 20px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.slider-value {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  background: rgba(108,99,255,0.1);
  padding: 2px 10px;
  border-radius: 100px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform 0.15s var(--ease);
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Inputs */
.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field::placeholder { color: var(--muted); }

.input-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}

.input-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 1.2rem;
}

/* Select */
select.input-field {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a9a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  -webkit-appearance: none;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  user-select: none;
}

.checkbox-item:hover { border-color: var(--accent); }

.checkbox-item input[type="checkbox"] { display: none; }

.checkbox-item.checked {
  border-color: var(--accent);
  background: rgba(108,99,255,0.1);
  color: var(--accent);
}

.checkbox-custom {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  flex-shrink: 0;
}

.checkbox-item.checked .checkbox-custom {
  border-color: var(--accent);
  background: var(--accent);
}

.checkbox-custom::after {
  content: '✓';
  font-size: 0.65rem;
  color: white;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.checkbox-item.checked .checkbox-custom::after { opacity: 1; }

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
}

.toggle {
  width: 40px; height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  position: relative;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.toggle.on {
  background: rgba(108,99,255,0.2);
  border-color: var(--accent);
}

.toggle.on::after {
  transform: translateX(18px);
  background: var(--accent);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
}

.btn-primary:hover {
  background: #7b73ff;
  box-shadow: 0 8px 30px rgba(108,99,255,0.45);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.btn-success {
  background: var(--accent3);
  color: #0a1f0a;
  box-shadow: 0 4px 20px rgba(67,233,123,0.3);
}

.btn-danger {
  background: var(--accent2);
  color: white;
  box-shadow: 0 4px 20px rgba(255,107,107,0.3);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius);
}

.btn-full { width: 100%; }

/* Copy button flash */
.btn-copy.copied {
  background: var(--accent3) !important;
  color: #0a1f0a !important;
}

/* ── Result Box ────────────────────────────────────────────── */
.result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: none;
  animation: resultSlideIn 0.4s var(--ease) both;
}

.result-box.visible { display: block; }

@keyframes resultSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.result-stat {
  text-align: center;
  padding: 16px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.result-stat-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

.result-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Strength Meter ────────────────────────────────────────── */
.strength-meter {
  margin: 16px 0;
}

.strength-bar-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.strength-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease), background 0.5s var(--ease);
  width: 0%;
}

.strength-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}

/* ── Password Display ──────────────────────────────────────── */
.password-display {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--text);
  word-break: break-all;
  position: relative;
  margin-bottom: 12px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.password-text { flex: 1; }

/* ── Preview Area ──────────────────────────────────────────── */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.preview-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-panel-header {
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preview-panel img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #0a0a0f;
}

/* ── File List ─────────────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: cardFadeUp 0.3s var(--ease) both;
}

.file-item-icon { font-size: 1.4rem; flex-shrink: 0; }

.file-item-info { flex: 1; min-width: 0; }
.file-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item-size { font-size: 0.75rem; color: var(--muted); }

.file-item-remove {
  color: var(--muted);
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  flex-shrink: 0;
}

.file-item-remove:hover { color: var(--accent2); background: rgba(255,107,107,0.1); }

/* ── Word Counter Stats ────────────────────────────────────── */
.wc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.wc-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}

.wc-stat-num {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.wc-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Age Calculator ────────────────────────────────────────── */
.age-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.age-result-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.age-result-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.age-result-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-wrap {
  margin: 16px 0;
}

.progress-track {
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width 0.5s var(--ease);
  width: 0%;
}

/* ── Textarea ──────────────────────────────────────────────── */
textarea.input-field {
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
}

/* ── Related Tools ─────────────────────────────────────────── */
.related-section {
  padding: 60px 0;
  border-top: 1px solid var(--border);
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.footer-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.footer-link:hover { color: var(--accent); }

.footer-bottom {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-bottom span { color: var(--accent2); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-spring);
  position: relative;
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 1.1rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.modal-close:hover { background: var(--border); color: var(--text); }

/* ── Toast Notification ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s var(--ease-spring) both;
  max-width: 320px;
}

.toast.success { border-color: rgba(67,233,123,0.3); }
.toast.error   { border-color: rgba(255,107,107,0.3); }
.toast.info    { border-color: rgba(108,99,255,0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(108,99,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Category Hero ─────────────────────────────────────────── */
.cat-hero {
  padding: calc(var(--nav-h) + 60px) 0 60px;
  text-align: center;
}

.cat-hero-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 20px;
  animation: heroSlideUp 0.6s var(--ease) 0.1s both;
}

.cat-hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  animation: heroSlideUp 0.6s var(--ease) 0.2s both;
}

.cat-hero-desc {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
  animation: heroSlideUp 0.6s var(--ease) 0.3s both;
}

/* ── Stagger Delays ────────────────────────────────────────── */
.stagger > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger > *:nth-child(9)  { animation-delay: 0.45s; }

/* ── Utility ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--accent3); }
.text-danger  { color: var(--accent2); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }

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

/* ── Info Box ──────────────────────────────────────────────── */
.info-box {
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.info-box-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1199px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

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

@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  .nav-links, .nav-right { display: none; }
  .nav-hamburger { display: flex; }

  .category-grid { grid-template-columns: 1fr; }
  .tools-grid    { grid-template-columns: 1fr; }

  .hero { padding: calc(var(--nav-h) + 48px) 0 48px; }
  .hero-stats { gap: 0; }
  .hero-stat  { padding: 8px 14px; font-size: 0.8rem; }

  .tool-box { padding: 20px; }
  .upload-zone { padding: 40px 24px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .input-row { grid-template-columns: 1fr; }
  .input-sep { display: none; }

  .age-result-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-stats { flex-direction: column; align-items: center; }
  .hero-stat  { border-right: none; border-bottom: 1px solid var(--border); width: 100%; justify-content: center; }
  .hero-stat:last-child { border-bottom: none; }
  .wc-stats { grid-template-columns: repeat(2, 1fr); }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Touch device: disable hover transforms ────────────────── */
@media (hover: none) {
  .tool-card:hover,
  .category-card:hover { transform: none; }
  .tool-card:hover .tool-icon,
  .category-card:hover .category-icon { transform: none; }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Selection ─────────────────────────────────────────────── */
::selection { background: rgba(108,99,255,0.3); color: var(--text); }