/* ============================================================
   KhanxTools — Design System
   Palette: Deep Navy / Signal Blue / Sky Tint / Neutral Greys
   Type: -apple-system (San Francisco on Apple devices) + Inter fallback
   ============================================================ */

:root{
  --navy:      #0A1F44;
  --navy-2:    #0F2A5A;
  --blue:      #1352A2;
  --blue-2:    #0A66FF;
  --blue-bright:#2F8CFF;
  --cyan:      #38BDF8;
  --sky:       #EEF4FF;
  --sky-2:     #E2ECFF;
  --grey-050:  #F7F8FA;
  --grey-100:  #EEF1F5;
  --grey-200:  #E2E6EC;
  --grey-300:  #CBD2DC;
  --grey-500:  #8A93A3;
  --grey-700:  #4B5563;
  --ink:       #0C1220;
  --white:     #FFFFFF;
  --success:   #1BAA6B;
  --danger:    #E5484D;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(10,31,68,0.06), 0 1px 1px rgba(10,31,68,0.04);
  --shadow-md: 0 8px 24px rgba(10,31,68,0.08);
  --shadow-lg: 0 24px 60px rgba(10,31,68,0.14);

  --ease: cubic-bezier(.25,.8,.25,1);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; scroll-behavior:auto !important; }
}

body{
  margin:0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  line-height:1.55;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; }

.container{
  width:100%;
  max-width:1180px;
  margin:0 auto;
  padding:0 24px;
}

/* ---------- Typography ---------- */
h1,h2,h3,h4{
  font-weight:800;
  letter-spacing:-0.02em;
  margin:0 0 .5em;
  color: var(--navy);
}
h1{ font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing:-0.03em; line-height:1.05; }
h2{ font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height:1.15; }
h3{ font-size: 1.25rem; line-height:1.3; }
p{ margin:0 0 1em; color: var(--grey-700); }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-size:.8rem; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--blue-2);
  background:var(--sky); padding:6px 14px; border-radius:var(--radius-pill);
  margin-bottom:18px;
}
.lead{ font-size:1.2rem; color:var(--grey-700); max-width:640px; }
.section-head{ text-align:center; max-width:680px; margin:0 auto 56px; }
.section-head p{ margin:0 auto; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  font-size:1.05rem; font-weight:600;
  padding:18px 34px;
  border-radius: var(--radius-pill);
  border:none; cursor:pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  white-space:nowrap;
}
.btn:active{ transform: scale(.97); }
.btn-primary{
  background: linear-gradient(135deg, var(--blue-2), var(--blue-bright) 60%, var(--cyan));
  color:var(--white);
  box-shadow: 0 10px 30px rgba(10,102,255,0.35);
}
.btn-primary:hover{ box-shadow: 0 14px 38px rgba(10,102,255,0.45); transform: translateY(-2px); }
.btn-secondary{
  background: var(--white);
  color: var(--navy);
  border:1.5px solid var(--grey-300);
}
.btn-secondary:hover{ background: var(--grey-050); border-color:var(--grey-500); transform: translateY(-2px); }
.btn-dark{
  background: var(--navy);
  color: var(--white);
}
.btn-dark:hover{ background: var(--navy-2); transform: translateY(-2px); }
.btn-sm{ padding:12px 22px; font-size:.95rem; }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; transform:none !important; }

/* ---------- Nav ---------- */
.nav{
  position: sticky; top:0; z-index:1000;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(10,31,68,0.06);
}
.nav .container{ display:flex; align-items:center; justify-content:space-between; height:76px; }
.nav-logo{ display:flex; align-items:center; gap:8px; font-weight:800; font-size:1.15rem; color:var(--navy); }
.nav-logo img.brand-logo{ height:32px; width:auto; border-radius:0; display:block; }
.nav-links{ display:flex; align-items:center; gap:32px; }
.nav-links a{ font-weight:600; font-size:.98rem; color: var(--grey-700); transition:color .2s; }
.nav-links a:hover, .nav-links a.active{ color:var(--blue-2); }
.nav-cta{ display:flex; align-items:center; gap:14px; }
.nav-toggle{ display:none; background:none; border:none; cursor:pointer; padding:8px; }
.nav-toggle span{ display:block; width:24px; height:2.5px; background:var(--navy); margin:5px 0; border-radius:2px; }

.usage-pill{
  display:flex; align-items:center; gap:8px;
  font-size:.82rem; font-weight:700; color:var(--navy);
  background:var(--sky); border:1px solid var(--sky-2);
  padding:8px 14px; border-radius:var(--radius-pill);
}
.usage-pill .dots{ display:flex; gap:4px; }
.usage-pill .dot{ width:7px; height:7px; border-radius:50%; background:var(--grey-300); }
.usage-pill .dot.used{ background:var(--blue-2); }

/* ---------- Hero ---------- */
.hero{
  position:relative;
  padding: 96px 0 80px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--sky), transparent 60%);
  overflow:hidden;
  text-align:center;
}
.hero .container{ position:relative; z-index:2; }
.hero-cta-row{ display:flex; gap:16px; justify-content:center; flex-wrap:wrap; margin:34px 0 50px; }
.hero-note{ font-size:.9rem; color:var(--grey-500); }

/* ---------- Cards / Tools grid ---------- */
.grid{ display:grid; gap:24px; }
.grid-5{ grid-template-columns: repeat(5, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }

.tool-card{
  background:var(--white);
  border:1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding:30px 26px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  display:flex; flex-direction:column; height:100%;
}
.tool-card:hover{ transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color:transparent; }
.tool-icon{
  width:56px; height:56px; border-radius:16px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--blue-2), var(--cyan));
  color:#fff; margin-bottom:18px; flex-shrink:0;
}
.tool-icon svg{ width:26px; height:26px; }
.tool-card h3{ margin-bottom:8px; }
.tool-card p{ font-size:.95rem; flex:1; }
.tool-card .btn{ margin-top:16px; align-self:flex-start; }

/* ---------- How it works ---------- */
.steps{ display:grid; grid-template-columns:repeat(3,1fr); gap:32px; }
.step{ text-align:center; padding:0 12px; }
.step-num{
  width:52px; height:52px; border-radius:50%;
  background:var(--navy); color:#fff; font-weight:800; font-size:1.1rem;
  display:flex; align-items:center; justify-content:center; margin:0 auto 18px;
}

/* ---------- Pricing ---------- */
.pricing-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; align-items:stretch; }
.price-card{
  background:var(--white); border:1.5px solid var(--grey-200); border-radius:var(--radius-lg);
  padding:36px 30px; display:flex; flex-direction:column; position:relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.price-card:hover{ transform:translateY(-6px); box-shadow:var(--shadow-lg); }
.price-card.featured{ border-color:var(--blue-2); box-shadow:var(--shadow-lg); }
.price-badge{
  position:absolute; top:-14px; left:50%; transform:translateX(-50%);
  background: linear-gradient(135deg, var(--blue-2), var(--cyan));
  color:#fff; font-size:.78rem; font-weight:700; letter-spacing:.04em;
  padding:6px 16px; border-radius:var(--radius-pill);
}
.price-name{ font-weight:700; color:var(--grey-700); text-transform:uppercase; font-size:.85rem; letter-spacing:.06em; }
.price-amount{ font-size:2.6rem; font-weight:800; color:var(--navy); margin:10px 0 4px; }
.price-amount span{ font-size:1rem; font-weight:600; color:var(--grey-500); }
.price-sub{ font-size:.88rem; color:var(--grey-500); margin-bottom:22px; }
.price-features{ list-style:none; padding:0; margin:0 0 26px; flex:1; }
.price-features li{ display:flex; gap:10px; align-items:flex-start; padding:9px 0; font-size:.95rem; color:var(--grey-700); border-top:1px solid var(--grey-100); }
.price-features li:first-child{ border-top:none; }
.price-features li svg{ flex-shrink:0; margin-top:3px; color:var(--success); width:16px; height:16px; }

/* ---------- Blog ---------- */
.blog-card{
  background:#fff; border:1px solid var(--grey-200); border-radius:var(--radius-lg);
  overflow:hidden; display:flex; flex-direction:column; transition:transform .3s var(--ease), box-shadow .3s var(--ease);
}
.blog-card:hover{ transform:translateY(-6px); box-shadow:var(--shadow-lg); }
.blog-thumb{ height:170px; background:linear-gradient(135deg, var(--navy), var(--blue-2)); position:relative; overflow:hidden; }
.blog-thumb span{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:1.4rem; opacity:.9; }
.blog-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.post-banner{ width:100%; max-width:100%; border-radius:16px; margin:8px 0 28px; display:block; box-shadow:var(--shadow-lg); }
.post-content img{ max-width:100%; height:auto; border-radius:12px; display:block; margin:28px auto; }
.post-content figure{ margin:28px 0; }
.post-content figcaption{ text-align:center; font-size:.85rem; color:var(--grey-500); margin-top:10px; }
.blog-body{ padding:24px; flex:1; display:flex; flex-direction:column; }
.blog-tag{ font-size:.75rem; font-weight:700; color:var(--blue-2); text-transform:uppercase; letter-spacing:.06em; margin-bottom:10px; }
.blog-body h3{ flex:0; }
.blog-body p{ font-size:.93rem; flex:1; }
.blog-meta{ font-size:.82rem; color:var(--grey-500); margin-top:10px; }

/* ---------- FAQ ---------- */
.faq{ max-width:800px; margin:0 auto; }
.faq-item{ border-bottom:1px solid var(--grey-200); }
.faq-q{
  width:100%; text-align:left; background:none; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
  padding:22px 4px; font-size:1.05rem; font-weight:600; color:var(--navy);
}
.faq-q .plus{ font-size:1.6rem; font-weight:400; color:var(--blue-2); transition:transform .3s; flex-shrink:0; margin-left:16px; }
.faq-item.open .faq-q .plus{ transform:rotate(45deg); }
.faq-a{ max-height:0; overflow:hidden; transition:max-height .35s var(--ease); }
.faq-item.open .faq-a{ max-height:400px; }
.faq-a p{ padding:0 4px 22px; font-size:.97rem; }

/* ---------- Footer ---------- */
footer{ background:var(--navy); color:#cbd6ea; padding:64px 0 32px; margin-top:60px; }
.footer-grid{ display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:40px; margin-bottom:48px; }
.footer-logo{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:1.2rem; color:#fff; margin-bottom:14px; }
.footer-logo img{ height:30px; width:auto; border-radius:0; }
footer h4{ color:#fff; font-size:.85rem; text-transform:uppercase; letter-spacing:.06em; margin-bottom:18px; }
footer ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:12px; }
footer a{ color:#a9b8d4; font-size:.93rem; transition:color .2s; }
footer a:hover{ color:#fff; }
.footer-bottom{ border-top:1px solid rgba(255,255,255,.1); padding-top:24px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; font-size:.85rem; color:#8296bb; }

/* ---------- Sections ---------- */
section{ padding:96px 0; }
.section-tint{ background:var(--grey-050); }

/* ---------- Modal ---------- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,15,32,0.55); backdrop-filter:blur(6px);
  display:none; align-items:center; justify-content:center; z-index:2000; padding:20px;
}
.modal-overlay.show{ display:flex; }
.modal-box{
  background:#fff; border-radius:var(--radius-lg); max-width:460px; width:100%;
  padding:44px 36px; text-align:center; box-shadow:var(--shadow-lg);
  animation: modal-in .3s var(--ease);
}
@keyframes modal-in{ from{ opacity:0; transform:translateY(16px) scale(.98);} to{opacity:1; transform:translateY(0) scale(1);} }
.modal-icon{
  width:64px; height:64px; border-radius:50%; margin:0 auto 20px;
  background:linear-gradient(135deg, var(--blue-2), var(--cyan)); color:#fff;
  display:flex; align-items:center; justify-content:center;
}
.modal-box h3{ font-size:1.4rem; margin-bottom:10px; }
.modal-box p{ margin-bottom:26px; }
.modal-actions{ display:flex; flex-direction:column; gap:12px; }
.modal-close{ position:absolute; top:18px; right:20px; background:none; border:none; font-size:1.4rem; color:var(--grey-500); cursor:pointer; }
.modal-box{ position:relative; }

/* ---------- Tool page (upload UI) ---------- */
.tool-hero{ padding:56px 0 20px; text-align:center; }
.dropzone{
  border:2px dashed var(--grey-300); border-radius:var(--radius-lg);
  background:var(--sky); padding:56px 24px; text-align:center; cursor:pointer;
  transition:border-color .25s, background .25s;
}
.dropzone.dragover{ border-color:var(--blue-2); background:var(--sky-2); }
.dropzone svg{ width:48px; height:48px; color:var(--blue-2); margin:0 auto 16px; }
.dropzone h3{ margin-bottom:6px; }
.dropzone p{ margin-bottom:0; font-size:.9rem; }
.file-input{ display:none; }

.file-list{ list-style:none; padding:0; margin:24px 0; display:flex; flex-direction:column; gap:10px; }
.file-row{
  display:flex; align-items:center; gap:14px;
  background:#fff; border:1px solid var(--grey-200); border-radius:var(--radius-md);
  padding:14px 18px;
}
.file-row .thumb{
  width:42px; height:52px; border-radius:6px; background:var(--grey-100); flex-shrink:0;
  display:flex; align-items:center; justify-content:center; overflow:hidden; border:1px solid var(--grey-200);
}
.file-row .thumb img{ width:100%; height:100%; object-fit:cover; }
.file-row .info{ flex:1; min-width:0; }
.file-row .name{ font-weight:600; font-size:.95rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-row .size{ font-size:.8rem; color:var(--grey-500); }
.file-row .actions{ display:flex; gap:6px; flex-shrink:0; }
.icon-btn{
  width:34px; height:34px; border-radius:50%; border:1px solid var(--grey-200); background:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--grey-700);
  transition:background .2s, color .2s;
}
.icon-btn:hover{ background:var(--grey-100); }
.icon-btn.danger:hover{ background:#FDECEC; color:var(--danger); }

.progress-wrap{ margin:20px 0; }
.progress-bar{ height:8px; background:var(--grey-200); border-radius:var(--radius-pill); overflow:hidden; }
.progress-fill{ height:100%; width:0%; background:linear-gradient(90deg, var(--blue-2), var(--cyan)); transition:width .3s var(--ease); }
.progress-label{ font-size:.85rem; color:var(--grey-500); margin-top:8px; }

.result-box{
  background:var(--sky); border:1px solid var(--sky-2); border-radius:var(--radius-lg);
  padding:32px; text-align:center; margin-top:24px;
}
.result-box .check{
  width:56px; height:56px; border-radius:50%; background:var(--success); color:#fff;
  display:flex; align-items:center; justify-content:center; margin:0 auto 16px;
}
.options-row{ display:flex; gap:14px; flex-wrap:wrap; justify-content:center; margin:22px 0; }
.option-chip{
  border:1.5px solid var(--grey-300); border-radius:var(--radius-pill); padding:10px 20px;
  font-weight:600; font-size:.92rem; cursor:pointer; background:#fff; transition:all .2s;
}
.option-chip.active{ border-color:var(--blue-2); color:var(--blue-2); background:var(--sky); }

.workarea{ max-width:760px; margin:0 auto; }
.center{ text-align:center; }
.mt-24{ margin-top:24px; } .mt-32{ margin-top:32px; } .mb-0{ margin-bottom:0; }
.hidden{ display:none !important; }

/* thumbnail grid for organize tool */
.thumb-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(140px,1fr)); gap:16px; margin:24px 0; }
.thumb-card{
  border:1.5px solid var(--grey-200); border-radius:var(--radius-md); padding:10px; background:#fff;
  text-align:center; cursor:grab; transition:border-color .2s, opacity .2s;
}
.thumb-card.dragging{ opacity:.4; }
.thumb-card canvas{ width:100%; border-radius:4px; border:1px solid var(--grey-100); margin-bottom:8px; }
.thumb-card .page-num{ font-size:.8rem; font-weight:700; color:var(--grey-700); }
.thumb-card .thumb-actions{ display:flex; justify-content:center; gap:6px; margin-top:8px; }
.thumb-card.removed{ opacity:.3; }

/* Blog post */
.post-content{ max-width:720px; margin:0 auto; }
.post-content h2{ margin-top:1.4em; }
.post-content ul, .post-content ol{ color:var(--grey-700); padding-left:1.3em; }
.post-content li{ margin-bottom:.5em; }

/* ---------- Breadcrumbs & tool content (SEO sections) ---------- */
.breadcrumb{ font-size:.85rem; color:var(--grey-500); margin-bottom:18px; }
.breadcrumb a{ color:var(--grey-500); transition:color .2s; }
.breadcrumb a:hover{ color:var(--blue-2); }
.breadcrumb .sep{ margin:0 6px; color:var(--grey-300); }

.tool-content{ max-width:760px; margin:0 auto; }
.tool-content h2{ margin-top:1.6em; }
.tool-content ul{ color:var(--grey-700); padding-left:1.3em; }
.tool-content li{ margin-bottom:.5em; }
.mini-faq .faq-item{ border-bottom:1px solid var(--grey-200); }

.related-tools{ display:flex; gap:14px; flex-wrap:wrap; margin-top:18px; }
.related-tools a{
  display:inline-flex; align-items:center; gap:8px;
  border:1.5px solid var(--grey-300); border-radius:var(--radius-pill);
  padding:10px 20px; font-weight:600; font-size:.92rem; color:var(--navy);
  transition:border-color .2s, color .2s, background .2s;
}
.related-tools a:hover{ border-color:var(--blue-2); color:var(--blue-2); background:var(--sky); }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .grid-5{ grid-template-columns:repeat(3,1fr); }
  .pricing-grid, .steps{ grid-template-columns:repeat(1,1fr); }
  .footer-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 760px){
  .nav-links{
    position:fixed; top:76px; left:0; right:0; background:#fff; flex-direction:column;
    align-items:stretch; padding:20px 24px; gap:6px; border-bottom:1px solid var(--grey-200);
    transform:translateY(-130%); transition:transform .3s var(--ease); box-shadow:var(--shadow-md);
  }
  .nav-links.open{ transform:translateY(0); }
  .nav-links a{ padding:12px 0; border-bottom:1px solid var(--grey-100); }
  .nav-toggle{ display:block; }
  .nav-cta .btn-secondary{ display:none; }
  .grid-5, .grid-3, .grid-2{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  section{ padding:64px 0; }
  .hero{ padding:48px 0 40px; }
  .hero-cta-row{ margin:24px 0 28px; }
}
