/* ============================================================
   DocForge — Main Stylesheet
   Aesthetic: Industrial Editorial — deep charcoal, sharp amber
   accent, strong Syne headings, clean DM Sans body
   ============================================================ */

:root {
  --bg: #0e0e10;
  --surface: #17171a;
  --surface2: #1f1f24;
  --border: #2e2e35;
  --text: #e8e8ec;
  --muted: #8a8a96;
  --accent: #f5a623;
  --accent2: #ff6b35;
  --green: #3ecf8e;
  --red: #ff4d4f;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 4px 32px rgba(0,0,0,0.5);
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---- NAV ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14,14,16,0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}
.logo span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.btn-ghost {
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem !important;
  color: var(--text) !important;
  transition: border-color 0.2s, background 0.2s !important;
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(245,166,35,0.08); }

/* ---- HERO ---- */
.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  display: flex;
  align-items: center;
  gap: 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 75% 40%, rgba(245,166,35,0.07), transparent 70%);
  pointer-events: none;
}
.hero-content { flex: 1; min-width: 0; }
.badge {
  display: inline-block;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.3);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -2px;
  margin-bottom: 1.25rem;
}
.accent { color: var(--accent); }
.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent);
  color: #0e0e10;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  transition: filter 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
  display: inline-block;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--accent); background: rgba(245,166,35,0.06); }

/* floating cards */
.hero-art {
  flex-shrink: 0;
  width: 300px;
  height: 340px;
  position: relative;
  display: none;
}
@media(min-width: 900px) { .hero-art { display: block; } }
.floating-card {
  position: absolute;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: float 4s ease-in-out infinite;
}
.c1 { top: 10%; left: 5%;  animation-delay: 0s; }
.c2 { top: 30%; left: 40%; animation-delay: 0.6s; color: var(--accent); }
.c3 { top: 55%; left: 0%;  animation-delay: 1.2s; color: var(--green); }
.c4 { top: 70%; left: 45%; animation-delay: 1.8s; color: var(--accent2); }
.c5 { top: 5%;  left: 55%; animation-delay: 0.9s; }
@keyframes float {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}

/* ---- AD BANNER ---- */
.ad-banner {
  max-width: 1200px;
  margin: 0 auto 1rem;
  padding: 0 2rem;
}
.ad-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.ad-label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.ad-mid { margin-top: 3rem; margin-bottom: 3rem; }
.ad-sticky {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 2rem;
  text-align: center;
  z-index: 200;
}
.ad-close {
  position: absolute;
  top: 50%; right: 1rem;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---- TOOLS SECTION ---- */
.tools-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-header h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}
.section-header p { color: var(--muted); font-size: 1rem; }

/* tabs */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--surface);
  padding: 0.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.tab {
  flex: 1;
  min-width: 120px;
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface2); }
.tab.active {
  background: var(--accent);
  color: #0e0e10;
  font-weight: 700;
}

/* panels */
.tool-panel { display: none; }
.tool-panel.active { display: block; }
.panel-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

/* drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--surface2);
  margin-bottom: 1.5rem;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(245,166,35,0.05);
}
.dz-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.dz-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}
.dz-sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 1rem; }

.btn-upload {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1.25rem;
  border-radius: 7px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-upload:hover { border-color: var(--accent); background: rgba(245,166,35,0.08); }

/* file list */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}
.file-item:hover { border-color: var(--accent); }
.file-icon { font-size: 1.2rem; flex-shrink: 0; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font-size: 0.8rem; flex-shrink: 0; }
.file-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}
.file-remove:hover { color: var(--red); }
.file-item.sortable-ghost { opacity: 0.4; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 1rem; }

/* options box */
.options-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.opts-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.opts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.opt-group { display: flex; flex-direction: column; gap: 0.4rem; }
.opt-group label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.opt-group.full-width { grid-column: 1 / -1; }

select, input[type="number"], input[type="text"], input[type="range"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  width: 100%;
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
select { 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='%238a8a96' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
select:focus, input[type="number"]:focus, input[type="text"]:focus { border-color: var(--accent); }
input[type="color"] { height: 36px; padding: 2px 4px; border-radius: 6px; width: 60px; cursor: pointer; }
input[type="range"] { padding: 0.3rem 0; accent-color: var(--accent); }
.text-input { width: 100%; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }

/* format grid */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
}
.format-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
}
.format-card input { display: none; }
.format-card .format-icon { font-size: 1.6rem; }
.format-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(245,166,35,0.1);
  color: var(--accent);
}
.format-card:hover { border-color: var(--accent); }

/* convert button */
.btn-convert {
  width: 100%;
  background: var(--accent);
  color: #0e0e10;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  margin-bottom: 1rem;
}
.btn-convert:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-convert:disabled { opacity: 0.35; cursor: not-allowed; filter: none; transform: none; }

/* progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* result box */
.result-box {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}
.result-box.show { display: flex; }
.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(62,207,142,0.08);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.result-error {
  background: rgba(255,77,79,0.08);
  border-color: var(--red);
}
.result-name { font-weight: 500; font-size: 0.9rem; flex: 1; }
.btn-download {
  background: var(--green);
  color: #0e0e10;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 1.1rem;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s;
}
.btn-download:hover { filter: brightness(1.1); }

/* preview */
.preview-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.preview-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* split */
.split-info {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* tool note */
.tool-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(245,166,35,0.04);
  border-radius: 0 6px 6px 0;
}

/* ---- HOW SECTION ---- */
.how-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem;
}
.how-section .section-header { margin-bottom: 2.5rem; }
.how-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.how-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  transition: border-color 0.2s;
}
.how-card:hover { border-color: var(--accent); }
.how-num {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 0.75rem;
  letter-spacing: -2px;
}
.how-card h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.how-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.65; }

/* ---- FOOTER ---- */
.footer {
  padding: 3rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
@media(max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}
.footer-brand .logo { font-size: 1.3rem; display: block; margin-bottom: 0.75rem; }
.footer-brand p { color: var(--muted); font-size: 0.85rem; line-height: 1.65; max-width: 280px; }
.footer-links h4 {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.88rem; color: var(--muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---- RESPONSIVE ---- */
@media(max-width: 640px) {
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero h1 { font-size: 3rem; }
  .panel-inner { padding: 1.25rem; }
  .opts-grid { grid-template-columns: 1fr 1fr; }
  .tool-tabs { gap: 0.35rem; }
  .tab { font-size: 0.78rem; padding: 0.5rem 0.5rem; }
  .nav-links a:not(.btn-ghost) { display: none; }
}

/* ---- UTILITY ---- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
