/* =========================================================
   FILE TOOLBOX — design tokens
   Concept: a desktop light-table / copy-shop counter.
   Paper-grey surfaces, deep ink text, toner-teal + warm
   receipt-orange accents, monospace "machine" numerals.
   ========================================================= */

:root{
  --paper:      #EEF1EE;
  --paper-deep: #E2E7E2;
  --surface:    #FCFDFC;
  --ink:        #14181A;
  --ink-soft:   #4B5450;
  --ink-faint:  #7C8681;
  --line:       #C7D0C9;
  --line-soft:  #DAE1DA;
  --accent:     #0E7C63;
  --accent-ink: #063E31;
  --warm:       #D65F2E;
  --warm-soft:  #F7E4D8;
  --accent-soft:#DCEEE8;
  --danger:     #B23A2E;

  --font-mono: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius-s: 3px;
  --radius-m: 6px;
  --maxw: 1080px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* faint graph-paper texture on the page background */
body{
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
}

img{ max-width:100%; display:block; }
a{ color: var(--accent-ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--warm);
  outline-offset: 2px;
}

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

/* ---------- eyebrow / mono labels ---------- */
.eyebrow{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display:flex; align-items:center; gap:10px;
}
.eyebrow::before{
  content:"";
  width: 18px; height: 1px;
  background: var(--accent);
  display:inline-block;
}

/* ---------- header ---------- */
.site-header{
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top:0; z-index: 40;
}
.site-header .wrap{
  display:flex; align-items:center; justify-content:space-between;
  height: 64px;
}
.brand{
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration:none;
  display:flex; align-items:center; gap:9px;
}
.brand-logo{
  width: 28px; height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  display:block;
}
.brand .dot{
  width:8px; height:8px; border-radius:50%;
  background: var(--warm);
  box-shadow: 0 0 0 3px var(--warm-soft);
}
.site-nav{ display:flex; gap:28px; align-items:center; }
.site-nav a{
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration:none;
  font-weight:500;
}
.site-nav a:hover{ color: var(--ink); }
.nav-toggle{ display:none; }

.header-right{ display:flex; align-items:center; gap:20px; }

/* ---------- language switcher (compact select) ---------- */
.lang-switch{
  position:relative;
  display:inline-flex; align-items:center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 0 8px 0 12px;
  flex-shrink:0;
}
.lang-switch svg{ width:14px; height:14px; color: var(--ink-faint); flex-shrink:0; }
.lang-switch select{
  appearance:none; -webkit-appearance:none;
  border:none; background:transparent;
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight:600;
  color: var(--ink);
  padding: 7px 22px 7px 8px;
  cursor:pointer;
}
.lang-switch::after{
  content:"";
  position:absolute; right:9px; top:50%;
  width:6px; height:6px;
  border-right:1.5px solid var(--ink-faint);
  border-bottom:1.5px solid var(--ink-faint);
  transform: translateY(-65%) rotate(45deg);
  pointer-events:none;
}
.lang-switch:hover{ border-color: var(--accent); }
.lang-switch select:focus-visible{ outline: 2px solid var(--warm); outline-offset:2px; border-radius: 999px;}

/* ---------- back to top ---------- */
.back-to-top{
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  border: 1px solid var(--ink);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, background .15s ease;
  z-index: 50;
  box-shadow: 0 8px 20px -8px rgba(20,24,26,.45);
}
.back-to-top.show{
  opacity: 1; visibility: visible; transform: translateY(0);
}
.back-to-top:hover{ background: var(--accent-ink); }
.back-to-top svg{ width:18px; height:18px; }
@media (prefers-reduced-motion: reduce){
  .back-to-top{ transition: opacity .01s linear, visibility .01s linear; }
}

/* ---------- footer ---------- */
.site-footer{
  border-top: 1px solid var(--line);
  margin-top: 96px;
  background: var(--surface);
}
.site-footer .wrap{
  padding-top: 40px; padding-bottom: 40px;
  display:flex; flex-wrap:wrap; gap:24px;
  align-items:flex-start; justify-content:space-between;
}
.footer-cols{ display:flex; gap:56px; flex-wrap:wrap; }
.footer-col h4{
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing:.08em; text-transform:uppercase;
  color: var(--ink-faint); margin:0 0 12px;
}
.footer-col a{
  display:block; font-size: 14px; color: var(--ink-soft);
  text-decoration:none; margin-bottom:8px;
}
.footer-col a:hover{ color: var(--ink); }
.footer-note{
  font-size: 13px; color: var(--ink-faint); max-width: 320px;
  font-family: var(--font-mono);
}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-s);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  cursor:pointer;
  text-decoration:none;
  transition: transform .12s ease, background .15s ease;
}
.btn:hover{ background:#000; }
.btn:active{ transform: translateY(1px); }
.btn.secondary{
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn.secondary:hover{ border-color: var(--ink); background: var(--paper-deep); }
.btn.accent{ background: var(--accent); border-color: var(--accent); }
.btn.accent:hover{ background: var(--accent-ink); border-color: var(--accent-ink); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn:disabled:hover{ background: var(--ink); }

/* ---------- hero ---------- */
.hero{ padding: 72px 0 56px; }
.hero h1{
  font-family: var(--font-mono);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 18px 0 20px;
  max-width: 16ch;
}
.hero p.lede{
  font-size: 18px; color: var(--ink-soft);
  max-width: 52ch; margin: 0 0 28px;
}
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; }

/* stat / receipt strip */
.strip{
  margin-top: 48px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  display:flex; flex-wrap:wrap;
}
.strip .cell{
  flex: 1 1 160px;
  padding: 18px 20px;
  border-left: 1px dashed var(--line);
}
.strip .cell:first-child{ border-left:none; }
.strip .cell .num{
  font-family: var(--font-mono); font-size: 22px; font-weight:600; color: var(--accent-ink);
}
.strip .cell .lbl{ font-size: 12.5px; color: var(--ink-faint); margin-top:2px; }

/* ---------- tool grid ---------- */
.section{ padding: 56px 0; }
.section-head{ margin-bottom: 32px; max-width: 60ch; }
.section-head h2{
  font-family: var(--font-mono);
  font-size: 26px; margin: 12px 0 10px;
}
.section-head p{ color: var(--ink-soft); margin:0; }

.tool-grid{
  display:grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
.tool-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 26px;
  text-decoration:none; color: var(--ink);
  display:flex; flex-direction:column; gap:14px;
  position:relative; overflow:hidden;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tool-card:hover{
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px rgba(14,124,99,.45);
}
.tool-card .conv{
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing:.04em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--line-soft);
  display:inline-flex; align-items:center; gap:8px;
  padding: 5px 10px; border-radius: 999px;
  width: fit-content;
}
.tool-card .conv .arrow{ color: var(--warm); }
.tool-card h3{ margin:0; font-size: 19px; }
.tool-card p{ margin:0; color: var(--ink-soft); font-size: 14.5px; flex:1; }
.tool-card .go{
  font-family: var(--font-mono); font-size:13px; color: var(--ink);
  display:flex; align-items:center; gap:6px;
}
.tool-card:hover .go{ color: var(--accent-ink); }

/* ---------- drop zone (signature element) ---------- */
.dropzone{
  position:relative;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  padding: 46px 24px;
  text-align:center;
  overflow:hidden;
  cursor:pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.drag{
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone .dz-icon{
  width:40px; height:40px; margin:0 auto 14px;
  color: var(--accent-ink);
}
.dropzone h3{ margin: 0 0 6px; font-size:17px; font-family: var(--font-mono);}
.dropzone p{ margin:0; color: var(--ink-faint); font-size:13.5px; }
.dropzone input[type=file]{ position:absolute; inset:0; opacity:0; cursor:pointer; }

/* scanning light-bar sweep, shown while a file is dragged over / processing */
.dropzone .scan-bar{
  position:absolute; left:0; right:0; top:0; height:3px;
  background: linear-gradient(90deg, transparent, var(--warm), transparent);
  opacity:0; transform: translateY(0);
}
.dropzone.scanning .scan-bar{
  opacity:1;
  animation: sweep 1.1s linear infinite;
}
@keyframes sweep{
  0%{ transform: translateY(0); }
  100%{ transform: translateY(140px); }
}
@media (prefers-reduced-motion: reduce){
  .dropzone.scanning .scan-bar{ animation: none; opacity:.6; }
  html{ scroll-behavior:auto; }
}

/* ---------- tool workspace ---------- */
.tool-shell{ padding: 44px 0 80px; }
.tool-head{ margin-bottom: 28px; }
.tool-head .conv-title{
  font-family: var(--font-mono);
  font-size: clamp(22px,3.4vw,32px);
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
}
.tool-head .conv-title .arrow{ color: var(--warm); }
.tool-head p{ color: var(--ink-soft); max-width: 60ch; margin-top:10px; }

.workspace{
  display:grid; grid-template-columns: 1.1fr .9fr; gap: 24px;
  align-items:start;
}
.panel{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
}
.panel h4{
  font-family: var(--font-mono); font-size:13px; letter-spacing:.08em;
  text-transform:uppercase; color: var(--ink-faint); margin: 0 0 16px;
}

.field{ margin-bottom: 18px; }
.field label{
  display:block; font-size: 13.5px; font-weight:600; margin-bottom:8px;
}
.field select, .field input[type=range]{ width:100%; }
select{
  width:100%; padding:10px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--paper);
  font-family: var(--font-body); font-size:14px; color: var(--ink);
}
input[type=range]{ accent-color: var(--accent); }
.range-row{ display:flex; justify-content:space-between; font-family: var(--font-mono); font-size:12.5px; color: var(--ink-faint); margin-bottom:6px;}

/* file list = "receipt" style rows */
.file-list{ display:flex; flex-direction:column; gap:0; margin: 16px 0 0; border-top:1px dashed var(--line); }
.file-row{
  display:flex; align-items:center; gap:12px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 13px;
}
.file-row .thumb{
  width:36px; height:36px; border-radius: var(--radius-s);
  object-fit:cover; background: var(--paper-deep); flex-shrink:0;
  border: 1px solid var(--line);
}
.file-row .name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color: var(--ink); font-family: var(--font-body); font-size:13.5px;}
.file-row .meta{ color: var(--ink-faint); white-space:nowrap; }
.file-row .meta .after{ color: var(--accent-ink); font-weight:600; }
.file-row .remove{
  background:none; border:none; color: var(--ink-faint); cursor:pointer; font-size:16px; line-height:1;
  padding:4px;
}
.file-row .remove:hover{ color: var(--danger); }
.file-row .dl{
  color: var(--accent-ink); text-decoration:none; font-weight:600; font-size:12.5px;
  border:1px solid var(--line-soft); padding:4px 8px; border-radius: 999px; background: var(--accent-soft);
}

.empty-note{ color: var(--ink-faint); font-size: 13.5px; font-family: var(--font-mono); padding: 20px 0 4px; text-align:center; }

.textarea-field{
  width:100%; min-height:220px; resize:vertical;
  font-family: var(--font-mono); font-size:13px; line-height:1.6;
  padding:14px; border-radius: var(--radius-s); border:1px solid var(--line);
  background: var(--paper); color: var(--ink);
}
.preview-img{
  max-width:100%; max-height:180px; border-radius: var(--radius-s);
  border:1px solid var(--line); margin-bottom:12px; display:none; background: var(--paper-deep);
}
.progress-note{
  font-family: var(--font-mono); font-size:12.5px; color: var(--ink-faint);
  margin-top:10px; min-height:16px;
}

.actions-row{ display:flex; gap:12px; margin-top:20px; flex-wrap:wrap; }

.privacy-note{
  display:flex; gap:10px; align-items:flex-start;
  font-size: 13px; color: var(--ink-soft);
  background: var(--paper-deep); border-radius: var(--radius-s);
  padding: 12px 14px; margin-top: 20px;
}
.privacy-note .mark{ color: var(--accent-ink); font-weight:700; font-family: var(--font-mono); }

/* ---------- simple content pages ---------- */
.content{ padding: 56px 0 90px; max-width: 74ch; }
.content h1{ font-family: var(--font-mono); font-size: 34px; margin-bottom:6px; }
.content .updated{ font-family: var(--font-mono); font-size:12.5px; color: var(--ink-faint); margin-bottom: 34px; }
.content h2{ font-size: 20px; margin-top: 40px; }
.content p, .content li{ color: var(--ink-soft); font-size: 15.5px; }
.content ul{ padding-left: 20px; }
.content a{ color: var(--accent-ink); font-weight:600; }

/* ---------- how-it-works steps (real sequence -> numbering justified) ---------- */
.steps{ display:grid; grid-template-columns: repeat(3,1fr); gap:18px; margin-top:12px; }
.step{ background: var(--surface); border:1px solid var(--line); border-radius: var(--radius-m); padding:20px; }
.step .n{ font-family: var(--font-mono); color: var(--warm); font-size:13px; }
.step h4{ margin: 8px 0 6px; font-size:15.5px; }
.step p{ margin:0; font-size:13.5px; color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 860px){
  .workspace{ grid-template-columns: 1fr; }
  .tool-grid{ grid-template-columns: 1fr; }
  .steps{ grid-template-columns: 1fr; }
  .site-nav{ display:none; }
  .footer-cols{ gap:36px; }
}
