/* File Guru -- design system
   Palette: charcoal/dark-grey base, orange primary, teal secondary. Modern, minimal, utility-first SaaS look. */

:root{
  --bg: #121417;
  --bg-alt: #17191d;
  --surface: #1c1f24;
  --surface-2: #23262c;
  --border: #2b2f36;
  --border-soft: #22252b;
  --text: #f2f3f5;
  --text-muted: #9aa1ab;
  --text-faint: #6b7280;
  --orange: #ff6a3d;
  --orange-hover: #ff7e57;
  --orange-soft: rgba(255,106,61,0.12);
  --teal: #17b8a6;
  --teal-hover: #2ad0bd;
  --teal-soft: rgba(23,184,166,0.12);
  --success: #2fbf71;
  --warning: #f2b134;
  --danger: #ef5350;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.45);
  --maxw: 1160px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img,svg{ display:block; max-width:100%; }
a{ color: inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family:inherit; }

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

/* ---------- Nav ---------- */
.nav{
  position: sticky; top:0; z-index:50;
  background: rgba(18,20,23,0.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner{
  max-width: var(--maxw);
  margin:0 auto;
  padding: 14px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
.brand{ display:flex; align-items:center; gap:10px; font-weight:700; font-size:18px; letter-spacing:-0.01em; }
.brand-mark{
  width:30px; height:30px; border-radius:9px;
  background: linear-gradient(135deg, var(--orange), var(--teal));
  display:flex; align-items:center; justify-content:center;
  font-size:15px; font-weight:800; color:#121417;
}
.nav-links{ display:flex; align-items:center; gap:28px; }
.nav-links a{ font-size:14.5px; color: var(--text-muted); transition: color .15s ease; }
.nav-links a:hover{ color: var(--text); }
.nav-cta{ display:flex; align-items:center; gap:14px; }
.nav-toggle{ display:none; background:none; border:1px solid var(--border); color:var(--text); width:40px; height:40px; border-radius:10px; align-items:center; justify-content:center; cursor:pointer; }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  cursor:pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space:nowrap;
}
.btn:active{ transform: scale(0.97); }
.btn-primary{ background: var(--orange); color:#181008; }
.btn-primary:hover{ background: var(--orange-hover); }
.btn-teal{ background: var(--teal); color:#08201c; }
.btn-teal:hover{ background: var(--teal-hover); }
.btn-ghost{ background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover{ border-color: var(--text-muted); }
.btn-sm{ padding: 8px 14px; font-size:13.5px; }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

/* ---------- Hero ---------- */
.hero{ padding: 72px 0 40px; text-align:center; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-size:13px; font-weight:600; color: var(--teal);
  margin-bottom:22px;
}
.hero h1{
  font-size: clamp(32px, 5vw, 54px);
  line-height:1.08;
  letter-spacing:-0.02em;
  margin: 0 0 16px;
  font-weight: 700;
}
.hero h1 .accent{ color: var(--orange); }
.hero p.lead{
  font-size: 18px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 34px;
}

/* ---------- Dropzone ---------- */
.dropzone{
  max-width: 720px;
  margin: 0 auto;
  border: 2px dashed var(--border);
  padding: 48px 32px;
  text-align:center;
  cursor:pointer;
  transition: border-color .15s ease;
}
.dropzone:hover, .dropzone.dragover{
  border-color: var(--orange);
}
.dropzone .dz-icon{
  width:56px; height:56px; margin: 0 auto 18px;
  display:flex; align-items:center; justify-content:center;
  color: var(--orange);
}
.dropzone h3{ margin:0 0 6px; font-size:17px; font-weight:600; }
.dropzone p{ margin:0; color: var(--text-faint); font-size:13.5px; }
.dropzone input[type=file]{ display:none; }

.hero-meta{ margin-top:16px; font-size:13px; color: var(--text-faint); }
.hero-meta strong{ color: var(--text-muted); }
.hero-meta a{ color: var(--text-muted); font-weight:600; transition: color .15s ease; }
.hero-meta a:hover{ color: var(--orange); }
.hero-popular{ margin-top:10px; font-size:13px; color: var(--text-faint); }
.hero-popular a{ color: var(--text-muted); transition: color .15s ease; }
.hero-popular a:hover{ color: var(--teal); }

/* ---------- Trust bar ---------- */
.trustbar{
  border-top:1px solid var(--border-soft);
  border-bottom:1px solid var(--border-soft);
  padding: 22px 0;
  background: var(--bg-alt);
}
.trust-grid{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:20px;
  font-size: 13.5px; color: var(--text-muted);
}
.trust-grid b{ color: var(--text); font-size:20px; display:block; }

/* ---------- Sections ---------- */
section{ padding: 64px 0; }
.section-head{ text-align:center; max-width:640px; margin:0 auto 40px; }
.section-head h2{ font-size: clamp(26px,3.4vw,36px); letter-spacing:-0.01em; margin:0 0 12px; }
.section-head p{ color: var(--text-muted); font-size:16px; margin:0; }

/* ---------- Category tabs ---------- */
.cat-tabs{ display:flex; gap:28px; justify-content:center; flex-wrap:wrap; margin-bottom:40px; border-bottom:1px solid var(--border-soft); }
.cat-tab{
  padding:0 0 14px; font-size:14px; font-weight:600;
  border:none; border-bottom:2px solid transparent; color: var(--text-muted); cursor:pointer; background:transparent;
  margin-bottom:-1px;
}
.cat-tab.active{ border-bottom-color: var(--orange); color: var(--orange); }

/* ---------- Tool grid ---------- */
.tool-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 24px;
}
.tool-card{
  padding: 18px 20px 26px;
  border-bottom: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  display:flex; flex-direction:column; gap:10px;
  transition: opacity .15s ease;
}
.tool-card:hover{ opacity:.8; }
.tool-card:hover h3{ color: var(--orange); }
.tool-icon{
  width:38px; height:38px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:18px;
  flex-shrink:0;
}
.tool-icon svg{ width:19px; height:19px; }
.tool-hero .tool-icon svg{ width:26px; height:26px; }
.ai-badge{
  display:inline-flex; align-items:center; gap:5px;
  font-size:10.5px; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  padding:3px 9px; border-radius:6px;
  background:linear-gradient(90deg, var(--orange-soft), var(--teal-soft));
  color:var(--text);
  border:1px solid var(--border);
}
.ai-badge svg{ width:11px; height:11px; color:var(--orange); }
.tool-card h3{ font-size:15.5px; margin:0; font-weight:600; transition: color .15s ease; }
.tool-card p{ font-size:13px; color: var(--text-faint); margin:0; flex:1; }
.tool-card .badge{
  align-self:flex-start;
  font-size:10.5px; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  padding:3px 8px; border-radius:6px;
}
.badge-popular{ background: var(--orange-soft); color: var(--orange); }
.badge-new{ background: var(--teal-soft); color: var(--teal); }
.badge-beta{ background: rgba(242,177,52,0.12); color: var(--warning); }

.hidden{ display:none !important; }

/* ---------- How it works ---------- */
.steps{ display:grid; grid-template-columns: repeat(3,1fr); gap:24px; }
.step{ text-align:center; padding:8px; }
.step .num{
  width:36px; height:36px; border-radius:50%; margin:0 auto 16px;
  background: var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; font-weight:700; color: var(--orange);
}
.step h4{ margin:0 0 8px; font-size:16px; }
.step p{ margin:0; color: var(--text-muted); font-size:14px; }

/* ---------- Feature list ---------- */
.feature-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:36px 28px; }
.feature{ padding:0; }
.feature .tool-icon{ margin-bottom:14px; }
.feature h4{ margin:0 0 8px; font-size:16px; }
.feature p{ margin:0; color: var(--text-muted); font-size:14px; }

/* ---------- Pricing ---------- */
.pricing-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:0; align-items:stretch; }
.price-card{
  padding:8px 28px; display:flex; flex-direction:column; gap:18px;
  border-left:1px solid var(--border-soft);
}
.price-card:first-child{ border-left:none; padding-left:0; }
.price-card:last-child{ padding-right:0; }
.price-card.highlight::before{
  content:"Most popular"; display:block;
  color: var(--orange); font-size:11.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
}
.price-card h3{ margin:0; font-size:18px; }
.price-card .amount{ font-size:38px; font-weight:700; letter-spacing:-0.02em; }
.price-card .amount span{ font-size:14px; color:var(--text-faint); font-weight:500; }
.price-card ul{ display:flex; flex-direction:column; gap:10px; flex:1; }
.price-card li{ font-size:13.5px; color: var(--text-muted); display:flex; gap:8px; align-items:flex-start; }
.price-card li::before{ content:"OK"; color: var(--teal); font-weight:700; }
.price-note{ text-align:center; color:var(--text-faint); font-size:13px; margin-top:20px; }

/* ---------- FAQ ---------- */
.faq-item{ border-bottom:1px solid var(--border-soft); padding: 18px 0; }
.faq-q{ display:flex; justify-content:space-between; align-items:center; cursor:pointer; font-weight:600; font-size:15px; }
.faq-q .chev{ transition: transform .2s ease; color: var(--text-faint); }
.faq-item.open .faq-q .chev{ transform: rotate(180deg); }
.faq-a{ max-height:0; overflow:hidden; transition: max-height .25s ease; color: var(--text-muted); font-size:14px; }
.faq-item.open .faq-a{ max-height: 400px; padding-top:12px; }

/* ---------- Footer ---------- */
footer{ border-top:1px solid var(--border-soft); padding: 48px 0 32px; background: var(--bg-alt); }
.footer-grid{ display:grid; grid-template-columns: 2fr repeat(5, 1fr); gap:28px; margin-bottom:36px; }
.footer-grid h5{ font-size:13px; text-transform:uppercase; letter-spacing:.04em; color: var(--text-faint); margin:0 0 14px; }
.footer-grid a{ display:block; font-size:14px; color: var(--text-muted); margin-bottom:10px; }
.footer-grid a:hover{ color: var(--text); }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; border-top:1px solid var(--border-soft); padding-top:24px; font-size:13px; color: var(--text-faint); }

/* ---------- Tool page ---------- */
.tool-hero{ text-align:center; padding: 48px 0 32px; }
.tool-hero .tool-icon{ width:56px; height:56px; border-radius:16px; margin:0 auto 18px; font-size:26px; }
.tool-hero h1{ font-size: clamp(26px,3.6vw,38px); margin:0 0 10px; letter-spacing:-0.01em; }
.tool-hero p{ color: var(--text-muted); max-width: 560px; margin: 0 auto; }

.panel{
  padding: 12px 0; max-width: 760px; margin: 0 auto;
}
.file-list{ display:flex; flex-direction:column; margin: 18px 0; }
.file-row{
  display:flex; align-items:center; gap:12px;
  border-bottom:1px solid var(--border-soft);
  padding: 12px 2px; font-size:13.5px;
}
.file-row .fname{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-row .fsize{ color: var(--text-faint); font-size:12.5px; }
.file-row .remove{ color: var(--text-faint); cursor:pointer; font-size:16px; line-height:1; }
.file-row .remove:hover{ color: var(--danger); }

.options-row{ display:flex; gap:16px; flex-wrap:wrap; margin: 18px 0; }
.field{ display:flex; flex-direction:column; gap:6px; flex:1; min-width:140px; }
.field label{ font-size:12.5px; color: var(--text-faint); text-transform:uppercase; letter-spacing:.03em; }
.field select, .field input[type=text], .field input[type=number]{
  background: var(--surface-2); border:1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size:14px; font-family:inherit;
}
.field input[type=range]{ width:100%; accent-color: var(--orange); }
.pill-toggle{ display:flex; gap:20px; flex-wrap:wrap; border-bottom:1px solid var(--border-soft); }
.pill-toggle button{
  background:none; border:none; border-bottom:2px solid transparent; color: var(--text-muted);
  padding:0 0 10px; margin-bottom:-1px; font-size:13.5px; font-weight:600; cursor:pointer;
}
.pill-toggle button.active{ border-bottom-color: var(--orange); color: var(--orange); }

.progress{ height:8px; border-radius:999px; background: var(--surface-2); overflow:hidden; margin: 16px 0; display:none; }
.progress.active{ display:block; }
.progress > i{ display:block; height:100%; width:0%; background: linear-gradient(90deg, var(--orange), var(--teal)); transition: width .2s ease; }

.status-msg{ font-size:13.5px; padding:4px 0 4px 14px; margin:14px 0; display:none; border-left:2px solid currentColor; line-height:1.6; }
.status-msg.show{ display:block; }
.status-msg.info{ color: var(--teal); }
.status-msg.error{ color: var(--danger); }
.status-msg.success{ color: var(--success); }
.status-msg strong{ color: var(--text); }

.result-box{ text-align:center; padding: 24px 0 4px; display:none; }
.result-box.show{ display:block; }

.privacy-note{
  display:flex; align-items:center; gap:10px; justify-content:center;
  font-size:12.5px; color: var(--text-faint); margin-top:18px;
}
.privacy-note svg{ flex-shrink:0; }

.beta-tag{
  display:inline-block; background: rgba(242,177,52,0.12); color: var(--warning);
  font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:6px; margin-bottom:14px;
}

.related-tools{ margin-top: 56px; }

canvas{ border-radius: var(--radius-sm); }

@media (max-width: 1080px){
  .footer-grid{ grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 860px){
  .nav-links{ display:none; }
  .nav-toggle{ display:flex; }
  .steps, .feature-grid, .pricing-grid{ grid-template-columns: 1fr; }
  .footer-grid{ grid-template-columns: repeat(2,1fr); }
}

/* ============================================================
   Motion system -- scroll reveal, hero glow, micro-interactions
   ============================================================ */

@media (prefers-reduced-motion: no-preference){
  body{ animation: fgPageIn .5s ease both; }

  [data-reveal]{
    opacity:0;
    transform: translateY(18px);
    transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1);
  }
  [data-reveal].in-view{ opacity:1; transform: translateY(0); }
  [data-reveal-group] > *{ transition-delay: calc(var(--reveal-i, 0) * 60ms); }

  .tool-card{ transition: border-color .15s ease, background .15s ease, transform .25s cubic-bezier(.2,.8,.3,1.2), box-shadow .25s ease; }
  .tool-card:hover{ box-shadow: 0 12px 30px rgba(0,0,0,.35); }
  .tool-card .tool-icon{ transition: transform .3s cubic-bezier(.3,.7,.3,1.4); }
  .tool-card:hover .tool-icon{ transform: scale(1.08) rotate(-4deg); }

  .btn{ position:relative; overflow:hidden; }
  .btn::after{
    content:''; position:absolute; inset:0; border-radius:inherit;
    background: radial-gradient(circle at var(--fx,50%) var(--fy,50%), rgba(255,255,255,.35), transparent 60%);
    opacity:0; transition: opacity .4s ease;
    pointer-events:none;
  }
  .btn:active::after{ opacity:1; transition: none; }

  .dropzone{ transition: border-color .2s ease, background .2s ease, transform .2s ease; }
  .dropzone.dragover{ transform: scale(1.01); }

  .trust-grid b{ transition: color .2s ease; }

  .cat-tab{ transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease; }
  .cat-tab:hover{ transform: translateY(-1px); }

  .progress > i{ transition: width .3s cubic-bezier(.2,.7,.2,1); }
}

@keyframes fgPageIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes fgSpin{
  to{ transform: rotate(360deg); }
}
@keyframes fgPulse{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(255,106,61,.35); }
  50%{ box-shadow: 0 0 0 8px rgba(255,106,61,0); }
}

/* ============================================================
   AI assistant widget
   ============================================================ */
.fg-ai-launcher{
  position:fixed; right:22px; bottom:22px; z-index:80;
  width:56px; height:56px; border-radius:50%;
  background: linear-gradient(135deg, var(--orange), var(--teal));
  color:#12141a; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-lg);
  animation: fgPulse 3.5s ease-in-out infinite;
  transition: transform .2s ease;
}
.fg-ai-launcher:hover{ transform: scale(1.06); }
.fg-ai-launcher svg{ width:24px; height:24px; }

.fg-ai-panel{
  position:fixed; right:22px; bottom:90px; z-index:81;
  width:360px; max-width:calc(100vw - 32px);
  height:480px; max-height:calc(100vh - 140px);
  background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display:none; flex-direction:column; overflow:hidden;
  opacity:0; transform: translateY(12px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}
.fg-ai-panel.open{ display:flex; }
.fg-ai-panel.show{ opacity:1; transform: translateY(0) scale(1); }

.fg-ai-header{
  padding:14px 16px; border-bottom:1px solid var(--border-soft);
  display:flex; align-items:center; gap:10px; justify-content:space-between;
  background: var(--bg-alt);
}
.fg-ai-header .title{ display:flex; align-items:center; gap:8px; font-weight:600; font-size:14.5px; }
.fg-ai-header .title svg{ width:16px; height:16px; color:var(--orange); }
.fg-ai-close{ background:none; border:none; color:var(--text-faint); cursor:pointer; font-size:18px; line-height:1; }
.fg-ai-close:hover{ color:var(--text); }

.fg-ai-body{ flex:1; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:12px; }
.fg-ai-msg{ font-size:13.5px; line-height:1.5; max-width:88%; padding:10px 13px; border-radius:12px; }
.fg-ai-msg.user{ align-self:flex-end; background: var(--orange-soft); color: var(--text); border-bottom-right-radius:4px; }
.fg-ai-msg.bot{ align-self:flex-start; background: var(--surface-2); color: var(--text-muted); border-bottom-left-radius:4px; }
.fg-ai-msg a{ color: var(--teal); text-decoration:underline; }
.fg-ai-msg.typing{ display:flex; gap:4px; align-items:center; padding:12px 14px; }
.fg-ai-msg.typing span{ width:5px; height:5px; border-radius:50%; background:var(--text-faint); animation: fgTypingDot 1.2s ease-in-out infinite; }
.fg-ai-msg.typing span:nth-child(2){ animation-delay:.15s; }
.fg-ai-msg.typing span:nth-child(3){ animation-delay:.3s; }
@keyframes fgTypingDot{ 0%,60%,100%{ opacity:.3; transform:translateY(0); } 30%{ opacity:1; transform:translateY(-3px); } }

.fg-ai-footer{ padding:12px; border-top:1px solid var(--border-soft); display:flex; gap:8px; }
.fg-ai-footer input{
  flex:1; background: var(--surface-2); border:1px solid var(--border); color:var(--text);
  border-radius:999px; padding:10px 14px; font-size:13.5px; font-family:inherit;
}
.fg-ai-footer button{
  width:38px; height:38px; border-radius:50%; border:none; cursor:pointer;
  background: var(--orange); color:#181008; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.fg-ai-footer button svg{ width:16px; height:16px; }
.fg-ai-disconnected{ padding:12px 16px; font-size:12px; color:var(--text-faint); border-top:1px solid var(--border-soft); background: var(--bg-alt); }

@media (max-width:480px){
  .fg-ai-panel{ right:16px; left:16px; width:auto; bottom:84px; }
  .fg-ai-launcher{ right:16px; bottom:16px; }
}

/* ============================================================
   Before/after demo slider (fixed: content stays put, only the
   reveal mask moves -- no more re-centering text as you drag)
   ============================================================ */
.demo-tabs{ display:flex; gap:10px; justify-content:center; margin-bottom:24px; }

.demo-slider{
  --pos: 50%;
  max-width:640px; margin:0 auto; position:relative;
  border-radius:var(--radius-lg); overflow:hidden;
  border:1px solid var(--border-soft); background:var(--surface);
  aspect-ratio:16/8; user-select:none; cursor:ew-resize;
}
.demo-layer{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center; flex-direction:column; gap:6px;
  background-size:cover; background-position:center;
}
.demo-layer .demo-label{ font-size:12px; color:var(--text-faint); letter-spacing:.04em; text-transform:uppercase; }
.demo-layer .demo-value{ font-size:38px; font-weight:700; }
.demo-layer .demo-caption{ font-size:12.5px; color:var(--text-muted); }
.demo-after{ background:linear-gradient(135deg, var(--surface-2), var(--surface)); z-index:1; }
.demo-after .demo-value{ color:var(--teal); }
.demo-before{
  z-index:2;
  background:linear-gradient(135deg, var(--surface), var(--bg-alt));
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  will-change: clip-path;
}
.demo-before .demo-value{ color:var(--orange); }
.demo-handle{
  position:absolute; top:0; bottom:0; left:var(--pos); z-index:3;
  width:2px; background:rgba(255,255,255,.7); transform:translateX(-1px);
  pointer-events:none;
}
.demo-handle::after{
  content:'\2194'; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:34px; height:34px; border-radius:50%; background:var(--orange); color:#181008;
  display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700;
  box-shadow:var(--shadow-md);
}
.demo-range{
  position:absolute; inset:0; width:100%; height:100%; z-index:4;
  opacity:0; cursor:ew-resize; margin:0;
}
