/* ============================================================
   CAFTM PDF & Image Tools — design system
   Display: Sora · Body: Inter · Brand: indigo · Image: teal
   ============================================================ */
:root{
  --ink:#131a2b;        --muted:#5b6477;     --faint:#8a93a6;
  --line:#e7e9f2;       --bg:#f6f7fb;        --surface:#ffffff;
  --brand:#4f46e5;      --brand-700:#4338ca; --brand-50:#eef0ff;
  --img:#0d9488;        --img-50:#e6f6f4;
  --accent:#f97316;
  --ok:#16a34a;         --warn:#dc2626;
  --r-sm:10px; --r:16px; --r-lg:24px;
  --shadow:0 1px 2px rgba(19,26,43,.04), 0 8px 24px rgba(19,26,43,.06);
  --shadow-lg:0 24px 60px -20px rgba(67,56,202,.35);
  --font-display:'Sora',system-ui,sans-serif;
  --font-body:'Inter',system-ui,sans-serif;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; font-family:var(--font-body); color:var(--ink);
  background:var(--bg); line-height:1.55; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,.display{font-family:var(--font-display); letter-spacing:-.02em; line-height:1.1}
a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}
.container{width:100%; max-width:1140px; margin:0 auto; padding:0 20px}

/* ---------- Header ---------- */
.site-header{position:sticky; top:0; z-index:50; background:rgba(255,255,255,.85);
  backdrop-filter:saturate(160%) blur(10px); border-bottom:1px solid var(--line)}
.nav{display:flex; align-items:center; gap:28px; height:68px}
.brand{display:flex; align-items:center; gap:10px; font-family:var(--font-display);
  font-weight:700; font-size:18px; color:var(--ink)}
.brand .mark{width:34px; height:34px; flex:0 0 34px}
.brand b{background:linear-gradient(120deg,var(--brand),#7c6cff); -webkit-background-clip:text; background-clip:text; color:transparent}
.nav-links{display:flex; gap:6px; margin-left:auto; align-items:center}
.nav-links a{padding:8px 14px; border-radius:999px; color:var(--muted); font-weight:500; font-size:15px; transition:.18s}
.nav-links a:hover{color:var(--ink); background:var(--brand-50)}
.nav-links a.active{color:var(--brand-700); background:var(--brand-50)}
.nav-toggle{display:none; margin-left:auto; background:none; border:0; padding:8px; cursor:pointer}
.nav-toggle svg{width:26px;height:26px;stroke:var(--ink)}
@media(max-width:860px){
  .nav-toggle{display:inline-flex}
  .nav-links{position:absolute; top:68px; left:0; right:0; flex-direction:column; align-items:stretch;
    gap:2px; background:#fff; padding:12px 16px 18px; border-bottom:1px solid var(--line);
    box-shadow:var(--shadow); transform:translateY(-8px); opacity:0; pointer-events:none; transition:.2s}
  .nav-links.open{transform:none; opacity:1; pointer-events:auto}
  .nav-links a{padding:12px 14px; border-radius:12px}
}

/* ---------- Hero ---------- */
.hero{padding:64px 0 28px; text-align:center; position:relative; overflow:hidden}
.hero::before{content:""; position:absolute; inset:-40% 30% auto 30%; height:380px;
  background:radial-gradient(closest-side,rgba(99,102,241,.18),transparent 70%); z-index:0}
.hero .inner{position:relative; z-index:1}
.eyebrow{display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600;
  color:var(--brand-700); background:var(--brand-50); padding:6px 14px; border-radius:999px}
.eyebrow .dot{width:7px;height:7px;border-radius:50%;background:var(--ok)}
.hero h1{font-size:clamp(34px,5.4vw,56px); margin:18px auto 14px; max-width:14ch}
.hero h1 em{font-style:normal; background:linear-gradient(120deg,var(--brand),#8b5cf6); -webkit-background-clip:text; background-clip:text; color:transparent}
.hero p.lede{font-size:clamp(16px,2.2vw,19px); color:var(--muted); max-width:56ch; margin:0 auto 8px}
.trust{display:flex; gap:22px; justify-content:center; flex-wrap:wrap; margin-top:22px; color:var(--faint); font-size:14px; font-weight:500}
.trust span{display:inline-flex; align-items:center; gap:7px}
.trust svg{width:17px;height:17px;stroke:var(--ok)}

/* ---------- Tool grid ---------- */
.section{padding:40px 0}
.section-head{display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:22px}
.section-head h2{font-size:26px}
.section-head .tag{font-size:13px; font-weight:600; padding:5px 12px; border-radius:999px}
.tag.pdf{color:var(--brand-700); background:var(--brand-50)}
.tag.image{color:#0b7a70; background:var(--img-50)}
.grid{display:grid; grid-template-columns:repeat(4,1fr); gap:18px}
@media(max-width:980px){.grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:680px){.grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:420px){.grid{grid-template-columns:1fr}}

.tool-card{position:relative; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r); padding:22px 18px; transition:.2s; overflow:hidden; height:100%}
.tool-card:hover{transform:translateY(-4px); box-shadow:var(--shadow); border-color:transparent}
.tool-card .chip{width:46px; height:46px; border-radius:13px; display:grid; place-items:center; margin-bottom:14px}
.tool-card .chip svg{width:24px; height:24px; stroke-width:1.8}
.tool-card h3{font-size:16.5px; margin:0 0 4px}
.tool-card p{font-size:13.5px; color:var(--muted); margin:0}
.tool-card.disabled{opacity:.5; pointer-events:none}
/* category chip tints */
.chip.c-merge{background:#fdeaea;color:#dc2626}
.chip.c-split{background:#eaf4fd;color:#2563eb}
.chip.c-compress{background:#fff1e6;color:#ea580c}
.chip.c-image2pdf{background:#f0eafd;color:#7c3aed}
.chip.c-resize{background:#e6f6f4;color:#0d9488}
.chip.c-convert{background:#eaf7ee;color:#16a34a}

/* ---------- Buttons ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:9px; cursor:pointer;
  font-family:var(--font-display); font-weight:600; font-size:15px; border:0; border-radius:12px;
  padding:13px 22px; transition:.18s; line-height:1}
.btn svg{width:18px;height:18px}
.btn-primary{background:linear-gradient(120deg,var(--brand),#6d5efc); color:#fff; box-shadow:var(--shadow-lg)}
.btn-primary:hover{filter:brightness(1.05); transform:translateY(-1px)}
.btn-primary:disabled{opacity:.55; cursor:not-allowed; transform:none; filter:none}
.btn-ghost{background:#fff; color:var(--ink); border:1px solid var(--line)}
.btn-ghost:hover{border-color:var(--brand); color:var(--brand-700)}
.btn-sm{padding:8px 14px; font-size:13.5px; border-radius:10px}

/* ---------- Tool page ---------- */
.tool-hero{padding:34px 0 8px}
.tool-hero .crumb{font-size:13px;color:var(--faint)}
.tool-hero .crumb a:hover{color:var(--brand-700)}
.tool-hero h1{font-size:clamp(26px,4vw,38px); margin:10px 0 8px}
.tool-hero p{color:var(--muted); max-width:60ch}
.tool-hero .ico{width:54px;height:54px;border-radius:15px;display:grid;place-items:center;margin-bottom:6px}
.tool-hero .ico svg{width:28px;height:28px;stroke-width:1.8}

.panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:26px; box-shadow:var(--shadow); margin:18px 0 40px}

/* Dropzone — the signature element */
.dropzone{position:relative; border:2.5px dashed #c8cce0; border-radius:var(--r-lg);
  background:linear-gradient(180deg,#fbfbff,#f4f5fc); padding:48px 22px; text-align:center;
  cursor:pointer; transition:.22s}
.dropzone:hover{border-color:var(--brand); background:#f3f3ff}
.dropzone.drag{border-color:var(--brand); background:#eef0ff; box-shadow:inset 0 0 0 4px rgba(79,70,229,.08)}
.dropzone .ring{width:78px;height:78px;margin:0 auto 16px;border-radius:50%;
  background:radial-gradient(closest-side,#fff,#eef0ff); display:grid; place-items:center;
  box-shadow:0 10px 30px -10px rgba(79,70,229,.45); position:relative}
.dropzone .ring::after{content:""; position:absolute; inset:-7px; border-radius:50%;
  border:2px dashed rgba(79,70,229,.4); animation:spin 14s linear infinite}
.dropzone.drag .ring::after{animation-duration:3s; border-color:var(--brand)}
@keyframes spin{to{transform:rotate(360deg)}}
.dropzone .ring svg{width:34px;height:34px;stroke:var(--brand)}
.dropzone h3{font-size:19px;margin:0 0 4px}
.dropzone p{color:var(--muted);margin:0;font-size:14.5px}
.dropzone .formats{margin-top:12px;font-size:12.5px;color:var(--faint)}
@media(prefers-reduced-motion:reduce){.dropzone .ring::after{animation:none}}

/* File list / previews */
.filelist{display:flex; flex-direction:column; gap:10px; margin-top:18px}
.fileitem{display:flex; align-items:center; gap:14px; background:#fff; border:1px solid var(--line);
  border-radius:14px; padding:10px 12px}
.fileitem .thumb{width:46px;height:46px;border-radius:10px;object-fit:cover;background:#f1f2f8;flex:0 0 46px;display:grid;place-items:center;color:var(--faint)}
.fileitem .thumb svg{width:22px;height:22px}
.fileitem .meta{min-width:0;flex:1}
.fileitem .meta b{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fileitem .meta small{color:var(--faint);font-size:12.5px}
.fileitem .handle{cursor:grab;color:var(--faint);padding:4px}
.fileitem .remove{background:none;border:0;color:var(--faint);cursor:pointer;padding:6px;border-radius:8px}
.fileitem .remove:hover{color:var(--warn);background:#fdeaea}
.fileitem.dragging{opacity:.5}

/* Options row */
.opts{display:flex; flex-wrap:wrap; gap:18px; align-items:flex-end; margin-top:20px}
.field{display:flex; flex-direction:column; gap:6px}
.field label{font-size:13px; font-weight:600; color:var(--muted)}
.field input,.field select,.field textarea{font-family:var(--font-body); font-size:15px; padding:11px 13px;
  border:1px solid var(--line); border-radius:11px; background:#fff; min-width:140px; color:var(--ink)}
.field textarea{width:100%; line-height:1.5}
.field input[type=range]{padding:0; min-width:200px; accent-color:var(--brand)}
.field input[type=color]{padding:4px; min-width:60px; cursor:pointer}
.field input[type=checkbox]{min-width:0; width:18px; height:18px; accent-color:var(--brand); cursor:pointer}
.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid var(--brand-50); border-color:var(--brand)}
.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip-btn{padding:9px 14px; border:1px solid var(--line); border-radius:999px; background:#fff;
  font-size:13.5px; font-weight:600; color:var(--muted); cursor:pointer; transition:.15s}
.chip-btn:hover{border-color:var(--brand)}
.chip-btn.on{background:var(--brand); border-color:var(--brand); color:#fff}

.actionbar{display:flex; gap:12px; flex-wrap:wrap; margin-top:24px; align-items:center}
.sizehint{font-size:13.5px;color:var(--muted)}
.sizehint b{color:var(--ink)}

/* Progress */
.progress{height:10px; background:#eef0f6; border-radius:999px; overflow:hidden; margin-top:8px; display:none}
.progress.show{display:block}
.progress .bar{height:100%; width:0; background:linear-gradient(90deg,var(--brand),#7c6cff); transition:width .25s}
.processing{display:none; align-items:center; gap:12px; margin-top:18px; color:var(--muted); font-size:14.5px}
.processing.show{display:flex}
.spinner{width:22px;height:22px;border:3px solid var(--brand-50);border-top-color:var(--brand);border-radius:50%;animation:spin .8s linear infinite}

/* Result */
.result{display:none; margin-top:20px; padding:20px; border:1px solid #cdebd6; background:#f1fbf4; border-radius:16px}
.result.show{display:block}
.result h4{margin:0 0 6px; color:#15803d}
.result .stats{display:flex; gap:18px; flex-wrap:wrap; font-size:14px; color:var(--muted); margin:6px 0 14px}
.result .stats b{color:var(--ink)}

/* ---------- Toast ---------- */
.toast-wrap{position:fixed; right:18px; bottom:18px; z-index:200; display:flex; flex-direction:column; gap:10px}
.toast{display:flex; align-items:center; gap:11px; background:#fff; border:1px solid var(--line);
  border-left:4px solid var(--brand); border-radius:12px; padding:13px 16px; box-shadow:var(--shadow);
  min-width:240px; max-width:340px; font-size:14px; animation:slidein .25s ease}
.toast.ok{border-left-color:var(--ok)} .toast.err{border-left-color:var(--warn)}
.toast svg{width:20px;height:20px;flex:0 0 20px}
@keyframes slidein{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}

/* ---------- Content pages ---------- */
.prose{background:#fff;border:1px solid var(--line);border-radius:var(--r-lg);padding:34px;box-shadow:var(--shadow);margin:18px 0 44px}
.prose h1{font-size:32px;margin:0 0 8px}
.prose h2{font-size:21px;margin:28px 0 10px}
.prose p,.prose li{color:#384152;font-size:15.5px}
.prose ul{padding-left:20px}
.prose a{color:var(--brand-700);text-decoration:underline}

/* Steps strip on tool pages */
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:8px 0 44px}
@media(max-width:680px){.steps{grid-template-columns:1fr}}
.step{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px}
.step .n{font-family:var(--font-display);font-weight:700;color:var(--brand);font-size:15px}
.step h4{margin:6px 0 4px;font-size:16px}
.step p{margin:0;color:var(--muted);font-size:14px}

/* ---------- Footer ---------- */
.site-footer{background:#0f1424; color:#aeb6c9; margin-top:30px}
.site-footer .container{padding-top:46px; padding-bottom:30px}
.foot-grid{display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:30px}
@media(max-width:760px){.foot-grid{grid-template-columns:1fr}}
.site-footer .brand{color:#fff}
.site-footer .brand b{color:#fff;background:none;-webkit-text-fill-color:#fff}
.site-footer p{font-size:14px; max-width:42ch}
.site-footer h5{color:#fff; font-family:var(--font-display); font-size:14px; letter-spacing:.04em; text-transform:uppercase; margin:0 0 12px}
.site-footer ul{list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:9px}
.site-footer a{font-size:14px} .site-footer a:hover{color:#fff}
.foot-bottom{border-top:1px solid rgba(255,255,255,.08); margin-top:30px; padding-top:18px; font-size:13px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px}

/* utility */
.hidden{display:none!important}
.mt-0{margin-top:0}.text-c{text-align:center}
