/* =========================================================
   heicfree — css/style.css
   Aesthetic: industrial-minimal, monospace accents, dark trust signals
   ========================================================= */

:root {
  --ink:     #0d0d0d;
  --ink-2:   #3a3a3a;
  --ink-3:   #7a7a7a;
  --surface: #fafaf8;
  --surface-2: #f0efeb;
  --surface-3: #e8e7e2;
  --accent:  #1a6b3c;
  --accent-light: #e8f4ee;
  --accent-mid: #2d9e5f;
  --warn:    #b84a2c;
  --border:  #d8d7d2;
  --border-strong: #b0afa9;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --radius: 8px;
  --radius-lg: 14px;
  --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, 5vw);
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--ink); }

.btn-coffee {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink) !important;
  transition: background var(--transition), border-color var(--transition);
}
.btn-coffee:hover {
  background: var(--surface-2) !important;
  border-color: var(--ink-2) !important;
}

/* ── HERO ── */
.hero {
  max-width: 720px;
  margin: 64px auto 0;
  padding: 0 24px 56px;
  text-align: center;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid #b6dfc8;
  border-radius: 20px;
  padding: 6px 14px;
  margin-bottom: 28px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-mid);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 20px;
}
h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── MAIN ── */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── CONVERTER BOX ── */
.converter-box {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 48px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  color: var(--ink-3);
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent-mid);
  background: var(--accent-light);
  color: var(--accent);
}
.drop-icon { margin-bottom: 16px; }
.drop-primary {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.drop-secondary { font-size: 14px; color: var(--ink-3); margin-bottom: 10px; }
.file-label {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.drop-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 12px;
}

/* Quality row */
.quality-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-2);
}
.quality-row input[type=range] {
  flex: 1;
  accent-color: var(--accent);
}
#qualityVal {
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: 36px;
  text-align: right;
  font-weight: 500;
}

/* File queue */
.file-queue {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 13px;
}
.queue-item-name {
  flex: 1;
  font-family: var(--font-mono);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-item-size { color: var(--ink-3); font-size: 12px; }
.queue-item-remove {
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); font-size: 16px; line-height: 1;
  padding: 0 4px;
  transition: color var(--transition);
}
.queue-item-remove:hover { color: var(--warn); }

/* Action row */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn-convert {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px 20px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-convert:hover { background: #14532d; }
.btn-convert:active { transform: scale(0.99); }

.btn-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-clear:hover { border-color: var(--border-strong); color: var(--ink-2); }

/* Progress */
.progress-wrap { margin-top: 20px; }
.progress-bar-bg {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-mid);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
}

/* Results */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.results-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.btn-download-all {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-download-all:hover { background: #14532d; }

.results-list { display: flex; flex-direction: column; gap: 8px; }
.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--accent-light);
  border: 1px solid #b6dfc8;
  border-radius: var(--radius);
  font-size: 13px;
}
.result-item-name {
  flex: 1;
  font-family: var(--font-mono);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-size { color: var(--ink-3); font-size: 12px; }
.result-error {
  background: #fef2f0;
  border-color: #f5c2ba;
}
.result-error .result-item-name { color: var(--warn); }
.btn-download-single {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.btn-download-single:hover { background: #14532d; }

.btn-convert-more {
  margin-top: 16px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  width: 100%;
  transition: border-color var(--transition);
}
.btn-convert-more:hover { border-color: var(--accent); color: var(--accent); }

/* ── TRUST STRIP ── */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}
.trust-item {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.trust-icon { font-size: 22px; display: block; margin-bottom: 8px; }
.trust-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.trust-item p { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* ── HOW IT WORKS ── */
.how-section {
  margin-bottom: 56px;
}
.how-section h2,
.faq-section h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--ink);
}
.how-section p {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 14px;
  line-height: 1.75;
}

.code-proof {
  margin-top: 24px;
  background: #0d0d0d;
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
}
.code-proof-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #5a8f6a;
  margin-bottom: 8px;
}
.code-proof code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #e8e7e2;
  white-space: pre;
}

/* ── FAQ ── */
.faq-section { margin-bottom: 56px; }
details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
details:first-of-type { border-top: 1px solid var(--border); }
summary {
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  color: var(--ink-3);
  transition: transform var(--transition);
}
details[open] summary::after {
  content: '−';
}
details p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.75;
  margin-top: 12px;
  padding-right: 24px;
}

/* ── COFFEE ── */
.coffee-section {
  display: flex;
  justify-content: center;
  margin-bottom: 56px;
}
.coffee-card {
  text-align: center;
  max-width: 420px;
  padding: 40px 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.coffee-emoji { font-size: 36px; margin-bottom: 14px; }
.coffee-card h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.coffee-card p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 20px;
}
.btn-coffee-big {
  display: inline-block;
  background: #FFDD00;
  color: #0d0d0d;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity var(--transition);
}
.btn-coffee-big:hover { opacity: 0.85; }
.coffee-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 12px;
  margin-bottom: 0;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}
.footer-logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-align: center;
}
.footer-logo span { color: var(--accent); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  row-gap: 10px;
  max-width: 100%;
}
.footer-nav a {
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--transition);
  padding: 8px 12px;
  white-space: nowrap;
  display: inline-block;
  border-radius: 4px;
  transition: background-color var(--transition), color var(--transition);
}
.footer-nav a:hover { 
  color: var(--ink);
  background-color: rgba(26, 107, 60, 0.05);
}
.footer-copy {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.8;
  word-break: break-word;
  text-align: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .converter-box { padding: 20px 16px; }
  .nav-links a:not(.btn-coffee) { display: none; }
  .trust-strip { grid-template-columns: 1fr 1fr; }
  .action-row { flex-direction: column; }
  
  /* Footer mobile optimizations */
  .footer-inner { padding: 28px 16px; gap: 16px; }
  .footer-logo { font-size: 16px; }
  .footer-nav { gap: 10px; row-gap: 6px; }
  .footer-nav a { font-size: 12px; padding: 5px 6px; }
  .footer-copy { font-size: 11px; }
}

@media (max-width: 480px) {
  nav { padding: 0 16px; height: 56px; }
  .logo { font-size: 16px; }
  .btn-coffee { font-size: 12px; padding: 6px 12px; }
  
  /* Footer extra small optimization */
  footer { margin-top: 56px; }
  .footer-inner { padding: 20px 14px; gap: 14px; }
  .footer-logo { font-size: 14px; }
  .footer-nav { gap: 8px; row-gap: 5px; }
  .footer-nav a { font-size: 11px; padding: 4px 5px; }
  .footer-copy { font-size: 10px; }
}

@media (max-width: 360px) {
  .footer-inner { padding: 16px 12px; gap: 12px; }
  .footer-logo { font-size: 13px; }
  .footer-nav { gap: 6px; row-gap: 4px; }
  .footer-nav a { font-size: 10px; padding: 3px 4px; }
  .footer-copy { font-size: 9px; }
}