/* =========================================================
   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;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--ink-2);
  padding: 0;
}
.quality-row input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) 50%, var(--border) 50%, var(--border) 100%);
  outline: none;
  cursor: pointer;
  pointer-events: auto;
}
/* Track styling for Firefox */
.quality-row input[type=range]::-moz-range-track {
  background: transparent;
  border: none;
  box-shadow: none;
}
/* Range styling */
.quality-row input[type=range]::-webkit-slider-runnable-track {
  background: transparent;
  height: 6px;
  border-radius: 3px;
}
.quality-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 4px rgba(26, 107, 60, 0.2);
  border: 2px solid #fff;
  transition: box-shadow 0.18s ease;
  margin-top: -5px;
}
.quality-row input[type=range]::-webkit-slider-thumb:hover {
  box-shadow: 0 4px 8px rgba(26, 107, 60, 0.3);
}
.quality-row input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(26, 107, 60, 0.2);
  transition: box-shadow 0.18s ease;
  margin-top: -5px;
}
.quality-row input[type=range]::-moz-range-thumb:hover {
  box-shadow: 0 4px 8px rgba(26, 107, 60, 0.3);
}
#qualityVal {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  min-width: 40px;
  text-align: right;
  color: var(--ink);
}

/* 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: 12px;
  margin-top: 16px;
  width: 100%;
}
.btn-convert {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(26, 107, 60, 0.12);
}
.btn-convert:hover { 
  background: #14532d;
  box-shadow: 0 4px 12px rgba(26, 107, 60, 0.2);
}
.btn-convert:active { transform: scale(0.98); }

.btn-clear {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-clear:hover { 
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* 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);
}
.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}
.footer-logo {
  font-family: var(--font-mono);
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.footer-logo span { color: var(--accent); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 3vw, 20px);
  margin-bottom: 20px;
}
.footer-nav a {
  font-size: clamp(12px, 2.5vw, 13px);
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--transition);
  padding: 4px 0;
}
.footer-nav a:hover { color: var(--ink); }
.footer-copy {
  font-size: clamp(11px, 2vw, 12px);
  color: var(--ink-3);
  line-height: 1.8;
  word-wrap: break-word;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  nav { padding: 0 16px; height: 56px; }
  .nav-links { gap: 12px; }
  .nav-links a:not(.btn-coffee) { display: none; }
  .btn-coffee { font-size: 12px; padding: 6px 12px; }
  
  .converter-box { padding: 20px 16px; margin-bottom: 32px; }
  .drop-zone { padding: 32px 16px; }
  .drop-primary { font-size: 15px; margin-bottom: 6px; }
  .drop-secondary { font-size: 13px; }
  
  .quality-row { gap: 10px; margin-bottom: 12px; }
  .action-row { gap: 10px; margin-top: 4px; }
  .btn-convert, .btn-clear {
    padding: 14px 16px;
    font-size: 14px;
    min-height: 44px;
  }
  
  .trust-strip { grid-template-columns: 1fr 1fr; gap: 16px; }
  .trust-item { padding: 16px; }
  .trust-item strong { font-size: 13px; }
  .trust-item p { font-size: 12px; }
  
  .how-section h2 { font-size: 20px; }
  .how-section p { font-size: 14px; }
  
  .coffee-card { padding: 28px 20px; }
  .coffee-card h3 { font-size: 18px; }
  .coffee-card p { font-size: 13px; }
  
  /* Footer mobile optimizations */
  .footer-inner { padding: 32px 16px; }
  .footer-logo { margin-bottom: 16px; font-size: 16px; }
  .footer-nav { gap: 10px; margin-bottom: 16px; }
  .footer-nav a { padding: 6px 4px; font-size: 12px; }
  .footer-copy { font-size: 11px; }
}

@media (max-width: 480px) {
  nav { padding: 0 12px; height: 52px; }
  .logo { font-size: 16px; }
  .nav-links { gap: 8px; }
  .btn-coffee { font-size: 11px; padding: 5px 10px; }
  
  main { padding: 0 12px 48px; }
  .converter-box { padding: 16px; margin-bottom: 24px; box-shadow: 0 1px 6px rgba(0,0,0,0.03); }
  .drop-zone { padding: 20px 12px; }
  .drop-primary { font-size: 14px; margin-bottom: 4px; }
  .drop-secondary { font-size: 12px; }
  .drop-hint { font-size: 11px; margin-top: 8px; }
  
  .quality-row { gap: 8px; margin-bottom: 10px; font-size: 12px; }
  .action-row { gap: 8px; margin-top: 2px; }
  .btn-convert, .btn-clear {
    padding: 12px 12px;
    font-size: 13px;
    min-height: 40px;
  }
  
  .trust-strip { grid-template-columns: 1fr; gap: 12px; padding: 0 12px 32px; }
  .trust-item { padding: 12px; }
  .trust-icon { font-size: 18px; margin-bottom: 6px; }
  .trust-item strong { font-size: 12px; margin-bottom: 4px; }
  .trust-item p { font-size: 11px; line-height: 1.5; }
  
  .hero { margin: 36px auto 0; padding: 0 12px 32px; }
  h1 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 12px; }
  .hero-sub { font-size: 14px; }
  .trust-badge { font-size: 11px; padding: 5px 12px; margin-bottom: 20px; }
  
  .how-section { padding: 0 12px 32px; }
  .how-section h2 { font-size: 18px; margin-bottom: 10px; }
  .how-section p { font-size: 13px; margin-bottom: 10px; }
  
  .code-proof { padding: 16px 12px; margin-top: 16px; }
  .code-proof-label { font-size: 11px; margin-bottom: 6px; }
  .code-proof code { font-size: 12px; }
  
  .coffee-section { padding: 0 12px 40px; }
  .coffee-card { padding: 20px 16px; }
  .coffee-emoji { font-size: 28px; margin-bottom: 10px; }
  .coffee-card h3 { font-size: 16px; margin-bottom: 8px; }
  .coffee-card p { font-size: 12px; margin-bottom: 10px; }
  
  /* Footer extra small optimization */
  footer { padding: 24px 0; }
  .footer-inner { padding: 24px 12px; }
  .footer-logo { font-size: 14px; margin-bottom: 12px; }
  .footer-nav { gap: 8px; margin-bottom: 12px; }
  .footer-nav a { font-size: 11px; }
  .footer-copy { font-size: 10px; }
}