/* ============================================
   Tokens
   ============================================ */
:root{
  --ink: #101828;
  --ink-soft: #4A5468;
  --ink-faint: #8A93A6;
  --blue: #2554F0;
  --blue-hover: #1B3FC9;
  --blue-tint: #EEF2FE;
  --blue-tint-solid: #E4EBFF;
  --green: #12805C;
  --green-tint: #E7F6EF;
  --good: #12805C;
  --surface: #F5F7FB;
  --border: #E3E7F0;
  --white: #FFFFFF;
  --radius: 8px;
  --max: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family:var(--font);
  color:var(--ink);
  background:var(--white);
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}
button{font-family:inherit;cursor:pointer;}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px;}

.wrap{max-width:var(--max);margin:0 auto;padding:0 24px;}

h1,h2,h3{margin:0 0 12px;font-weight:600;letter-spacing:-0.01em;}
h1{font-size:clamp(30px,4vw,44px);line-height:1.15;}
h2{font-size:26px;line-height:1.25;}
h3{font-size:17px;}
p{margin:0 0 16px;color:var(--ink-soft);}

/* ============================================
   Top accent bar
   ============================================ */
.accent-bar{
  height:3px;
  background:linear-gradient(90deg,#2554F0,#5B8DFF);
}

/* ============================================
   Header / Nav
   ============================================ */
header.site-header{
  border-bottom:1px solid var(--border);
  position:relative;
  z-index:40;
  background:var(--white);
}
.nav-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 24px;
  max-width:var(--max);
  margin:0 auto;
  gap:24px;
}
.brand{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  font-size:16px;
  white-space:nowrap;
}
.brand .mark{
  width:26px;height:26px;border-radius:7px;
  background:var(--blue);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.brand .mark svg{width:15px;height:15px;stroke:#fff;}

/* Small badge pills, e.g. "NEW" / "POPULAR" next to nav + card labels */
.badge{
  display:inline-block;
  font-size:10.5px;
  font-weight:700;
  letter-spacing:0.02em;
  padding:2px 6px;
  border-radius:20px;
  margin-left:7px;
  vertical-align:2px;
  line-height:1.4;
}
.badge.new{background:var(--green-tint);color:var(--green);}
.badge.popular{background:var(--blue-tint);color:var(--blue);}
.main-nav{
  display:flex;
  align-items:center;
  gap:4px;
  flex:1;
}
.nav-item{position:relative;}
.nav-trigger{
  background:none;
  border:none;
  padding:10px 14px;
  font-size:14.5px;
  font-weight:500;
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:6px;
  border-radius:6px;
}
.nav-trigger:hover{color:var(--blue);}
.nav-trigger.open{color:var(--blue);background:var(--blue-tint);}
.nav-trigger .chev{
  width:9px;height:9px;
  border-right:1.6px solid currentColor;
  border-bottom:1.6px solid currentColor;
  transform:rotate(45deg);
  margin-top:-3px;
  transition:transform .15s ease;
}
.nav-trigger.open .chev{transform:rotate(225deg);margin-top:3px;}

.mega{
  display:none;
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  background:var(--white);
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:0 12px 28px rgba(16,24,40,.09);
  min-width:230px;
  padding:6px;
}
.mega.open{display:block;}
.mega-group-label{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px 8px;
  font-weight:600;
  font-size:13.5px;
  color:var(--ink);
  border-bottom:1px solid var(--border);
  margin-bottom:4px;
}
.mega-group-label .ic{
  width:16px;height:16px;
  display:inline-flex;
  color:var(--ink-soft);
}
.mega-group-label .ic svg{width:16px;height:16px;}
.mega a{
  display:block;
  padding:9px 12px;
  border-radius:6px;
  font-size:14px;
  color:var(--ink-soft);
}
.mega a:hover{background:var(--blue-tint);color:var(--blue);}

.nav-cta{
  background:var(--blue);
  color:var(--white);
  padding:9px 16px;
  border-radius:7px;
  font-size:14px;
  font-weight:500;
  white-space:nowrap;
}
.nav-cta:hover{background:var(--blue-hover);}

/* ============================================
   Footer
   ============================================ */
footer.site-footer{
  border-top:1px solid var(--border);
  background:var(--surface);
  margin-top:80px;
}
.footer-grid{
  display:grid;
  grid-template-columns:1.4fr 1fr 1fr 1fr;
  gap:32px;
  padding:48px 24px 28px;
  max-width:var(--max);
  margin:0 auto;
}
.footer-grid h4{
  font-size:13px;
  color:var(--ink-faint);
  margin:0 0 12px;
  font-weight:600;
}
.footer-grid a{
  display:block;
  font-size:14px;
  color:var(--ink-soft);
  padding:5px 0;
}
.footer-grid a:hover{color:var(--blue);}
.footer-bottom{
  border-top:1px solid var(--border);
  padding:18px 24px;
  font-size:13px;
  color:var(--ink-faint);
  text-align:center;
}

/* ============================================
   Hero
   ============================================ */
.hero{
  padding:64px 24px 40px;
}
.hero-inner{
  max-width:var(--max);
  margin:0 auto;
  display:grid;
  grid-template-columns:1fr;
  gap:32px;
}
.hero p.lead{
  font-size:18px;
  max-width:560px;
}

/* One orchestrated entrance on load — headline, then copy, then the
   dropzone — rather than scattered scroll-triggered reveals. */
@keyframes rise-in{
  from{opacity:0;transform:translateY(14px);}
  to{opacity:1;transform:translateY(0);}
}
.hero h1, .hero p.lead, .hero .dropzone{
  animation:rise-in .55s cubic-bezier(.2,.7,.3,1) both;
}
.hero h1{animation-delay:0s;}
.hero p.lead{animation-delay:.08s;}
.hero .dropzone{animation-delay:.16s;}
@media (prefers-reduced-motion:reduce){
  .hero h1, .hero p.lead, .hero .dropzone{animation:none;}
}

/* Dropzone — the hero visual, since the product itself is the story */
.dropzone{
  border:1.6px dashed #C4CEEC;
  background:var(--blue-tint);
  border-radius:14px;
  padding:48px 24px;
  text-align:center;
  transition:border-color .15s ease, background .15s ease;
}
.dropzone.drag{
  border-color:var(--blue);
  background:#E4EBFF;
  transform:scale(1.008);
}
.dropzone{transition:border-color .15s ease, background .15s ease, transform .15s ease;}
.dropzone .dz-icon{
  width:52px;height:52px;
  margin:0 auto 16px;
  border-radius:12px;
  background:var(--white);
  border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  transition:transform .2s ease;
}
.dropzone:hover .dz-icon{transform:translateY(-2px);}
.dropzone.drag .dz-icon{transform:scale(1.1);}
.dropzone .dz-icon svg{width:24px;height:24px;stroke:var(--blue);}
.dropzone h3{margin-bottom:4px;}
.dropzone .dz-sub{font-size:13.5px;color:var(--ink-faint);margin-bottom:18px;}
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:var(--blue);
  color:var(--white);
  border:none;
  padding:11px 20px;
  border-radius:7px;
  font-size:14.5px;
  font-weight:500;
  transition:background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn:hover{background:var(--blue-hover);transform:translateY(-1px);box-shadow:0 6px 14px rgba(37,84,240,.22);}
.btn:active{transform:translateY(0);}
.btn.secondary{
  background:var(--white);
  color:var(--ink);
  border:1px solid var(--border);
  box-shadow:none;
}
.btn.secondary:hover{border-color:var(--blue);color:var(--blue);background:var(--white);}
.btn[disabled]{opacity:.6;cursor:not-allowed;transform:none !important;box-shadow:none !important;}
input[type="file"]{display:none;}

/* Spinner shown inside a button while a conversion is running */
.spinner{
  width:14px;height:14px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.4);
  border-top-color:#fff;
  animation:spin .7s linear infinite;
  display:inline-block;
}
.spinner.on-light{
  border-color:rgba(37,84,240,.18);
  border-top-color:var(--blue);
}
@keyframes spin{to{transform:rotate(360deg);}}
@media (prefers-reduced-motion:reduce){
  .spinner{animation-duration:1.4s;}
}

.convert-status{
  display:flex;
  align-items:center;
  gap:9px;
  margin-top:14px;
  font-size:13.5px;
  color:var(--ink-soft);
}

/* ============================================
   Steps
   ============================================ */
.steps{
  padding:56px 24px;
  background:var(--surface);
}
.steps-inner{
  max-width:var(--max);margin:0 auto;
}
.steps-list{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:28px;
  margin-top:28px;
}
.step{
  background:var(--white);
  border:1px solid var(--border);
  border-radius:10px;
  padding:22px;
}
.step .num{
  width:26px;height:26px;
  border-radius:50%;
  background:var(--blue);
  color:#fff;
  font-size:13px;
  font-weight:600;
  display:flex;align-items:center;justify-content:center;
  margin-bottom:14px;
}

/* ============================================
   Tool grid (homepage + /tools)
   ============================================ */
.tool-section{padding:56px 24px;}
.tool-section-inner{max-width:var(--max);margin:0 auto;}
.section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin-bottom:24px;
}
.section-head a{font-size:14px;color:var(--blue);font-weight:500;}
.tool-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  gap:16px;
}

/* Tool search bar (homepage) */
.tool-search-wrap{
  max-width:420px;
  margin:0 auto 28px;
  position:relative;
}
.tool-search-wrap svg{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  width:17px;
  height:17px;
  color:var(--ink-faint);
  pointer-events:none;
}
.tool-search{
  width:100%;
  padding:12px 14px 12px 40px;
  border:1.5px solid var(--border);
  border-radius:999px;
  font-size:14.5px;
  font-family:var(--font);
  color:var(--ink);
  background:var(--white);
  transition:border-color .15s ease, box-shadow .15s ease;
}
.tool-search:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px var(--blue-tint);
}
.no-results{
  display:none;
  text-align:center;
  color:var(--ink-faint);
  font-size:14.5px;
  padding:32px 0;
}
.no-results.show{display:block;}

/* Category filter pills */
.filter-pills{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:22px 0 8px;
  justify-content:center;
}
.pill{
  border:1px solid var(--border);
  background:var(--white);
  color:var(--ink-soft);
  padding:9px 16px;
  border-radius:999px;
  font-size:13.5px;
  font-weight:500;
  transition:background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}
.pill:hover{border-color:var(--blue);color:var(--blue);}
.pill.active{background:var(--blue);border-color:var(--blue);color:var(--white);}
.pill:active{transform:scale(.97);}

.filter-section{
  transition:opacity .2s ease;
}
.filter-section.fading{opacity:0;}
.filter-section[hidden]{display:none;}
.tool-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px;
  display:flex;
  gap:14px;
  align-items:flex-start;
  position:relative;
  background:var(--white);
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tool-card:hover{
  border-color:transparent;
  transform:translateY(-3px);
  box-shadow:0 10px 24px rgba(16,24,40,.08);
}
.tool-card .tc-ic{
  width:40px;height:40px;
  border-radius:9px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  transition:transform .16s ease;
}
.tool-card:hover .tc-ic{transform:scale(1.07);}
.tool-card .tc-ic svg{width:20px;height:20px;}
.tool-card.c-convert .tc-ic{background:var(--blue-tint);color:var(--blue);}
.tool-card.c-compress .tc-ic{background:var(--green-tint);color:var(--green);}

.tool-card .tc-body{flex:1;min-width:0;}
.tool-card h3{
  margin-bottom:2px;font-size:15px;
  display:flex;align-items:center;
}
.tool-card p{margin:0;font-size:13px;color:var(--ink-faint);}

.tc-arrow{
  position:absolute;
  top:18px;right:16px;
  width:16px;height:16px;
  color:var(--ink-faint);
  opacity:0;
  transform:translateX(-4px);
  transition:opacity .16s ease, transform .16s ease, color .16s ease;
}
.tool-card:hover .tc-arrow{opacity:1;transform:translateX(0);color:var(--blue);}

/* ============================================
   Tool page (single converter)
   ============================================ */
.tool-page-head{padding:44px 24px 8px;}
.tool-page-head .wrap{max-width:760px;margin:0 auto;}
.crumb{font-size:13px;color:var(--ink-faint);margin-bottom:14px;}
.crumb a{color:var(--ink-faint);}
.crumb a:hover{color:var(--blue);}

.tool-workbench{padding:20px 24px 60px;}
.tool-workbench .wrap{max-width:760px;margin:0 auto;}

.file-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px 14px;
  margin-top:14px;
  font-size:14px;
}
.file-row .meta{color:var(--ink-faint);font-size:13px;}
.file-row .remove{color:#B4271E;font-size:13px;}

.options-row{
  display:flex;
  gap:16px;
  align-items:center;
  flex-wrap:wrap;
  margin:18px 0;
  padding:16px;
  background:var(--surface);
  border-radius:8px;
}
.options-row label{font-size:13.5px;font-weight:500;color:var(--ink-soft);}

.options-col{
  margin:18px 0;
  padding:18px;
  background:var(--surface);
  border-radius:8px;
}
.format-label{
  display:block;
  font-size:13.5px;
  font-weight:500;
  color:var(--ink-soft);
  margin-bottom:12px;
}
.format-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(84px,1fr));
  gap:10px;
  margin-bottom:16px;
}
.format-btn{
  border:1.5px solid var(--border);
  background:var(--white);
  color:var(--ink);
  padding:14px 8px;
  border-radius:8px;
  font-size:13.5px;
  font-weight:600;
  letter-spacing:.02em;
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease, color .15s ease, transform .12s ease;
}
.format-btn:hover{border-color:var(--blue);color:var(--blue);}
.format-btn.active{background:var(--blue);border-color:var(--blue);color:var(--white);}
.format-btn:active{transform:scale(.96);}
.run-btn-wide{width:100%;justify-content:center;}
.run-btn-wide:disabled{opacity:.55;cursor:not-allowed;}
select, .range-wrap input[type="range"]{
  accent-color:var(--blue);
}
select{
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:14px;
  background:var(--white);
}
.range-wrap{display:flex;align-items:center;gap:10px;flex:1;min-width:200px;}
.range-wrap output{font-size:13.5px;color:var(--ink-soft);width:38px;}

.result-box{
  margin-top:20px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:18px;
  display:none;
  opacity:0;
  transform:translateY(6px) scale(.98);
  transition:opacity .25s ease, transform .25s ease;
}
.result-box.show{display:block;}
.result-box.show.in{opacity:1;transform:translateY(0) scale(1);}
@media (prefers-reduced-motion:reduce){
  .result-box{transition:none;}
}
.result-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.result-stats{font-size:13.5px;color:var(--ink-faint);}
.result-stats .saved{color:var(--good);font-weight:600;}

.faq{padding:12px 0 56px;}
.faq-item{border-bottom:1px solid var(--border);padding:18px 0;}
.faq-item h3{margin-bottom:6px;font-size:15.5px;}
.faq-item p{margin:0;font-size:14.5px;}

.about-copy{padding:8px 0 24px;font-size:15px;}

.file-chip{
  display:none;
  align-items:center;
  gap:10px;
  margin:16px 0 0;
  padding:10px 14px;
  background:var(--blue-tint);
  border:1px solid var(--blue-tint-solid);
  border-radius:8px;
  font-size:13.5px;
  color:var(--ink);
}
.file-chip.show{display:flex;}
.file-chip svg{width:16px;height:16px;color:var(--blue);flex-shrink:0;}
.file-chip .file-chip-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.note{
  font-size:13px;
  color:var(--ink-faint);
  background:var(--surface);
  border-radius:8px;
  padding:10px 12px;
  margin-top:14px;
}

/* ============================================
   Promo ticker (bottom ad bar)
   ============================================ */
body.has-promo{padding-bottom:50px;}
.promo-ticker{
  position:fixed;
  left:0;right:0;bottom:0;
  z-index:500;
  display:flex;
  align-items:center;
  height:50px;
  background:linear-gradient(90deg,#FF7A18,#FF3D77);
  box-shadow:0 -2px 24px rgba(255,61,119,.35);
  animation:promo-glow 2.2s ease-in-out infinite;
}
@keyframes promo-glow{
  0%,100%{box-shadow:0 -2px 18px rgba(255,61,119,.28);}
  50%{box-shadow:0 -2px 30px rgba(255,122,24,.55);}
}
.promo-badge{
  flex-shrink:0;
  margin-left:14px;
  padding:3px 9px;
  border-radius:5px;
  background:rgba(255,255,255,.22);
  border:1px solid rgba(255,255,255,.5);
  color:#fff;
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  animation:promo-blink 1.4s steps(1,end) infinite;
}
@keyframes promo-blink{
  0%,49%{opacity:1;}
  50%,100%{opacity:.35;}
}
.promo-link{
  flex:1;
  display:block;
  min-width:0;
  height:100%;
  overflow:hidden;
  text-decoration:none;
  cursor:pointer;
}
.promo-track{
  display:flex;
  align-items:center;
  height:100%;
  width:max-content;
  white-space:nowrap;
  animation:promo-scroll 16s linear infinite;
}
.promo-link:hover .promo-track{animation-play-state:paused;}
@keyframes promo-scroll{
  0%{transform:translateX(0);}
  100%{transform:translateX(-50%);}
}
.promo-text{
  padding:0 32px;
  font-size:14px;
  font-weight:500;
  color:#fff;
  letter-spacing:.01em;
}
.promo-text strong{font-weight:700;}
.promo-close{
  flex-shrink:0;
  width:32px;height:32px;
  margin:0 10px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  border:none;
  color:#fff;
  font-size:15px;
  line-height:1;
  cursor:pointer;
  transition:background .15s ease;
}
.promo-close:hover{background:rgba(255,255,255,.32);}
@media (prefers-reduced-motion:reduce){
  .promo-ticker, .promo-badge, .promo-track{animation:none !important;}
}
@media (max-width:600px){
  .promo-text{padding:0 20px;font-size:13px;}
  .promo-badge{margin-left:10px;}
}

/* ============================================
   Sidebar ad (right rail on tool pages)
   Only shown when there's genuinely empty space
   beside the centered 760px workbench column.
   ============================================ */
.side-ad{
  display:none;
  position:fixed;
  top:96px;
  right:28px;
  width:236px;
  z-index:200;
}
@media (min-width:1320px){
  .side-ad{display:block;}
}
.side-ad-close{
  position:absolute;
  top:8px;right:8px;
  width:22px;height:22px;
  border:none;
  border-radius:999px;
  background:var(--surface);
  color:var(--ink-faint);
  font-size:12px;
  line-height:1;
  cursor:pointer;
  z-index:2;
  transition:background .15s ease, color .15s ease;
}
.side-ad-close:hover{background:var(--border);color:var(--ink);}
.side-ad-link{
  display:block;
  background:var(--white);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px 16px 18px;
  text-decoration:none;
  color:var(--ink);
  box-shadow:0 8px 28px rgba(16,24,40,.08);
  animation:side-ad-float 3.2s ease-in-out infinite;
}
@keyframes side-ad-float{
  0%,100%{box-shadow:0 8px 28px rgba(16,24,40,.08);}
  50%{box-shadow:0 12px 34px rgba(255,61,119,.22);}
}
.side-ad-label{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:10.5px;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink-faint);
  margin-bottom:10px;
}
.side-ad-label .dot{
  width:6px;height:6px;
  border-radius:999px;
  background:#FF3D77;
  animation:promo-blink 1.4s steps(1,end) infinite;
}
.side-ad-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:42px;height:42px;
  border-radius:10px;
  background:linear-gradient(135deg,#FF7A18,#FF3D77);
  font-size:20px;
  margin-bottom:12px;
}
.side-ad-title{
  display:block;
  font-size:16px;
  font-weight:700;
  margin-bottom:6px;
}
.side-ad-desc{
  display:block;
  font-size:12.5px;
  line-height:1.5;
  color:var(--ink-soft);
  margin-bottom:14px;
}
.side-ad-cta{
  display:block;
  text-align:center;
  padding:9px 12px;
  border-radius:8px;
  background:linear-gradient(90deg,#FF7A18,#FF3D77);
  color:#fff;
  font-size:13.5px;
  font-weight:700;
  animation:side-ad-pulse 1.8s ease-in-out infinite;
}
@keyframes side-ad-pulse{
  0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255,61,119,.45);}
  50%{transform:scale(1.035);box-shadow:0 0 0 6px rgba(255,61,119,0);}
}
@media (prefers-reduced-motion:reduce){
  .side-ad-link, .side-ad-label .dot, .side-ad-cta{animation:none !important;}
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width:860px){
  .main-nav{display:none;}
  .steps-list{grid-template-columns:1fr;}
  .footer-grid{grid-template-columns:1fr 1fr;}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important;scroll-behavior:auto !important;}
}
