/* ══════════════════════════════════════════════════════════════
   JUST FUCKING CONVERT IT  ·  Design system
   Warm minimalist · Restrained luxury · Daytime light
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg:           #F5F3EE;    /* warm linen */
  --bg-card:      #FDFCF9;    /* parchment white */
  --bg-white:     #FFFFFF;

  /* Typography */
  --ink:          #1B1917;    /* warm near-black, not pure */
  --ink-mid:      #56534D;    /* warm mid-grey */
  --ink-soft:     #7D7A75;    /* muted warm grey — readable, not washed out */

  /* Borders */
  --line:         #E4E2DB;    /* hairline warm */
  --line-mid:     #C4C1B8;    /* medium warm */

  /* Action */
  --cta:          #1B1917;

  /* Semantic */
  --ok:           #286146;
  --warn:         #7A5C00;
  --error:        #8A1E1E;

  /* Shadows — layered, warm-tinted, realistic */
  --shadow-card:
    0 0 0 1px rgba(27, 25, 23, .06),
    0 2px 4px  rgba(27, 25, 23, .04),
    0 10px 26px rgba(27, 25, 23, .07),
    0 28px 56px rgba(27, 25, 23, .05);
  --shadow-float:
    0 1px 3px  rgba(27, 25, 23, .06),
    0 6px 18px rgba(27, 25, 23, .09);

  /* Motion */
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --tf:     150ms;   /* fast transition */
  --tm:     260ms;   /* medium transition */
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ── Body — warm, sunlit room ────────────────────────────────── */
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 110% 50% at 50% -6%,
      rgba(255, 252, 236, .88) 0%, transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: "Space Mono", monospace;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 52px 16px 80px;
}

/* ── Shell ───────────────────────────────────────────────────── */
.shell {
  width: 100%;
  max-width: 860px;
  display: grid;
  justify-items: center;
  gap: 36px;
}

/* ── Wordmark ────────────────────────────────────────────────── */
h1 {
  margin: 6px 0 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(34px, 8vw, 82px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
  animation: reveal 0.5s var(--ease) both;
}

/* Hairline rule — a luxury micro-detail, like the serif at the base of fine type */
h1::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--ink-mid);
  margin: 18px auto 0;
  opacity: 0.35;
}

/* ── Mode tabs ───────────────────────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-tab {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  padding: 9px 20px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background  var(--tf) var(--ease),
    color       var(--tf) var(--ease),
    border-color var(--tf) var(--ease),
    box-shadow  var(--tf) var(--ease),
    transform   var(--tf) var(--ease);
}

.mode-tab:hover {
  border-color: var(--ink-mid);
  color: var(--ink-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-float);
}

.mode-tab.active {
  background: var(--cta);
  border-color: var(--cta);
  color: #fff;
  box-shadow:
    0 1px 3px rgba(27, 25, 23, .18),
    0 4px 12px rgba(27, 25, 23, .14);
}

/* ── Card ────────────────────────────────────────────────────── */
.card {
  width: 100%;
  /* Subtle ambient highlight on top edge — catches light like brushed metal */
  background:
    linear-gradient(170deg, rgba(255,255,255,.72) 0%, transparent 16%),
    var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 28px 28px 24px;
  display: grid;
  gap: 18px;
  animation: reveal 0.6s var(--ease) 0.06s both;
}

/* ── Card header ─────────────────────────────────────────────── */
.head-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.head-row h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.count-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: var(--bg);
}

/* ── Format row ──────────────────────────────────────────────── */
.format-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.format-label {
  font-size: 10px;
  font-family: "Space Mono", monospace;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.format-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.fmt-btn {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  padding: 7px 16px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background   var(--tf) var(--ease),
    color        var(--tf) var(--ease),
    border-color var(--tf) var(--ease);
}

.fmt-btn:hover {
  border-color: var(--ink-mid);
  color: var(--ink);
}

.fmt-btn.active {
  background: var(--cta);
  border-color: var(--cta);
  color: #fff;
}

.fmt-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Drop zone ───────────────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 1.5px dashed var(--line-mid);
  border-radius: 14px;
  min-height: 210px;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .65) 0%,
    rgba(255, 255, 255, .25) 100%);
  transition:
    border-color var(--tf) var(--ease),
    background   var(--tf) var(--ease),
    box-shadow   var(--tf) var(--ease);
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragging {
  border-color: var(--ink-mid);
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .88) 0%,
    rgba(255, 255, 255, .50) 100%);
  box-shadow: 0 0 0 4px rgba(27, 25, 23, .04);
  outline: none;
}

.drop-zone.dragging {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(27, 25, 23, .08);
}

/* ── Drop zone icon ─────────────────────────────────────────── */
.drop-icon {
  width: 32px;
  height: 32px;
  color: var(--ink-soft);
  justify-self: center;
  transition: color var(--tf) var(--ease), transform var(--tf) var(--ease);
  opacity: 0.55;
}

.drop-zone:hover .drop-icon,
.drop-zone.dragging .drop-icon {
  color: var(--ink-mid);
  opacity: 0.8;
  transform: translateY(-2px);
}

.folder-btn {
  margin-top: 4px;
  font-size: 10px;
  padding: 5px 14px;
  pointer-events: all;
  align-self: center;
  justify-self: center;
}

.drop-zone:hover .folder-btn {
  border-color: var(--ink-mid);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-main {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(18px, 3.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.drop-sub {
  margin: 0;
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
button,
.download-item a {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 10px 22px;
}

button {
  border: 1px solid transparent;
  background: var(--cta);
  color: #fff;
  cursor: pointer;
  transition:
    background  var(--tf) var(--ease),
    box-shadow  var(--tf) var(--ease),
    transform   var(--tf) var(--ease);
  box-shadow:
    0 1px 2px rgba(27, 25, 23, .14),
    0 3px 8px rgba(27, 25, 23, .10);
}

button:hover:not(:disabled) {
  background: #2E2C28;
  box-shadow:
    0 2px 6px rgba(27, 25, 23, .18),
    0 6px 20px rgba(27, 25, 23, .14);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(27, 25, 23, .12);
}

button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--ink-mid);
  border-color: var(--line-mid);
  box-shadow: none;
}

button.ghost:hover:not(:disabled) {
  background: transparent;
  border-color: var(--ink-mid);
  color: var(--ink);
  box-shadow: none;
  transform: translateY(-1px);
}

/* Clear is intentionally low-weight — should recede behind primary actions */
button.danger {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  font-size: 10px;
  padding: 10px 14px;
}

button.danger:hover:not(:disabled) {
  background: transparent;
  border-color: transparent;
  color: var(--ink-mid);
  box-shadow: none;
  transform: none;
}

#downloadZipBtn {
  background: var(--cta);
}

/* ── Progress bar ─────────────────────────────────────────────── */
.progress-wrap {
  display: grid;
  gap: 7px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 200ms var(--ease), max-height 200ms var(--ease);
  pointer-events: none;
}

.progress-wrap.active {
  opacity: 1;
  max-height: 60px;
}

.progress-bar-track {
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 200ms var(--ease);
}

.progress-label {
  font-size: 10px;
  color: var(--ink-soft);
  text-align: center;
  letter-spacing: 0.04em;
  min-height: 1em;
}

/* ── Status ──────────────────────────────────────────────────── */
.status {
  margin: 0;
  min-height: 1.4em;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.status.ok    { color: var(--ok);    }
.status.warn  { color: var(--warn);  }
.status.error { color: var(--error); }

/* ── File list ───────────────────────────────────────────────── */
.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 204px;
  overflow: auto;
  background: var(--bg-white);
  scrollbar-width: thin;
  scrollbar-color: var(--line-mid) transparent;
}

/* Hide the list container entirely when there are no files loaded */
.file-list:empty { display: none; }

.file-list li {
  padding: 9px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--line);
  transition: background var(--tf) var(--ease);
}

.file-list li:first-child { border-top: none; }

.file-list li:hover { background: rgba(27, 25, 23, .025); }

.file-list .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--ink);
}

.file-list .size {
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

/* ── Downloads ───────────────────────────────────────────────── */
.downloads-wrap {
  display: grid;
  gap: 12px;
}

.downloads-wrap.empty { display: none; }

.downloads-wrap h3 {
  margin: 0;
  text-align: center;
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.downloads {
  display: grid;
  gap: 6px;
}

.download-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: var(--bg-white);
  transition: box-shadow var(--tf) var(--ease);
}

.download-item:hover {
  box-shadow: var(--shadow-float);
}

.download-item .meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.download-item .meta strong,
.download-item .meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-item .meta strong {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.download-item .meta span {
  font-size: 10px;
  color: var(--ink-soft);
}

.download-item a {
  text-decoration: none;
  color: #fff;
  background: var(--cta);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  transition:
    background  var(--tf) var(--ease),
    box-shadow  var(--tf) var(--ease),
    transform   var(--tf) var(--ease);
  box-shadow: 0 1px 2px rgba(27,25,23,.12), 0 2px 6px rgba(27,25,23,.08);
}

.download-item a:hover {
  background: #2E2C28;
  box-shadow: var(--shadow-float);
  transform: translateY(-1px);
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Smart detection overlay ─────────────────────────────────── */
.smart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 25, 23, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
}

.smart-overlay.hidden { display: none; }

.smart-dialog {
  background:
    linear-gradient(170deg, rgba(255,255,255,.68) 0%, transparent 18%),
    var(--bg-card);
  border-radius: 18px;
  padding: 28px;
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-card);
  animation: reveal 180ms var(--ease) both;
}

.smart-header { margin-bottom: 20px; }

.smart-header h3 {
  margin: 0 0 6px;
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.smart-sub {
  margin: 0;
  font-size: 11px;
  color: var(--ink-soft);
}

.smart-groups {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.smart-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-white);
  transition: box-shadow var(--tf) var(--ease);
}

.smart-group:hover { box-shadow: var(--shadow-float); }

.smart-group-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.smart-group-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.smart-group-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.smart-group-exts {
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.smart-group-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.smart-group-arrow {
  font-size: 12px;
  color: var(--ink-soft);
  margin-right: 2px;
}

.smart-footer {
  display: flex;
  gap: 8px;
}

/* ── SEO content section ─────────────────────────────────────── */
.seo-section {
  width: 100%;
  max-width: 860px;
  justify-self: center;
  border-top: 1px solid var(--line);
  padding: 0 0 80px;
}

.seo-inner { padding-top: 52px; }

.seo-heading {
  font-family: "Syne", sans-serif;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--ink);
}

.seo-lead {
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-mid);
  max-width: 620px;
  margin: 0 0 44px;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.seo-col h3 {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  color: var(--ink);
}

.seo-col p {
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink-mid);
  margin: 0;
}

.seo-faq-title {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 22px;
  color: var(--ink);
}

.seo-faq {
  margin: 0;
  display: grid;
  gap: 22px;
}

.seo-faq dt {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 6px;
}

.seo-faq dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink-mid);
  padding-left: 14px;
  border-left: 1px solid var(--line-mid);
}

/* ── Site footer ─────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 52px;
}

.site-footer-label {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.site-footer-dot {
  color: var(--line-mid);
  font-size: 10px;
  user-select: none;
}

.site-footer a {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--tf) var(--ease);
}

.site-footer a:hover { color: var(--ink); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: 36px 12px 56px;
  }

  h1 {
    /* Tighter on mobile so it doesn't dominate above the fold */
    font-size: clamp(30px, 11vw, 52px);
  }

  .shell {
    gap: 20px;
  }

  .mode-tabs {
    gap: 5px;
  }

  .mode-tab {
    font-size: 10px;
    padding: 8px 14px;
  }

  .card {
    padding: 20px 16px 18px;
    gap: 14px;
    border-radius: 16px;
  }

  /* Hide the 'CONVERT TO:' label — context is obvious, saves a line */
  .format-label {
    display: none;
  }

  .count-tag {
    display: none;
  }

  .drop-zone {
    min-height: 130px;
    gap: 5px;
    border-radius: 12px;
  }

  .drop-main {
    font-size: clamp(16px, 5.5vw, 22px);
  }

  /* Convert button full-width on mobile — clear primary action */
  #convertBtn {
    width: 100%;
    justify-content: center;
  }

  #downloadZipBtn {
    width: 100%;
    justify-content: center;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Clear stays text-only and right-aligned on mobile */
  #clearBtn {
    align-self: center;
    width: auto;
  }

  .smart-dialog {
    padding: 22px 18px;
    border-radius: 14px;
  }
}
