/* ---------------------------------------------------------------------------
   MediaForge — base stylesheet
   Theming lives in the custom properties below; the rest of the file only
   references variables, so a redesign is mostly a palette swap.
--------------------------------------------------------------------------- */

:root {
  --accent: #5b5bd6;
  --accent-hover: #4a4ac4;
  --accent-soft: #eeeefc;
  --on-accent: #ffffff;

  --bg: #f7f7fb;
  --surface: #ffffff;
  --border: #e4e4ee;
  --text: #1c1c28;
  --text-muted: #62627a;
  --text-faint: #6c6c87; /* keep >=4.5:1 on --bg and --surface (WCAG AA) */

  --success: #1d9e5f;
  --danger: #d64545;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgb(20 20 40 / 0.04), 0 8px 24px rgb(20 20 40 / 0.06);
  --shadow-lg: 0 2px 4px rgb(20 20 40 / 0.05), 0 18px 50px -12px rgb(37 37 84 / 0.22);

  /* Premium accents: gradients read across fills/text, glows add depth, glass
     powers the translucent sticky header. All theme-swappable below. */
  --accent-2: #8b5cf6;              /* violet — gradient partner to --accent  */
  --grad-fill: linear-gradient(135deg, #6366f1, #7c3aed);  /* filled buttons/CTA — white text stays >=4.5:1 across both stops */
  --grad-text: linear-gradient(120deg, #5b5bd6, #8b5cf6 52%, #a855f7);  /* large headings only (>=24px) */
  --grad-brand: linear-gradient(140deg, #6366f1, #a855f7);
  --glow: 0 14px 34px -10px color-mix(in srgb, var(--accent) 55%, transparent);
  --glow-sm: 0 6px 18px -6px color-mix(in srgb, var(--accent) 55%, transparent);
  --ring: color-mix(in srgb, var(--accent) 20%, transparent);
  --surface-glass: rgb(255 255 255 / 0.72);
  --hero-glow-1: color-mix(in srgb, var(--accent) 20%, transparent);
  --hero-glow-2: color-mix(in srgb, #a855f7 16%, transparent);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7b7bf0;
    --accent-hover: #9292f5;
    --accent-soft: #26264a;
    --on-accent: #14142a; /* white on #7b7bf0 is only 3.54:1 — dark ink passes */

    --bg: #121218;
    --surface: #1c1c26;
    --border: #2e2e3e;
    --text: #ececf4;
    --text-muted: #a4a4bc;
    --text-faint: #9292ac; /* keep >=4.5:1 on --bg and --surface (WCAG AA) */

    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.35), 0 20px 55px -12px rgb(0 0 0 / 0.6);

    --accent-2: #a78bfa;
    --grad-fill: linear-gradient(135deg, #7c7cf2, #9d6bf5);  /* dark ink (--on-accent) on light violet */
    --grad-text: linear-gradient(120deg, #a5a5ff, #c4a5ff 52%, #e2a9ff);
    --grad-brand: linear-gradient(140deg, #8f8ff5, #c58bf7);
    --surface-glass: rgb(20 20 28 / 0.68);
    --hero-glow-1: color-mix(in srgb, var(--accent) 26%, transparent);
    --hero-glow-2: color-mix(in srgb, #a855f7 22%, transparent);
  }
}

* { box-sizing: border-box; }

/* Explicit display rules below would otherwise defeat the hidden attribute. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Translucent glass bar where supported — the blur + soft shadow give the menu
   real presence over the content scrolling beneath it. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(14px) saturate(1.6);
    backdrop-filter: blur(14px) saturate(1.6);
    border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 6%, transparent),
                0 8px 24px -18px rgb(20 20 40 / 0.5);
  }
}

/* While the mobile menu is open, lift the header (and the panel nested in it)
   above the fixed consent banner (z-index:20) so lower menu rows stay tappable. */
.site-header.nav-open { z-index: 30; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  /* The mark ships as artwork on its own dark ground, so it reads as an icon
     tile; the hairline keeps its edge defined against the light theme. */
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 45%, transparent));
  transition: transform 0.2s ease;
}

.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.05); }

.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-accent {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-nav { display: flex; align-items: center; gap: 6px; }

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--text); }

/* Hamburger — hidden on desktop, revealed at the mobile breakpoint. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--surface); }
.nav-toggle-icon { display: block; width: 22px; height: 22px; }

/* Menu bar: "Media tools" dropdown (CSS-only; opens on hover + focus-within) */

.nav-item { position: relative; }

.site-nav .nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  transition: color 0.15s, background-color 0.15s;
}

.site-nav .nav-link.secondary { color: var(--text-muted); font-weight: 500; }

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  outline: none;
}

.nav-has-menu > .nav-link::after {
  content: "\25BE"; /* ▾ */
  margin-left: 5px;
  font-size: 0.8em;
  color: var(--accent);
}

.nav-has-menu:hover > .nav-link::after,
.nav-has-menu:focus-within > .nav-link::after { color: var(--accent); }

/* Primary nav item: the Media tools dropdown is the main action in the bar,
   so it carries the accent while Tools / FAQ stay neutral. */
.site-nav .nav-primary { color: var(--accent); font-weight: 700; }

.site-nav .nav-primary:hover,
.site-nav .nav-primary:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 184px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 30;
}

/* Invisible bridge across the 6px gap between the trigger and the menu, so
   moving the pointer down to a menu item doesn't cross a dead zone that closes
   the menu (the bridge is a menu descendant, so :hover on .nav-has-menu holds). */
.nav-menu::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 8px;
}

.nav-has-menu:hover .nav-menu,
.nav-has-menu:focus-within .nav-menu { display: block; }

.site-nav .nav-menu-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}

.site-nav .nav-menu-link:hover,
.site-nav .nav-menu-link:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 76px 0 24px;
}

/* Signature moment: a soft aurora glow behind the headline. Blurred radial
   blobs (accent + violet) clipped to the hero read as a luminous wash. */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -150px;
  width: min(1100px, 132%);
  height: 560px;
  transform: translateX(-50%);
  background:
    radial-gradient(42% 60% at 50% 42%, var(--hero-glow-1), transparent 72%),
    radial-gradient(34% 52% at 73% 26%, var(--hero-glow-2), transparent 70%),
    radial-gradient(30% 46% at 26% 30%, var(--hero-glow-1), transparent 72%);
  filter: blur(16px);
  pointer-events: none;
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 15px 6px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.hero-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-fill);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 16px;
}

.hero-grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-actions .btn { min-width: 190px; }

.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin: 24px 0 0;
  padding: 0;
}

.hero-badges li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hero-badges svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

.section-cta { text-align: center; margin-top: 28px; }

/* Converter page compact header (convert.html) */
.page-head { text-align: center; padding: 44px 0 4px; }

.page-head h1 {
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

/* --- Converter card ------------------------------------------------------ */

.converter-section { padding: 32px 0 48px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.converter {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px;
}

.state { display: flex; flex-direction: column; gap: 18px; }

/* Tabs */

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(20 20 40 / 0.1);
}

/* Dropzone */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  color: var(--text-muted);
}

.dropzone:hover, .dropzone:focus-visible, .dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.dropzone-icon { width: 36px; height: 36px; color: var(--accent); }

.dropzone-title { font-weight: 600; color: var(--text); margin: 10px 0 2px; }

.dropzone-hint { margin: 0; }

.link-like { color: var(--accent); text-decoration: underline; }

.dropzone-limits { font-size: 0.82rem; color: var(--text-faint); margin: 12px 0 0; }

/* Selected-file chip */

.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
}

.file-chip-name {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-size { color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }

.file-chip-remove {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.file-chip-remove:hover { color: var(--danger); }

/* URL panel */

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.text-input, .select-input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.text-input:focus, .select-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.field-hint { font-size: 0.85rem; color: var(--text-muted); margin: 8px 0 0; }

/* Format picker */

.format-picker { border: 0; padding: 0; margin: 0; }

.format-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 10px;
}

.format-option { position: relative; display: block; cursor: pointer; }

.format-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.format-option-body {
  display: block;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s, background-color 0.15s;
}

.format-option input:checked + .format-option-body {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.format-option input:focus-visible + .format-option-body {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.format-option-title { display: block; font-weight: 700; }

.format-option-desc { display: block; font-size: 0.83rem; color: var(--text-muted); }

.bitrate-row { margin-top: 14px; }

/* Buttons */

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s, transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary {
  background: var(--accent); /* fallback for no-gradient engines */
  background-image: var(--grad-fill);
  color: var(--on-accent);
  box-shadow: var(--glow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
  filter: saturate(1.08);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.btn-convert { width: 100%; font-size: 1.05rem; }

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0;
}

.fine-print {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
  margin: 0;
}

/* Working state */

.working-title { font-weight: 700; font-size: 1.1rem; margin: 0; text-align: center; }

.progress {
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.working-detail { text-align: center; color: var(--text-muted); margin: 0; }

#cancel-btn { align-self: center; }

/* Done state */

#state-done { align-items: center; text-align: center; }

.done-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
  display: grid;
  place-items: center;
}

.done-icon svg { width: 28px; height: 28px; }

.done-title { font-weight: 700; font-size: 1.2rem; margin: 0; }

.done-file { margin: 0; color: var(--text-muted); word-break: break-all; }

.done-size { color: var(--text-faint); }

.demo-badge {
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 600;
}

.btn-download { min-width: 220px; }

.done-expiry { font-size: 0.85rem; color: var(--text-faint); margin: 0; }

/* Error state */

#state-error { align-items: center; text-align: center; }

.error-title { font-weight: 700; font-size: 1.15rem; color: var(--danger); margin: 0; }

.error-detail { color: var(--text-muted); margin: 0; }

/* --- Ad slot ------------------------------------------------------------- */

.ad-slot {
  max-width: 728px;
  margin: 36px auto 0;
  text-align: center;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.ad-placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  height: 90px;
}

/* Below-result slot: extra top margin so it reads as clearly separate from the
   real Download button above it (never mistakable for the download). */
.ad-slot-result { margin: 24px auto 0; }

/* Desktop side rails: fixed, flanking the centered content. Hidden by default;
   only shown at wide viewports (room beside the 960px container) AND when the
   ad plan enables them (the JS drops the [hidden] attribute). */
.ad-rail {
  display: none;
  position: fixed;
  top: 76px;        /* clear of the 60px sticky header — never slides under it */
  bottom: 16px;     /* bounded so a 600px rail can't overflow short viewports */
  width: 160px;
  overflow: hidden;
  z-index: 5;
  text-align: center;
}

.ad-rail-left { left: 12px; }
.ad-rail-right { right: 12px; }

.ad-placeholder-rail { height: 600px; }

/* Reveal only once the LAYOUT viewport (which excludes the scrollbar) has room
   beside the 960px container for a 160px rail + clearance, even with a ~17px
   classic scrollbar. 960 + 2*(12+160) = 1304; 1340 keeps a safe margin. */
@media (min-width: 1340px) {
  .ad-rail:not([hidden]) { display: block; }
}

/* Ad-free loyalty progress + daily-limit UI */

.ad-free-progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.free-remaining {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
  margin: 0;
}

.daily-limit-notice {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.dln-title { font-weight: 700; color: var(--danger); margin: 0 0 4px; }

.dln-detail { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* --- Consent banner ------------------------------------------------------ */

.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  z-index: 20; /* above the header (10) and side rails (5) */
}

.consent-inner { display: flex; flex-direction: column; gap: 14px; }

.consent-title { font-weight: 700; margin: 0 0 4px; }

.consent-text { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

.consent-manage { display: flex; flex-direction: column; gap: 8px; }

.consent-option { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }

.consent-option span { color: var(--text-faint); }

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.consent-actions .btn { padding: 9px 16px; font-size: 0.92rem; }

.footer-link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
}

.footer-link-btn:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 720px) {
  .consent-actions { justify-content: stretch; }
  .consent-actions .btn { flex: 1 1 auto; }
}

/* --- How it works -------------------------------------------------------- */

.how-it-works { padding: 40px 0; }

.how-it-works h2, .faq h2 { text-align: center; margin-bottom: 28px; }

.tools-section h2, .how-it-works h2, .faq h2 {
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.022em;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-fill);
  color: var(--on-accent);
  font-weight: 700;
  box-shadow: var(--glow-sm);
  margin-bottom: 14px;
}

.step h3 { font-size: 1.02rem; margin-bottom: 6px; }

.step p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* --- Tools grid (landing hub) -------------------------------------------- */

.tools-section { padding: 8px 0 40px; }

.tools-section h2 { text-align: center; margin-bottom: 28px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}

.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s ease, box-shadow 0.15s ease;
}

a.tool-card:hover, a.tool-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--glow);
  outline: none;
}

.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--grad-fill);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  box-shadow: var(--glow-sm);
}

/* The "coming soon" card stays quiet — soft accent tint, not the filled gradient. */
.tool-card.is-soon .tool-icon {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.tool-icon svg { width: 22px; height: 22px; }

.tool-card h3 { font-size: 1.05rem; margin: 0 0 6px; }

.tool-card p { margin: 0 0 14px; color: var(--text-muted); font-size: 0.92rem; }

.tool-cta { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

.tool-card.is-soon { opacity: 0.72; }

.tool-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

/* --- Landing hub sections (features / spotlight / closing CTA) ------------ */

/* Small uppercase accent label that sits above a section heading. */
.section-eyebrow {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.features { padding: 44px 0 8px; }

.features h2 {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.022em;
  margin-bottom: 32px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--grad-fill);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  box-shadow: var(--glow-sm);
}

.feature-icon svg { width: 24px; height: 24px; }

.feature h3 { font-size: 1.05rem; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* Featured-tool spotlight band */
.spotlight { padding: 40px 0 8px; }

.spotlight-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 10%, var(--surface)),
      var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 28px;
}

.spotlight-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--grad-fill);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  box-shadow: var(--glow-sm);
}

.spotlight-icon svg { width: 30px; height: 30px; }

.spotlight-body { flex: 1; min-width: 0; }
.spotlight-body h3 { font-size: 1.2rem; margin: 0 0 4px; }
.spotlight-body p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.spotlight-cta { flex-shrink: 0; }

.spotlight-note {
  text-align: center;
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Closing call-to-action band */
.cta-band { padding: 48px 0 60px; }

.cta-band-inner {
  position: relative;
  overflow: hidden;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 24px;
  background:
    radial-gradient(120% 140% at 50% -20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--surface);
}

.cta-band-inner h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.022em;
  margin: 0 0 8px;
}

.cta-band-inner p { margin: 0 auto 22px; color: var(--text-muted); max-width: 440px; }

.cta-band-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-band-actions .btn { min-width: 180px; }

/* Active nav item (aria-current) on the Tools / FAQ pages */
.site-nav .nav-link[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* In-content ad slot spacing on the Tools / FAQ pages */
.tools-section .ad-slot,
.faq .ad-slot { margin-top: 32px; }

@media (max-width: 620px) {
  .spotlight-card { flex-direction: column; align-items: flex-start; }
  .spotlight-cta { width: 100%; text-align: center; }
}

/* --- FAQ ------------------------------------------------------------------ */

.faq { padding: 24px 0 56px; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 18px;
  margin-bottom: 10px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.faq summary {
  font-weight: 600;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 1.2rem;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details p { margin: 0 0 16px; color: var(--text-muted); }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner p { margin: 0; }

/* wrap + row-gap: without these the four legal links sit on one unbreakable
   line and push the page wider than a 320px phone, which produces horizontal
   scroll and a "content wider than screen" mobile-usability failure. */
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.footer-inner a { color: var(--text-muted); text-decoration: none; }

.footer-inner a:hover { color: var(--text); text-decoration: underline; }

/* --- Legal pages ---------------------------------------------------------- */

.legal-page { padding: 48px 0 64px; }

.legal-page .container { max-width: 720px; }

.legal-page h1 { margin-bottom: 8px; }

.legal-updated { color: var(--text-faint); font-size: 0.88rem; margin-bottom: 32px; }

.legal-page h2 { font-size: 1.15rem; margin-top: 32px; }

.legal-page p, .legal-page li { color: var(--text-muted); }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .converter { padding: 20px; }
  .hero { padding-top: 36px; }
  .format-options { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }

  /* Mobile nav: no hover on touch, so the hamburger toggles the nav into a
     tap-to-open panel, and the "From URL / Upload a file" items render inline
     inside it (rather than as an absolute hover flyout). */
  .nav-toggle { display: inline-flex; }
  .header-inner { position: relative; }
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 200px;
    max-width: calc(100vw - 32px);
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav .secondary { display: block; }
  .site-nav a,
  .site-nav .nav-link { display: block; padding: 10px 12px; border-radius: 6px; font-size: 1rem; }
  .site-nav a:hover,
  .site-nav .nav-link:hover { background: var(--accent-soft); color: var(--accent); }

  .nav-item,
  .nav-has-menu { position: static; }
  .nav-has-menu > .nav-link::after { display: none; }
  .nav-menu {
    position: static;
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0 0 4px 10px;
    background: none;
    border: none;
    box-shadow: none;
  }
  .nav-menu::before { display: none; }
  .site-nav .nav-menu-link { padding: 8px 12px; font-size: 0.95rem; }
}

/* ---------------------------------------------------------------------------
   Ad-blocker gate (assets/js/adblock.js). Full-viewport in "block" mode so the
   converter behind it cannot be used; the .is-warn variant is a dismissible
   card that leaves the page working.
--------------------------------------------------------------------------- */

.adblock-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgb(20 20 40 / 0.55);
  backdrop-filter: blur(3px);
}

.adblock-gate[hidden] { display: none; }

.adblock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 30rem;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  align-items: center;
}

.adblock-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
}

.adblock-title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
  text-wrap: balance;
}

.adblock-body {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.adblock-note {
  margin: 0;
  font-size: .88rem;
  color: var(--text-faint);
  line-height: 1.5;
}

.adblock-gate .btn { margin-top: .35rem; }

.adblock-status {
  margin: 0;
  font-size: .88rem;
  color: var(--text-muted);
  min-height: 1.2em;
  line-height: 1.5;
}

.adblock-dismiss {
  background: none;
  border: 0;
  padding: .25rem;
  font: inherit;
  font-size: .88rem;
  color: var(--text-faint);
  text-decoration: underline;
  cursor: pointer;
}

.adblock-dismiss:hover { color: var(--text-muted); }

/* Warn mode: a corner card rather than a wall. */
.adblock-gate.is-warn {
  background: none;
  backdrop-filter: none;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

.adblock-gate.is-warn .adblock-card {
  pointer-events: auto;
  max-width: 22rem;
  padding: 1.35rem;
  text-align: left;
  align-items: flex-start;
}

.adblock-gate.is-warn .adblock-icon { width: 1.75rem; height: 1.75rem; }
.adblock-gate.is-warn .adblock-title { font-size: 1.05rem; }
.adblock-gate.is-warn .adblock-body { font-size: .92rem; }
.adblock-gate.is-warn .adblock-note { display: none; }

@media (prefers-reduced-motion: reduce) {
  .adblock-gate { backdrop-filter: none; }
}

/* Interstitial shown in place of the Download button (assets/js/monetization.js).
   Visually distinct from the button it precedes — it must never be mistakable
   for the download itself. */
.download-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem;
  margin: .5rem 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.download-gate[hidden] { display: none; }
.download-gate-text { margin: 0; font-weight: 600; color: var(--text); }
.download-gate-count { font-variant-numeric: tabular-nums; color: var(--accent); }
.download-gate-note { margin: 0; font-size: .85rem; color: var(--text-faint); }
.ad-slot-gate { display: block; }

/* Public live conversion counter (assets/js/livecount.js). A billboard-style
   banner under the hero: a giant gradient tally over a wide uppercase caption,
   advertising how much we've converted. The number animates as it climbs. */
.live-counter {
  margin: 2.75rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  color: var(--text-muted);
  text-align: center;
}
.live-counter-num {
  font-size: clamp(3.2rem, 11vw, 6.5rem);
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.live-counter-label {
  font-weight: 700;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Ad slot space reservation (Core Web Vitals / CLS).

   An ad frame arrives after first paint. Without a reserved box the page
   reflows the moment it lands — content jumps under the reader's cursor, and
   the layout shift is scored against Core Web Vitals. Reserving the exact
   creative height means the ad fills a hole that was always there.

   Heights match the units in monetization.js: 90 (728x90 leaderboard),
   50 (320x50 mobile), 250 (300x250 rectangle), 600 (160x600 rail). The extra
   ~22px on the banner/rectangle slots accounts for the "Advertisement" label.
-------------------------------------------------------------------------- */
.ad-slot[data-slot="below_converter"] { min-height: 112px; }
@media (max-width: 767px) {
  .ad-slot[data-slot="below_converter"] { min-height: 72px; }
}
.ad-slot[data-slot="below_download"],
.ad-slot[data-slot="download_gate"],
.ad-slot[data-slot="working"] { min-height: 272px; }
.ad-rail { min-height: 622px; }

/* A hidden slot must NOT reserve space — only reserve once it is shown. */
.ad-slot[hidden], .ad-rail[hidden] { min-height: 0; }


/* --------------------------------------------------------------------------
   Ad slot presentation: never look broken.

   - The "Advertisement" label appears ONLY after the frame's watchdog confirms
     a real creative (.ad-filled, set in monetization.js). An empty labeled box
     is exactly the broken look this replaces.
   - While an ad is loading, the placeholder is a quiet branded card — a soft
     panel with a faint wordmark — not "Ad space — 728×90".
   - On confirmed no-fill the whole slot is hidden by monetization.js, and the
     existing [hidden] rules collapse its reserved space.
-------------------------------------------------------------------------- */
.ad-slot .ad-label, .ad-rail .ad-label { display: none; }
.ad-slot.ad-filled .ad-label, .ad-rail.ad-filled .ad-label { display: block; }

.ad-placeholder {
  border: 1px solid var(--border);
  border-style: solid;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
}
.ad-placeholder::after {
  content: "MediaForge";
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  opacity: 0.18;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   House ads — first-party promo cards shown when no paid ad fills a slot
   (assets/js/monetization.js fallback chain). Styled as quiet product cards,
   labeled "From MediaForge": clearly ours, clearly not third-party. They adapt
   to the slot's shape: horizontal strip in banner slots, stacked card in the
   rails and rectangles.
-------------------------------------------------------------------------- */
.house-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 18px;
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 140%);
  text-decoration: none;
  text-align: center;
  transition: border-color .15s ease;
}
.house-ad:hover { border-color: var(--accent); }
.house-ad em {
  font-style: normal;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}
.house-ad strong { color: var(--text); font-size: 1rem; }
.house-ad span { color: var(--text-muted); font-size: 0.86rem; }

/* Wide banner slots: lay the card out as a strip. */
.ad-slot[data-slot="below_converter"] .house-ad {
  flex-direction: row;
  gap: 14px;
  min-height: 90px;
}
@media (max-width: 767px) {
  .ad-slot[data-slot="below_converter"] .house-ad { flex-direction: column; gap: 6px; }
}

/* House cards never render in the rails (paid-only surfaces); they live in the
   in-flow content slots only. */
.house-ad { max-width: 100%; }
.ad-house .ad-placeholder { display: none; }
.ad-house .ad-label { display: none; }
