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

:root {
  --bg: #07070f;
  --card: #10101a;
  --border: #22223a;
  --text: #f0f0ff;
  --muted: #7777aa;
  --c1: #ff3cac;
  --c2: #784ba0;
  --c3: #2b86c5;
  --c4: #00f5a0;
  --c5: #f7971e;
  --c6: #ff6b6b;
  --radius: 16px;
  --nav-h: 68px;
}

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

html { scroll-behavior: smooth; }

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 0% 0%, rgba(255,60,172,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 100% 100%, rgba(43,134,197,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 50% 50%, rgba(0,245,160,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(7,7,15,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 100;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c1), var(--c3), var(--c4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--border);
}

.nav-mobile-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

@media(max-width:768px) {
  .nav-links { display: none; }
  .nav-mobile-btn { display: block; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: calc(var(--nav-h) + 60px) 20px 50px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 50px;
  border: 1px solid rgba(255,60,172,0.4);
  background: rgba(255,60,172,0.08);
  color: var(--c1);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeDown 0.6s ease both;
}

.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  animation: fadeDown 0.6s 0.1s ease both;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--c1), var(--c3), var(--c4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.15rem;
  margin-top: 16px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  animation: fadeDown 0.6s 0.2s ease both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 36px;
  animation: fadeDown 0.6s 0.3s ease both;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c4), var(--c3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-lbl {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

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

/* ===== SEARCH ===== */
.search-wrap {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto 44px;
  padding: 0 20px;
  animation: fadeDown 0.6s 0.35s ease both;
}

.search-wrap input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border 0.3s, box-shadow 0.3s;
}

.search-wrap input:focus {
  border-color: var(--c1);
  box-shadow: 0 0 0 4px rgba(255,60,172,0.1);
}

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

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

/* ===== CATEGORIES ===== */
.cats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 20px;
  margin-bottom: 44px;
  animation: fadeDown 0.6s 0.4s ease both;
}

.cat-btn {
  padding: 9px 20px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.25s;
}

.cat-btn:hover { border-color: var(--c1); color: var(--c1); background: rgba(255,60,172,0.08); }
.cat-btn.active { border-color: var(--c1); color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }

/* ===== TOOL GRID ===== */
.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ===== TOOL CARD ===== */
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: all 0.3s cubic-bezier(.175,.885,.32,1.275);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease both;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent, var(--c1));
  transform: scaleX(0);
  transition: transform 0.3s;
}

.tool-card:hover::before { transform: scaleX(1); }

.tool-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent, var(--c1));
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px var(--glow, rgba(255,60,172,0.15));
}

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

.card-icon { font-size: 2.2rem; margin-bottom: 12px; display: block; }

.card-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent, var(--c1));
  margin-bottom: 5px;
  font-weight: 600;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 7px;
}

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

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--accent, var(--c1));
  font-size: 0.85rem;
  font-weight: 600;
  transition: gap 0.2s;
}

.tool-card:hover .card-arrow { gap: 10px; }

/* ===== TOOL PAGE ===== */
.tool-page {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) 20px 80px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.breadcrumb a { color: var(--c1); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.tool-header { margin-bottom: 32px; }

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

.tool-header p { color: var(--muted); font-size: 1rem; line-height: 1.7; }

.tool-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 40px;
}

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border 0.3s, box-shadow 0.3s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--c1);
  box-shadow: 0 0 0 3px rgba(255,60,172,0.1);
}

.form-textarea { resize: vertical; min-height: 130px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }

.btn-primary {
  width: 100%;
  padding: 15px 28px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 25px rgba(255,60,172,0.35); }

.btn-secondary {
  padding: 10px 22px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: var(--c4); color: var(--c4); }

.result-area {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 18px;
  min-height: 60px;
  line-height: 1.7;
  word-break: break-all;
}

.result-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.stat-card .num {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--c4);
}

.stat-card .lbl {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}

.range-group { display: flex; align-items: center; gap: 14px; }
.range-group input[type=range] { flex: 1; accent-color: var(--c1); height: 6px; }
.range-val { color: var(--c1); font-weight: 700; min-width: 48px; text-align: right; }

.check-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; color: var(--muted); font-size: 0.95rem; }
.check-row input[type=checkbox] { accent-color: var(--c1); width: 16px; height: 16px; flex-shrink: 0; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-zone:hover { border-color: var(--c1); background: rgba(255,60,172,0.04); }
.upload-zone p { color: var(--muted); margin-top: 8px; font-size: 0.9rem; }
.upload-zone input { display: none; }

.preview-img { max-width: 100%; border-radius: 10px; margin-top: 14px; display: none; }

/* CALC */
.calc-display {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: right;
  margin-bottom: 14px;
}

.calc-expr { color: var(--muted); font-size: 0.9rem; min-height: 22px; }
.calc-screen { font-family: 'Syne', sans-serif; font-size: 2.2rem; font-weight: 800; word-break: break-all; }

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-key {
  padding: 17px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.15s;
}

.calc-key:hover { background: var(--border); }
.calc-key.op { color: var(--c1); }
.calc-key.eq { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border: none; font-weight: 700; }
.calc-key.eq:hover { opacity: 0.9; }

/* BMI */
.bmi-bar { background: var(--border); height: 10px; border-radius: 5px; overflow: hidden; margin: 14px 0; }
.bmi-fill { height: 100%; border-radius: 5px; transition: width 0.6s cubic-bezier(.175,.885,.32,1.275); }

/* COLOR */
.color-swatch { width: 100%; height: 90px; border-radius: 12px; border: 1.5px solid var(--border); margin-top: 14px; transition: background 0.3s; }
.hex-big { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; text-align: center; margin-top: 10px; letter-spacing: 2px; }

/* PW STRENGTH */
.pw-bar { height: 6px; border-radius: 3px; margin-top: 10px; transition: all 0.3s; }

/* FOOTER */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

footer a { color: var(--c1); text-decoration: none; }
footer .footer-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--c4);
  color: #000;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(.175,.885,.32,1.275);
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* SEO ARTICLE */
.seo-article {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.seo-article h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 12px;
}

.seo-article h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--c4);
}

.seo-article p { color: #bbbbd0; line-height: 1.8; margin-bottom: 14px; }

.seo-article ul { padding-left: 20px; color: #bbbbd0; line-height: 2; margin-bottom: 14px; }

.related-tools {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.related-tools h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 18px;
}

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

.related-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
}

.related-card:hover { border-color: var(--c1); transform: translateY(-2px); }
