/* ===================================================
   Token system
   Color:  paper #F6F3EC · ink #16302B · ink-soft #3D544E
           teal #1F5C50 · amber #D68A2B (single accent, used sparingly)
           line #DDD6C4
   Type:   Display/body = Vazirmatn (variable weights)
           Mono (data)   = JetBrains Mono
=================================================== */

:root{
  --paper: #F6F3EC;
  --paper-dim: #EFEADD;
  --ink: #16302B;
  --ink-soft: #4A5F59;
  --teal: #1F5C50;
  --teal-deep: #123B33;
  --amber: #D68A2B;
  --amber-soft: #F3DDB8;
  --line: #DBD3BE;
  --white: #FFFDF8;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(22,48,43,0.06);
  --shadow-md: 0 8px 24px rgba(22,48,43,0.09);
  --shadow-lg: 0 20px 50px rgba(22,48,43,0.14);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'Vazirmatn', sans-serif;
  -webkit-font-smoothing:antialiased;
  line-height:1.7;
  position:relative;
}

.wrap{ max-width:1080px; margin:0 auto; padding:0 24px; }

/* subtle paper grain */
.grain{
  position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.5;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(22,48,43,0.025) 0, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(214,138,43,0.03) 0, transparent 40%);
}

/* ============ TOPBAR ============ */
.topbar{
  position:sticky; top:0; z-index:50;
  background:rgba(246,243,236,0.86);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{ display:flex; align-items:center; justify-content:space-between; height:68px; }
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:1.15rem; letter-spacing:-.01em; }
.brand-mark svg{ width:26px; height:26px; }
.brand-mark .m1{ fill:var(--teal); }
.brand-mark .m2{ fill:var(--amber); }
.topnav{ display:flex; gap:28px; }
.topnav a{ color:var(--ink-soft); text-decoration:none; font-size:.95rem; font-weight:500; transition:color .15s; }
.topnav a:hover{ color:var(--teal); }

/* ============ HERO ============ */
.hero{ padding:88px 24px 40px; position:relative; z-index:1; }
.hero-copy{ max-width:760px; }
.eyebrow{
  font-family:'JetBrains Mono', monospace;
  font-size:.78rem; letter-spacing:.08em; text-transform:uppercase;
  color:var(--teal); font-weight:500; margin:0 0 18px;
  display:inline-block; padding:5px 12px; border:1px solid var(--line);
  border-radius:100px; background:var(--white);
}
h1{
  font-size:clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight:800; line-height:1.28; letter-spacing:-.015em;
  margin:0 0 22px; color:var(--ink);
}
.ink-underline{
  position:relative; color:var(--teal-deep);
  background:linear-gradient(transparent 62%, var(--amber-soft) 62%);
  padding:0 2px;
}
.lede{ font-size:1.12rem; color:var(--ink-soft); max-width:600px; margin:0 0 28px; }
.trust-row{ display:flex; flex-wrap:wrap; gap:22px; list-style:none; padding:0; margin:0; }
.trust-row li{ display:flex; align-items:center; gap:8px; font-size:.92rem; color:var(--ink-soft); font-weight:500; }
.trust-row .dot{ width:7px; height:7px; border-radius:50%; background:var(--teal); flex-shrink:0; }

/* ============ CONVERTER PANEL ============ */
.converter{ padding:20px 24px 90px; position:relative; z-index:1; }
.panel{ max-width:640px; margin:0 auto; }

.dropzone{
  background:var(--white);
  border:2px dashed var(--line);
  border-radius:20px;
  padding:52px 32px;
  text-align:center;
  transition:border-color .2s, background .2s, transform .15s;
  box-shadow:var(--shadow-sm);
}
.dropzone:hover{ border-color:var(--teal); box-shadow:var(--shadow-md); }
.dropzone.dragover{
  border-color:var(--amber); background:#FCF7EC; transform:scale(1.01);
}
#stateIdle{ cursor:pointer; border-radius:12px; }
#stateIdle:focus-visible{ outline:3px solid var(--amber); outline-offset:6px; }

.dz-state{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.dz-state[hidden]{ display:none; }

.dz-visual{ display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:18px; height:96px; }
.doc-icon, .grid-icon{ width:64px; height:80px; }
.doc-page{ fill:var(--paper-dim); stroke:var(--ink-soft); stroke-width:2; }
.doc-fold{ fill:var(--line); }
.doc-line{ stroke:var(--ink-soft); stroke-width:3; stroke-linecap:round; opacity:.55; }
.arrow-icon{ width:38px; height:26px; flex-shrink:0; }
.arrow-path{ stroke:var(--amber); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.grid-page{ fill:var(--white); stroke:var(--teal); stroke-width:2; }
.grid-line{ stroke:var(--teal); stroke-width:1.6; opacity:.55; }

.dz-title{ font-size:1.15rem; font-weight:700; margin:2px 0 0; color:var(--ink); }
.dz-sub{ font-size:.92rem; color:var(--ink-soft); margin:0 0 18px; }

.btn-primary{
  background:var(--teal); color:var(--white); border:none;
  font-family:inherit; font-weight:700; font-size:1rem;
  padding:14px 30px; border-radius:11px; cursor:pointer;
  transition:background .15s, transform .1s;
  box-shadow:var(--shadow-sm);
}
.btn-primary:hover{ background:var(--teal-deep); }
.btn-primary:active{ transform:scale(.98); }
.btn-wide{ width:100%; }

.btn-secondary{
  display:inline-block;
  background:var(--amber); color:var(--teal-deep); text-decoration:none;
  font-weight:700; font-size:1rem; padding:13px 26px; border-radius:11px;
  transition:filter .15s, transform .1s;
}
.btn-secondary:hover{ filter:brightness(1.05); }
.btn-secondary:active{ transform:scale(.98); }
.sample-links{ display:flex; flex-wrap:wrap; gap:12px; }
.btn-secondary-alt{
  background:transparent; color:var(--white); border:1.5px solid rgba(255,255,255,0.4);
}
.btn-secondary-alt:hover{ background:rgba(255,255,255,0.08); filter:none; }

.btn-ghost{
  background:none; border:none; color:var(--ink-soft); font-family:inherit;
  font-size:.92rem; font-weight:500; text-decoration:underline;
  cursor:pointer; padding:10px; margin-top:4px;
}
.btn-ghost:hover{ color:var(--ink); }

/* file chip */
.file-chip{
  display:flex; align-items:center; gap:12px; width:100%;
  background:var(--paper-dim); border:1px solid var(--line); border-radius:12px;
  padding:12px 16px; margin-bottom:20px; text-align:right;
}
.file-chip-icon{ width:22px; height:22px; color:var(--teal); flex-shrink:0; }
.file-chip-meta{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.file-chip-name{ font-weight:600; font-size:.92rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:280px; }
.file-chip-size{ font-family:'JetBrains Mono',monospace; font-size:.75rem; color:var(--ink-soft); }
.file-chip-remove{
  background:none; border:none; font-size:1.3rem; line-height:1; color:var(--ink-soft);
  cursor:pointer; padding:2px 6px; border-radius:6px; flex-shrink:0;
}
.file-chip-remove:hover{ background:var(--line); color:var(--ink); }

/* busy state */
.spinner{
  width:38px; height:38px; border-radius:50%;
  border:3px solid var(--line); border-top-color:var(--teal);
  animation:spin .8s linear infinite; margin-bottom:14px;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
.progress-track{ width:100%; max-width:320px; height:6px; background:var(--paper-dim); border-radius:100px; overflow:hidden; margin-top:14px; }
.progress-fill{ height:100%; width:0%; background:var(--amber); border-radius:100px; transition:width .3s ease; }

/* done state */
.done-badge{
  width:52px; height:52px; border-radius:50%; background:var(--teal);
  display:flex; align-items:center; justify-content:center; color:var(--white);
  margin-bottom:14px;
}
.done-badge svg{ width:26px; height:26px; }

/* error state */
.error-badge{
  width:48px; height:48px; border-radius:50%; background:#C24B3A; color:var(--white);
  display:flex; align-items:center; justify-content:center; font-size:1.4rem; font-weight:800;
  margin-bottom:14px;
}

.privacy-note{
  display:flex; align-items:center; justify-content:center; gap:7px;
  font-size:.82rem; color:var(--ink-soft); margin-top:16px;
}
.privacy-note svg{ color:var(--teal); flex-shrink:0; }

/* ============ HOW IT WORKS ============ */
.how{ padding:60px 24px; position:relative; z-index:1; }
.section-title{ font-size:1.7rem; font-weight:800; margin:0 0 32px; letter-spacing:-.01em; }
.how-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.how-card{
  background:var(--white); border:1px solid var(--line); border-radius:16px; padding:26px 22px;
}
.how-mark{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:9px; background:var(--paper-dim);
  font-family:'JetBrains Mono', monospace; font-weight:700; color:var(--teal); font-size:.95rem;
  margin-bottom:14px;
}
.how-card h3{ font-size:1.05rem; margin:0 0 8px; font-weight:700; }
.how-card p{ font-size:.92rem; color:var(--ink-soft); margin:0; }

/* ============ SAMPLE ============ */
.sample{ padding:20px 24px 70px; position:relative; z-index:1; }
.sample-card{
  background:var(--teal-deep); color:var(--white); border-radius:22px;
  padding:48px; display:grid; grid-template-columns:1.2fr .8fr; gap:32px; align-items:center;
  position:relative; overflow:hidden;
}
.sample-card::before{
  content:''; position:absolute; inset:0;
  background:radial-gradient(circle at 85% 20%, rgba(214,138,43,0.18), transparent 55%);
  pointer-events:none;
}
.sample-copy{ position:relative; z-index:1; }
.sample-copy .eyebrow{ background:rgba(255,255,255,0.08); border-color:rgba(255,255,255,0.18); color:var(--amber-soft); }
.sample-copy h2{ font-size:1.6rem; font-weight:800; margin:14px 0 12px; line-height:1.4; }
.sample-copy p{ color:rgba(255,255,255,0.78); margin:0 0 22px; font-size:.98rem; }

.sample-visual{ display:flex; justify-content:center; position:relative; z-index:1; }
.sample-thumb{
  width:180px; background:var(--white); border-radius:10px; padding:18px;
  box-shadow:0 20px 40px rgba(0,0,0,0.35); transform:rotate(-3deg);
}
.thumb-line{ height:8px; background:var(--paper-dim); border-radius:3px; margin-bottom:8px; width:100%; }
.thumb-title{ width:70%; height:10px; background:var(--teal); opacity:.7; }
.thumb-table{ margin-top:14px; border:1px solid var(--line); border-radius:5px; overflow:hidden; }
.thumb-row{ height:16px; border-bottom:1px solid var(--line); }
.thumb-row:last-child{ border-bottom:none; }
.thumb-row.head{ background:var(--amber-soft); }

/* ============ FAQ ============ */
.faq{ padding:20px 24px 90px; position:relative; z-index:1; }
.faq-list{ max-width:760px; }
.faq-item{
  background:var(--white); border:1px solid var(--line); border-radius:12px;
  padding:18px 22px; margin-bottom:12px;
}
.faq-item summary{
  cursor:pointer; font-weight:700; font-size:.98rem; list-style:none;
  display:flex; justify-content:space-between; align-items:center;
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary::after{
  content:'+'; font-size:1.3rem; color:var(--teal); font-weight:400; margin-inline-start:12px;
}
.faq-item[open] summary::after{ content:'−'; }
.faq-item p{ margin:12px 0 0; color:var(--ink-soft); font-size:.92rem; }

/* ============ FOOTER ============ */
.footer{ border-top:1px solid var(--line); padding:26px 24px; }
.footer-inner{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:.85rem; color:var(--ink-soft); }
.footer-dim{ opacity:.7; }

/* ============ RESPONSIVE ============ */
@media (max-width:760px){
  .how-grid{ grid-template-columns:1fr; }
  .sample-card{ grid-template-columns:1fr; padding:32px 24px; text-align:center; }
  .sample-visual{ order:-1; }
  .topnav{ display:none; }
  .hero{ padding:56px 20px 24px; }
  .dropzone{ padding:36px 20px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
  html{ scroll-behavior:auto; }
}
