/* === Reset & Base === */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans SC",sans-serif;
  background:#0b1120;color:#e2e8f0;line-height:1.6;min-height:100vh
}
a{color:#60a5fa;text-decoration:none}
a:hover{color:#93bbfd}

/* === Nav === */
.nav{
  background:#0f172a;border-bottom:1px solid #1e293b;
  padding:0 1.5rem;height:60px;display:flex;align-items:center;
  justify-content:space-between;position:sticky;top:0;z-index:100
}
.nav-logo{font-size:1.25rem;font-weight:700;color:#f1f5f9;display:flex;align-items:center;gap:.5rem}
.nav-logo span{color:#3b82f6}
.nav-links{display:flex;gap:1.5rem;list-style:none}
.nav-links a{color:#94a3b8;font-size:.875rem;transition:color .2s}
.nav-links a:hover{color:#e2e8f0}

/* === Hero === */
.hero{padding:4rem 1.5rem;text-align:center;max-width:800px;margin:0 auto}
.hero h1{font-size:2.5rem;font-weight:800;color:#f8fafc;margin-bottom:1rem;line-height:1.2}
.hero h1 span{color:#3b82f6}
.hero p{font-size:1.125rem;color:#94a3b8;max-width:600px;margin:0 auto 2rem}

/* === Search === */
.search-wrap{max-width:500px;margin:0 auto}
.search-input{
  width:100%;padding:.875rem 1.25rem;border-radius:12px;border:1px solid #334155;
  background:#1e293b;color:#e2e8f0;font-size:1rem;outline:none;transition:border-color .2s
}
.search-input:focus{border-color:#3b82f6}
.search-input::placeholder{color:#64748b}

/* === Tool Grid === */
.section{padding:2rem 1.5rem;max-width:1200px;margin:0 auto}
.section-title{font-size:1.5rem;font-weight:700;color:#f1f5f9;margin-bottom:1.5rem}
.tool-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.25rem}

.tool-card{
  background:#1e293b;border:1px solid #334155;border-radius:14px;
  padding:1.5rem;transition:transform .2s,box-shadow .2s,border-color .2s;
  cursor:pointer;display:block;color:inherit
}
.tool-card:hover{
  transform:translateY(-2px);box-shadow:0 8px 30px rgba(0,0,0,.4);
  border-color:#3b82f6
}
.tool-card-icon{font-size:2rem;margin-bottom:.75rem}
.tool-card h3{font-size:1.125rem;font-weight:600;color:#f1f5f9;margin-bottom:.375rem}
.tool-card p{font-size:.875rem;color:#94a3b8;line-height:1.5}

/* === Tool Page Layout === */
.tool-page{max-width:900px;margin:0 auto;padding:2rem 1.5rem}
.tool-page h1{font-size:1.75rem;font-weight:700;color:#f8fafc;margin-bottom:.5rem}
.tool-page .tool-desc{color:#94a3b8;margin-bottom:2rem}

.tool-workspace{background:#1e293b;border:1px solid #334155;border-radius:14px;padding:1.5rem}

textarea,.tool-input{
  width:100%;padding:.75rem 1rem;border-radius:8px;border:1px solid #334155;
  background:#0f172a;color:#e2e8f0;font-family:"JetBrains Mono","Fira Code",monospace;
  font-size:.875rem;resize:vertical;outline:none;transition:border-color .2s
}
textarea:focus,.tool-input:focus{border-color:#3b82f6}
textarea{min-height:200px}

.btn{
  display:inline-flex;align-items:center;gap:.5rem;padding:.625rem 1.25rem;
  border-radius:8px;font-size:.875rem;font-weight:600;border:none;cursor:pointer;
  transition:background .2s,transform .1s;font-family:inherit
}
.btn:active{transform:scale(.97)}
.btn-primary{background:#3b82f6;color:#fff}
.btn-primary:hover{background:#2563eb}
.btn-secondary{background:#334155;color:#e2e8f0}
.btn-secondary:hover{background:#475569}
.btn-group{display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0}

/* === Output area === */
.output-area{
  background:#0f172a;border:1px solid #334155;border-radius:8px;
  padding:1rem;margin-top:1rem;min-height:100px;max-height:400px;
  overflow:auto;font-family:"JetBrains Mono","Fira Code",monospace;font-size:.8125rem;
  white-space:pre-wrap;word-break:break-all
}

/* === Ads placeholder === */
.ad-slot{
  background:#1e293b;border:1px dashed #334155;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  min-height:90px;margin:2rem 0;color:#64748b;font-size:.75rem
}

/* === Footer === */
.footer{
  border-top:1px solid #1e293b;padding:2rem 1.5rem;text-align:center;
  color:#64748b;font-size:.8125rem;margin-top:4rem
}
.footer a{color:#94a3b8}
.footer a:hover{color:#e2e8f0}

/* === Misc === */
.copy-btn{
  cursor:pointer;padding:.25rem .625rem;border-radius:4px;background:#334155;
  color:#e2e8f0;border:none;font-size:.75rem;transition:background .2s
}
.copy-btn:hover{background:#475569}
.copy-btn.copied{background:#16a34a}

.breadcrumb{color:#64748b;font-size:.8125rem;margin-bottom:1rem}
.breadcrumb a{color:#94a3b8}
.breadcrumb a:hover{color:#e2e8f0}

.slider{width:100%;accent-color:#3b82f6;margin:.5rem 0}
label{font-size:.875rem;color:#94a3b8;display:block;margin-bottom:.25rem}
.checkbox-group{display:flex;gap:1rem;flex-wrap:wrap;margin:.5rem 0}
.checkbox-group label{display:flex;align-items:center;gap:.375rem;cursor:pointer;color:#e2e8f0;font-size:.8125rem}

.strength-bar{height:6px;border-radius:3px;background:#334155;margin-top:.5rem;overflow:hidden}
.strength-fill{height:100%;border-radius:3px;transition:width .3s,background .3s}

.file-drop{
  border:2px dashed #334155;border-radius:12px;padding:3rem 1.5rem;text-align:center;
  cursor:pointer;transition:border-color .2s,background .2s;margin-bottom:1rem
}
.file-drop:hover,.file-drop.dragover{border-color:#3b82f6;background:rgba(59,130,246,.05)}
.file-drop p{color:#94a3b8;font-size:.875rem}
.file-drop .icon{font-size:2.5rem;margin-bottom:.5rem}

.preview-img{max-width:100%;max-height:300px;border-radius:8px;margin:1rem 0}
.compare{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:1rem 0}
.compare-box{background:#0f172a;border-radius:8px;padding:1rem;text-align:center}
.compare-box .label{color:#64748b;font-size:.75rem;margin-bottom:.25rem}
.compare-box .size{font-size:1.5rem;font-weight:700;color:#f1f5f9}

/* === Responsive === */
@media(max-width:640px){
  .hero h1{font-size:1.75rem}
  .tool-grid{grid-template-columns:1fr}
  .nav-links{display:none}
  .compare{grid-template-columns:1fr}
}
