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

:root {
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --indigo-light: #a5b4fc;
  --slate-900: #0f172a;
  --slade-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--slate-50);
  color: var(--slate-700);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Nav */
.nav {
  background: var(--slate-900);
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo svg {
  width: 28px;
  height: 28px;
}

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

.nav-links a {
  color: var(--slate-300);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s;
}

.nav-links a:hover {
  color: white;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--slate-900) 0%, #1e1b4b 100%);
  color: white;
  padding: 64px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--slate-300);
  max-width: 650px;
  margin: 0 auto 32px;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .875rem;
  color: var(--slate-200);
}

.hero-badge svg {
  width: 18px;
  height: 18px;
}

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

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  color: var(--slate-600);
  text-align: center;
  margin-bottom: 32px;
  font-size: 1.05rem;
}

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

.tool-card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all .2s;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  border-color: var(--indigo);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.tool-card-icon.image { background: #dbeafe; color: #2563eb; }
.tool-card-icon.pdf { background: #fee2e2; color: #dc2626; }
.tool-card-icon.video { background: #fce7f3; color: #db2777; }
.tool-card-icon.audio { background: #fef3c7; color: #d97706; }
.tool-card-icon.archive { background: #e0e7ff; color: #4f46e5; }
.tool-card-icon.tools { background: #dcfce7; color: #16a34a; }

.tool-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--slate-900);
}

.tool-card p {
  font-size: .85rem;
  color: var(--slate-600);
  line-height: 1.4;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: white;
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--indigo);
  background: #eef2ff;
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  color: var(--slate-400);
}

.drop-zone h3 {
  font-size: 1.1rem;
  color: var(--slate-700);
  margin-bottom: 4px;
}

.drop-zone p {
  color: var(--slate-500);
  font-size: .875rem;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* File Info */
.file-info {
  display: none;
  background: var(--slate-100);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  align-items: center;
  justify-content: space-between;
}

.file-info.show {
  display: flex;
}

.file-info-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--slate-800);
  word-break: break-all;
}

.file-info-size {
  font-size: .8rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.file-info-remove {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px;
  line-height: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--indigo);
  color: white;
}

.btn-primary:hover {
  background: var(--indigo-dark);
}

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-success {
  background: var(--green);
  color: white;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}

/* Progress */
.progress-wrap {
  display: none;
  margin-top: 16px;
}

.progress-wrap.show {
  display: block;
}

.progress-bar {
  height: 8px;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--indigo-light));
  border-radius: 999px;
  width: 0;
  transition: width .3s ease;
}

.progress-text {
  font-size: .85rem;
  color: var(--slate-600);
  margin-top: 8px;
  text-align: center;
}

/* Error */
.error-msg {
  display: none;
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: .9rem;
  align-items: center;
  gap: 8px;
}

.error-msg.show {
  display: flex;
}

/* Tool Layout (tool pages) */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 32px;
}

.tool-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-900);
  margin: 24px 0 12px;
}

.tool-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--slate-900);
  margin: 20px 0 8px;
}

.tool-content p,
.tool-content li {
  color: var(--slate-600);
  margin-bottom: 8px;
  font-size: .95rem;
}

.tool-content ul {
  padding-left: 20px;
}

.tool-content a {
  color: var(--indigo);
  text-decoration: underline;
}

/* How it works */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0;
}

.how-step {
  text-align: center;
  padding: 24px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
}

.how-step-num {
  width: 40px;
  height: 40px;
  background: var(--indigo);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.how-step h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.how-step p {
  font-size: .875rem;
  color: var(--slate-600);
}

/* Related Tools */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.related-tools a {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--slate-700);
  font-size: .875rem;
  font-weight: 500;
  text-align: center;
  transition: all .2s;
}

.related-tools a:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

/* Footer */
.footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 32px 0;
  margin-top: auto;
  text-align: center;
  font-size: .85rem;
}

.footer a {
  color: var(--slate-300);
  text-decoration: none;
}

.footer a:hover {
  color: white;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 12px 0;
  font-size: .85rem;
  color: var(--slate-500);
  background: var(--slate-100);
}

.breadcrumbs a {
  color: var(--indigo);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--slate-400);
}

/* Format badges */
.format-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.format-badge {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--slate-700);
  font-family: monospace;
}

.format-badge.input {
  background: #eef2ff;
  border-color: var(--indigo-light);
  color: var(--indigo-dark);
}

.format-badge.output {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
}

/* Limit notice */
.limit-notice {
  font-size: .8rem;
  color: var(--slate-500);
  margin-top: 8px;
  text-align: center;
}

/* Mobile */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .tool-layout { grid-template-columns: 1fr; }
  .how-it-works { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--slate-900);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .section-title { font-size: 1.4rem; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
