/* ==========================================
   TOOLFORGE – ORIGINAL DESIGN
   Palette: Deep slate bg, amber accent,
   teal highlight, white text.
   Font: Space Grotesk (headers) + Inter (body)
   ========================================== */

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

:root {
  --bg:         #0f1117;
  --bg2:        #181c27;
  --bg3:        #1f2435;
  --border:     #2a2f45;
  --text:       #e8eaf2;
  --text-muted: #7a8098;
  --amber:      #f5a623;
  --amber-dim:  #3a2c0d;
  --teal:       #00c9a7;
  --teal-dim:   #063028;
  --blue:       #4f8ef7;
  --blue-dim:   #0d1f45;
  --purple:     #a78bfa;
  --purple-dim: #1e1540;
  --green:      #34d399;
  --green-dim:  #0b2e20;
  --red:        #f87171;
  --red-dim:    #2e0f0f;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,17,23,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { font-size: 22px; }
.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo-accent { color: var(--amber); }

.header-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.header-nav a:hover {
  color: var(--text);
  background: var(--bg3);
}
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  margin-left: auto;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
.mobile-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}
.mobile-nav a:hover { color: var(--text); background: var(--bg3); }
.mobile-nav.open { display: flex; }

/* ── HERO ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 20px 72px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #1a2340 0%, var(--bg) 70%);
}
.hero-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}
.s1 { width: 500px; height: 500px; background: var(--amber); top: -200px; left: -100px; }
.s2 { width: 400px; height: 400px; background: var(--teal);  top: -100px; right: -100px; }
.s3 { width: 300px; height: 300px; background: var(--blue);  bottom: -50px; left: 50%; transform: translateX(-50%); }

.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 16px;
  letter-spacing: 0.3px;
  margin-bottom: 24px;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1.5px;
  color: #fff;
  margin-bottom: 18px;
}
.hero-accent {
  background: linear-gradient(90deg, var(--amber), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto 36px;
}
.hero-search {
  width: 100%;
  padding: 16px 52px 16px 20px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search::placeholder { color: var(--text-muted); }
.hero-search:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.12);
}
.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  pointer-events: none;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.stat span { font-size: 12px; color: var(--text-muted); }
.stat-div { width: 1px; height: 32px; background: var(--border); }

/* ── CATEGORY NAV ── */
.cat-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav .container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── CATEGORY COLOR TOKENS ── */
.cat-blue   { color: var(--blue);   background: var(--blue-dim);   border-color: rgba(79,142,247,0.25); }
.cat-amber  { color: var(--amber);  background: var(--amber-dim);  border-color: rgba(245,166,35,0.25); }
.cat-green  { color: var(--green);  background: var(--green-dim);  border-color: rgba(52,211,153,0.25); }
.cat-purple { color: var(--purple); background: var(--purple-dim); border-color: rgba(167,139,250,0.25); }
.cat-red    { color: var(--red);    background: var(--red-dim);    border-color: rgba(248,113,113,0.25); }
.cat-teal   { color: var(--teal);   background: var(--teal-dim);   border-color: rgba(0,201,167,0.25); }

.cat-pill:hover { filter: brightness(1.2); transform: translateY(-1px); }

/* ── MAIN / TOOL SECTIONS ── */
.main-content { padding: 60px 0 40px; }

.tool-section { margin-bottom: 64px; }
.tool-section:last-child { margin-bottom: 20px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.section-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cat-blue.section-icon   { background: var(--blue-dim); }
.cat-amber.section-icon  { background: var(--amber-dim); }
.cat-green.section-icon  { background: var(--green-dim); }
.cat-purple.section-icon { background: var(--purple-dim); }
.cat-red.section-icon    { background: var(--red-dim); }
.cat-teal.section-icon   { background: var(--teal-dim); }

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.4px;
}
.section-count { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* ── TOOL CARDS ── */
.tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  transition: opacity var(--transition);
  opacity: 0;
}
.cat-blue-card::before   { background: var(--blue); }
.cat-amber-card::before  { background: var(--amber); }
.cat-green-card::before  { background: var(--green); }
.cat-purple-card::before { background: var(--purple); }
.cat-red-card::before    { background: var(--red); }
.cat-teal-card::before   { background: var(--teal); }

.tool-card:hover {
  background: var(--bg3);
  border-color: #3a4060;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-card:hover::before { opacity: 1; }

.tool-emoji { font-size: 17px; flex-shrink: 0; }
.tool-name  { flex: 1; line-height: 1.3; }
.tool-arrow {
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition);
}
.tool-card:hover .tool-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── HIDDEN (search) ── */
.tool-card.hidden { display: none; }

/* ── WHY STRIP ── */
.why-strip {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 60px 20px;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}
.why-icon { font-size: 32px; margin-bottom: 12px; }
.why-item h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.why-item p { color: var(--text-muted); font-size: 14px; line-height: 1.7; }

/* ── FOOTER ── */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 56px 20px 0; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 60px;
  padding-bottom: 48px;
}
.footer-brand p { color: var(--text-muted); font-size: 13.5px; line-height: 1.7; margin-top: 14px; max-width: 280px; }
.footer-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-col h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 8px;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--amber); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  text-align: center;
}
.footer-bottom p { color: var(--text-muted); font-size: 13px; }

/* ── TOOL PAGE LAYOUT ── */
.tool-page { padding: 48px 0 80px; }
.tool-page-header { margin-bottom: 36px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--amber); }
.tool-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.tool-page-desc { color: var(--text-muted); font-size: 15px; margin-top: 8px; }

.tool-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--amber); }
textarea.form-control { resize: vertical; min-height: 160px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--amber);
  color: #111;
}
.btn-primary:hover { background: #f0b84a; transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #2a3050; }

.result-box {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--teal);
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 60px;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 16px;
}
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,0.3); }
.alert-error   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(248,113,113,0.3); }

/* ── FILE UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg3);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--amber);
  background: rgba(245,166,35,0.05);
}
.upload-zone-icon { font-size: 40px; margin-bottom: 12px; }
.upload-zone h3 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.upload-zone p { color: var(--text-muted); font-size: 13.5px; }
.upload-zone input[type=file] { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .header-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .hero { padding: 56px 20px 48px; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .footer-links { grid-template-columns: 1fr; }
  .hero-stats { gap: 16px; }
  .why-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 400px) {
  .tools-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
