/* ═══════════════════════════════════════════════════════════════════════════
   M4BConvert — Landing Page Styles
   Token system: shadcn-style neutral dark surface ("Mira" — dense,
   product-focused), with a single restrained accent reserved for focus
   rings and selection states. No gradients, no glow, no emoji.
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ── Tokens (shared with sub-style.css) ── */
:root {
  /* Surfaces — neutral charcoal scale, no tint */
  --bg-base:     #0a0a0b;
  --bg-app:      #0a0a0b;
  --bg-panel:    #131316;
  --bg-raised:   #1c1c1f;
  --bg-input:    #0e0e10;
  --bg-hover:    rgba(255,255,255,0.04);

  /* Borders */
  --border:       #27272a;
  --border-soft:  #1e1e21;
  --border-strong:#3f3f46;
  --border-focus: #6366f1;

  /* Text */
  --text:         #fafafa;
  --text-muted:   #a1a1aa;
  --text-dim:     #52525b;

  /* Primary action — near-white, dark-on-light text (shadcn neutral primary) */
  --primary:        #f4f4f5;
  --primary-hover:  #e4e4e7;
  --primary-ink:    #18181b;

  /* The one reserved accent hue — focus rings + selection only, never glow */
  --accent:       #818cf8;
  --accent-ring:  rgba(99,102,241,0.35);
  --accent-light: #a5b4fc;

  --success:   #34d399;
  --success-bg:rgba(52,211,153,0.10);
  --danger:    #f87171;
  --danger-bg: rgba(248,113,113,0.10);
  --warn:      #fbbf24;
  --warn-bg:   rgba(251,191,36,0.10);

  --radius:    7px;
  --radius-lg: 11px;
  --radius-xl: 16px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Fira Code', monospace;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* prevent any element from causing page-level horizontal scroll */
}
body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* clip instead of hidden — hidden creates a scroll container that breaks position:sticky on the header */
}

.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Site Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  height: 56px;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.site-logo span { color: var(--text-muted); font-weight: 500; }
.logo-mark { color: var(--text); flex-shrink: 0; }
.logo-mark rect { fill: currentColor; }

.menu-wrap { position: relative; }
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.menu-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-hover); }

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.55);
  padding: 0.4rem;
  z-index: 30;
}
.menu-category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 0.5rem 0.6rem;
}
.menu-item {
  display: block;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.menu-item:hover { background: var(--bg-hover); }

/* ── Main Layout ── */
.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4.5rem 1.5rem 4rem;
  gap: 4.5rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* ── Hero Section ── */
.hero { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; text-align: center; }

.hero-heading {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--text);
}
.hero-heading .accent {
  color: var(--text);
  position: relative;
}

.hero-sub {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 460px;
  line-height: 1.65;
}

/* Signature waveform graphic under the subhead */
.hero-waveform {
  display: block;
  width: min(310px, 80%);
  height: 38px;
  color: var(--text-dim);
  margin-top: 0.25rem;
}
.hero-waveform .wb {
  fill: currentColor;
  transform-origin: bottom center;
  animation: wave-rise 0.5s cubic-bezier(.2,.8,.2,1) backwards;
}
@keyframes wave-rise {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-waveform .wb { animation: none; }
}

/* ── Landing Drop Zone ── */
.landing-drop {
  width: 100%;
  max-width: 600px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.landing-drop.dragover,
.landing-drop:focus-within {
  border-color: var(--accent);
  border-style: solid;
  background: var(--bg-raised);
}

/* Default (pre-drop) state */
.drop-state { padding: 3rem 2rem; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }

.drop-icon-big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.drop-cta {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.drop-hint {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.browse-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: inherit;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.browse-btn:hover { text-decoration-color: var(--text); }

.drop-formats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

/* ── Detected (post-drop) state ── */
#drop-detected { padding: 1.75rem 1.5rem; gap: 1.5rem; }

.detected-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  width: 100%;
}

.detected-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--success);
}

.detected-name {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-file-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.change-file-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* Convert-to heading */
.convert-to-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  align-self: flex-start;
}

/* ── Conversion Cards ── */
.conversion-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.65rem;
  width: 100%;
}

.conv-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.conv-card:hover { border-color: var(--border-strong); background: var(--bg-raised); }

.conv-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.conv-card-to   { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.conv-card-name { font-size: 0.96rem; font-weight: 600; color: var(--text); }
.conv-card-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.conv-card-go   {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s, gap 0.15s;
}
.conv-card:hover .conv-card-go { color: var(--text); gap: 0.45rem; }

/* ── Tools Section ── */
.tools-section { width: 100%; }

.section-heading {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.tool-card:hover { border-color: var(--border-strong); background: var(--bg-raised); }

.tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.tool-info { flex: 1; min-width: 0; }
.tool-title { font-size: 0.9rem; font-weight: 600; }
.tool-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.4; }

.tool-arrow { display: flex; color: var(--text-dim); flex-shrink: 0; transition: color 0.15s, transform 0.15s; }
.tool-card:hover .tool-arrow { color: var(--text); transform: translateX(2px); }

/* ── Site Footer ── */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
  padding: 1.75rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--text); }

/* ── Toast notifications ── */
.toast-root {
  position: fixed;
  top: 4.5rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(360px, calc(100vw - 2.5rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.9rem;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}
.toast.toast-in  { opacity: 1; transform: translateY(0) scale(1); }
.toast.toast-out { opacity: 0; transform: translateY(-4px) scale(0.98); }

.toast-icon { flex-shrink: 0; margin-top: 0.1rem; color: var(--text-muted); }
.toast-warning  .toast-icon,
.toast-error    .toast-icon { color: var(--warn); }
.toast-success  .toast-icon { color: var(--success); }
.toast-transfer .toast-icon { color: var(--primary); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.toast-desc  { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; line-height: 1.45; }

.toast-action-row { margin-top: 0.55rem; }
.toast-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toast-action-btn:hover { background: var(--primary); color: #fff; }

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 4px;
  display: flex;
  transition: color 0.15s, background 0.15s;
}
.toast-close:hover { color: var(--text); background: var(--bg-hover); }

.toast-timer {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--border-strong);
  transform-origin: left;
  animation: toast-shrink linear forwards;
}
@keyframes toast-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .site-header { padding: 0 1.1rem; }
  .site-nav { display: none; }
  .landing-main { padding: 3rem 1.1rem 3rem; gap: 3.5rem; }
  .drop-state { padding: 2.25rem 1.25rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .toast-root { left: 1rem; right: 1rem; width: auto; top: 4.25rem; }
}
