/* ==========================================================================
   ToolBench — design tokens
   Concept: a drafting table / blueprint workbench. Tools are precise
   instruments, laid out on a grid, each tagged like an inventory item.
   ========================================================================== */
:root {
  --ink:        #0F1B2D;
  --ink-soft:   #253649;
  --paper:      #F6F7F9;
  --card:       #FFFFFF;
  --line:       #DEE3EA;
  --line-soft:  #ECEFF3;
  --muted:      #5B6B7C;
  --amber:      #FF6B35;
  --amber-dark: #E1521F;
  --teal:       #12958A;
  --teal-soft:  #E4F5F3;
  --amber-soft: #FFEDE3;
  --danger:     #D64545;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 1px 2px rgba(15,27,45,.04), 0 8px 24px -12px rgba(15,27,45,.12);
  --shadow-lg:  0 4px 8px rgba(15,27,45,.04), 0 24px 48px -16px rgba(15,27,45,.18);
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.icon { width: 20px; height: 20px; flex-shrink: 0; }

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

/* ==========================================================================
   Blueprint grid texture — the signature ambient motif
   ========================================================================== */
.blueprint-bg {
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Corner registration marks — used on cards & panels as a drafting motif */
.corner-marks { position: relative; }
.corner-marks::before,
.corner-marks::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--line);
  pointer-events: none;
  transition: border-color .15s ease;
}
.corner-marks::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.corner-marks::after { bottom: 10px; right: 10px; border-left: none; border-top: none; }
.corner-marks:hover::before,
.corner-marks:hover::after { border-color: var(--amber); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246,247,249,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  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: 19px;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

.main-nav { display: none; }
@media (min-width: 960px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
}
.nav-item { position: relative; flex-shrink: 0; }
.nav-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  background: none; border: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav-trigger:hover { background: var(--line-soft); color: var(--ink); }
.nav-trigger .icon { width: 14px; height: 14px; transition: transform .15s ease; }
.nav-item:hover .nav-trigger .icon,
.nav-item.open .nav-trigger .icon { transform: rotate(180deg); }

.mega-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  max-height: 70vh;
  overflow-y: auto;
}
.nav-item:hover .mega-panel,
.nav-item.open .mega-panel {
  opacity: 1; visibility: visible; transform: translateY(0);
}
/* Rightmost nav items: anchor the panel to the right edge instead of the left,
   so it opens back toward the page instead of trying to spill past the viewport. */
.nav-item:nth-last-child(-n+3) .mega-panel {
  left: auto;
  right: 0;
}
.mega-link {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.mega-link:hover { background: var(--amber-soft); color: var(--amber-dark); }
.mega-link .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.mega-link:hover .icon { color: var(--amber-dark); }
.mega-link .soon-dot { margin-left: auto; font-family: var(--font-mono); font-size: 9px; color: var(--muted); background: var(--line-soft); padding: 2px 6px; border-radius: 20px; align-self: center; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: var(--amber-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.menu-toggle {
  display: flex; margin-left: auto;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--line); background: var(--card);
}
@media (min-width: 960px) { .menu-toggle { display: none; } .header-actions { margin-left: 0; } }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed; inset: 68px 0 0 0;
  background: var(--paper);
  z-index: 99;
  overflow-y: auto;
  padding: 12px 20px 40px;
}
.mobile-nav.open { display: block; }
.mobile-cat { border-bottom: 1px solid var(--line-soft); padding: 6px 0; }
.mobile-cat summary {
  padding: 12px 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.mobile-cat summary::-webkit-details-marker { display: none; }
.mobile-cat[open] summary .icon { transform: rotate(180deg); }
.mobile-tool {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 10px 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.mobile-tool .icon { width: 16px; height: 16px; color: var(--muted); }
@media (min-width: 960px) { .mobile-nav { display: none !important; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  color: #fff;
  padding: 72px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 85% 20%, rgba(255,107,53,.18), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 720px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(255,107,53,.12);
  border: 1px solid rgba(255,107,53,.3);
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(32px, 5.5vw, 54px);
  font-weight: 700;
  margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p.lede {
  font-size: 17px;
  color: rgba(255,255,255,.72);
  max-width: 520px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat .num { font-family: var(--font-mono); font-size: 22px; color: #fff; font-weight: 600; }
.hero-stat .label { font-size: 12.5px; color: rgba(255,255,255,.55); margin-top: 2px; }

/* ==========================================================================
   Search
   ========================================================================== */
.tool-search-wrap { margin-top: -30px; position: relative; z-index: 2; }
.tool-search {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px 8px 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-search .icon { color: var(--muted); }
.tool-search input {
  flex: 1;
  border: none; outline: none;
  font-size: 15px;
  padding: 12px 0;
  font-family: var(--font-body);
  background: transparent;
  color: var(--ink);
}

/* ==========================================================================
   Category sections + tool grid
   ========================================================================== */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; }
.section-head .count { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line); }
.tool-card.is-soon { opacity: .68; }
.tool-icon-badge {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber-dark);
  display: flex; align-items: center; justify-content: center;
}
.tool-card.cat-ai-pdf .tool-icon-badge { background: var(--teal-soft); color: var(--teal); }
.tool-card-title { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; margin-bottom: 4px; }
.tool-card-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.tool-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.status-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}
.status-chip.live { background: #E4F5EC; color: #158A4C; }
.status-chip.soon { background: var(--line-soft); color: var(--muted); }

/* ==========================================================================
   Category nav strip (tool belt)
   ========================================================================== */
.cat-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 18px;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.cat-chip:hover, .cat-chip.active { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ==========================================================================
   Tool page layout (upload / workspace)
   ========================================================================== */
.tool-page-head { padding: 44px 0 8px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; display: flex; gap: 6px; align-items: center; }
.breadcrumb a:hover { color: var(--ink); }
.tool-page-head-row { display: flex; align-items: center; gap: 16px; }
.tool-page-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-page-icon .icon { width: 26px; height: 26px; }
.tool-page-head h1 { font-size: 28px; }
.tool-page-head .desc { color: var(--muted); font-size: 15px; margin-top: 4px; }

.workspace { padding: 32px 0 80px; }
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone.drag-over, .dropzone:hover { border-color: var(--amber); background: var(--amber-soft); }
.dropzone .icon-wrap {
  width: 56px; height: 56px; margin: 0 auto 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--amber);
  display: flex; align-items: center; justify-content: center;
}
.dropzone .icon-wrap .icon { width: 26px; height: 26px; }
.dropzone h3 { font-size: 17px; margin-bottom: 6px; }
.dropzone p { color: var(--muted); font-size: 13.5px; }
.dropzone input[type=file] { display: none; }

.file-list { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.file-row .icon-wrap { width: 34px; height: 34px; border-radius: 8px; background: var(--amber-soft); color: var(--amber-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-row .icon-wrap .icon { width: 17px; height: 17px; }
.file-row .meta { flex: 1; min-width: 0; }
.file-row .fname { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .fsize { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.file-row .remove { color: var(--muted); background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; }
.file-row .remove:hover { color: var(--danger); background: #FDECEC; }

.options-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 20px;
}
.options-panel h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 16px; font-family: var(--font-mono); font-weight: 500; }
.field-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.field input[type=text], .field input[type=number], .field input[type=password], .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: var(--font-body); background: var(--paper); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--amber); background: #fff; }
.radio-pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill input { display: none; }
.radio-pill span {
  display: inline-flex; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line); font-size: 13.5px; cursor: pointer; color: var(--ink-soft);
}
.radio-pill input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }

.action-bar { display: flex; align-items: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.helper-text { font-size: 12.5px; color: var(--muted); }

.result-panel {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-top: 20px;
}
.result-panel .icon-wrap { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: rgba(255,107,53,.16); color: var(--amber); display: flex; align-items: center; justify-content: center; }
.result-panel h3 { font-size: 19px; margin-bottom: 6px; }
.result-panel p { color: rgba(255,255,255,.6); font-size: 13.5px; margin-bottom: 22px; }

.alert { padding: 14px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px; display: flex; gap: 10px; align-items: flex-start; }
.alert-error { background: #FDECEC; color: #A32E2E; border: 1px solid #F5C6C6; }
.alert .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* Coming soon page */
.soon-panel { text-align: center; padding: 80px 24px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.soon-panel .icon-wrap { width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 16px; background: var(--line-soft); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.soon-panel h2 { font-size: 22px; margin-bottom: 8px; }
.soon-panel p { color: var(--muted); max-width: 420px; margin: 0 auto 24px; }

/* ==========================================================================
   Trust strip / how it works / footer
   ========================================================================== */
.trust-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); padding: 28px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-item .icon { color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.trust-item h4 { font-size: 14px; margin-bottom: 3px; }
.trust-item p { font-size: 12.5px; color: var(--muted); }

.site-footer { background: var(--ink); color: rgba(255,255,255,.65); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 32px; margin-bottom: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; max-width: 260px; }
.footer-col h5 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; font-size: 13.5px; padding: 6px 0; color: rgba(255,255,255,.72); }
.footer-col a:hover { color: var(--amber); }
.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: 12.5px; color: rgba(255,255,255,.45); }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 6px; background: var(--line-soft); border-radius: 20px; overflow: hidden; margin-top: 16px; }
.progress-fill { height: 100%; background: var(--amber); width: 0%; transition: width .3s ease; }
