/* ToolVault — design system */
:root {
  --bg: #f6f7fb; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #f2f4fa;
  --text: #101828; --text-2: #475467; --muted: #667085; --border: #e4e7ec;
  --brand: #6366f1; --brand-2: #8b5cf6; --brand-3: #d946ef; --accent: #0ea5e9;
  --good: #10b981; --warn: #f59e0b; --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 10px 30px -12px rgba(16,24,40,.18);
  --shadow-lg: 0 24px 60px -20px rgba(99,102,241,.35);
  --radius: 14px; --radius-lg: 20px;
  --font: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --max: 1200px;
  --grad: linear-gradient(120deg,var(--brand),var(--brand-2) 55%,var(--brand-3));
  --grad-soft: linear-gradient(120deg,rgba(99,102,241,.12),rgba(139,92,246,.10) 55%,rgba(217,70,239,.10));
}
[data-theme="dark"] {
  --bg: #0b0d14; --bg-2: #0f1220; --surface: #14182b; --surface-2: #1b2037;
  --text: #e5e9f7; --text-2: #b7bed4; --muted: #8b93ad; --border: #272c44;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 14px 40px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(99,102,241,.4);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(1.9rem,4.5vw,3rem); margin: 0 0 .4rem; }
h2 { font-size: clamp(1.4rem,3vw,2rem); }
h3 { font-size: 1.15rem; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb,var(--bg) 78%,transparent);
  backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 1.05rem; box-shadow: 0 6px 16px -6px rgba(99,102,241,.7);
}
.brand em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text-2); padding: 8px 13px; border-radius: 10px; font-size: .93rem; font-weight: 500; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 1.05rem; transition: .18s;
}
.icon-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px; box-shadow: var(--shadow); }
  .menu-toggle { display: grid; }
}
/* hero */
.hero { position: relative; overflow: hidden; padding: 64px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 520px;
  background: radial-gradient(closest-side,rgba(99,102,241,.28),rgba(217,70,239,.14),transparent); filter: blur(10px); pointer-events: none;
}
.hero-inner { position: relative; text-align: center; max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid var(--border); color: var(--text-2);
  font-size: .82rem; font-weight: 600; margin-bottom: 18px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
.hero p.lead { color: var(--text-2); font-size: 1.12rem; max-width: 620px; margin: 0 auto 26px; }
.search-wrap { position: relative; max-width: 560px; margin: 0 auto; }
.search-wrap .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1.05rem; opacity: .55; }
.search-input {
  width: 100%; padding: 17px 20px 17px 50px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1rem; font-family: var(--font); box-shadow: var(--shadow); outline: none; transition: .18s;
}
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99,102,241,.18),var(--shadow); }
.search-input::placeholder { color: var(--muted); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 26px 0 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: .86rem; font-weight: 600; cursor: pointer; transition: .16s; font-family: var(--font);
}
.chip:hover { border-color: var(--brand); color: var(--text); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(99,102,241,.7); }
.section { padding: 34px 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head .count { color: var(--muted); font-size: .88rem; font-weight: 600; }
.tool-category { margin-bottom: 34px; }
.category-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.category-head .cat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; background: var(--grad-soft); border: 1px solid var(--border); }
.category-head h3 { margin: 0; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 16px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: .2s; text-decoration: none; color: var(--text);
}
.tool-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.tool-card .t-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--grad-soft); display: grid; place-items: center; font-size: 1.35rem; }
.tool-card h4 { margin: 0 0 2px; font-size: 1.02rem; }
.tool-card p { margin: 0; font-size: .86rem; color: var(--text-2); }
.tool-card .arrow { position: absolute; top: 20px; right: 20px; color: var(--muted); opacity: 0; transition: .2s; }
.tool-card:hover .arrow { opacity: 1; color: var(--brand); }
.feature-strip { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 16px; }
.feature { padding: 22px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.feature .f-icon { font-size: 1.5rem; }
.feature h4 { margin: 10px 0 6px; }
.feature p { margin: 0; color: var(--text-2); font-size: .9rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px;
  border-radius: 11px; border: 1px solid transparent; cursor: pointer; font-family: var(--font); font-size: .93rem; font-weight: 600; transition: .16s;
}
.button-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -10px rgba(99,102,241,.8); }
.button-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.button-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.button-ghost:hover { border-color: var(--brand); }
.button-sm { padding: 8px 14px; font-size: .85rem; }
.input,.textarea,.select {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: var(--font); font-size: .95rem; outline: none; transition: .16s;
}
.input:focus,.textarea:focus,.select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.16); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.select { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .86rem; font-weight: 600; color: var(--text-2); }
.hint { font-size: .8rem; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > .field { flex: 1; min-width: 140px; }
.widget-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.output {
  width: 100%; min-height: 110px; padding: 12px 14px; border-radius: 11px; border: 1px dashed var(--border);
  background: var(--surface-2); color: var(--text); font-family: ui-monospace,Menlo,Consolas,monospace;
  font-size: .9rem; white-space: pre-wrap; word-break: break-word; margin-top: 8px;
}
.result-label { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 18px; }
.range-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; accent-color: var(--brand); }
input[type="color"] { width: 56px; height: 40px; padding: 2px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.swatch { width: 100%; height: 120px; border-radius: 12px; border: 1px solid var(--border); }
.stat { text-align: center; padding: 18px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.stat .lbl { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.big-result { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; word-break: break-word; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.mono { font-family: ui-monospace,Menlo,Consolas,monospace; }
/* ad slots */
.ad-slot {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 90px; margin: 22px auto; border: 1px dashed var(--border); border-radius: 12px;
  background: var(--surface-2); color: var(--muted); font-size: .75rem; letter-spacing: .04em;
  font-weight: 600; overflow: hidden; position: relative;
}
.ad-slot[data-ad="rectangle"] { min-height: 250px; }
.ad-slot:empty { display: none; }
.ad-slot .ad-tag { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb,var(--surface) 70%,transparent); }
/* tool page layout */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); margin: 20px 0 6px; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb span { opacity: .6; }
.tool-header { max-width: 760px; }
.article-prose { color: var(--text-2); max-width: 800px; }
.article-prose h2 { color: var(--text); margin-top: 34px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 16px 46px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px;
  border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .86rem;
}
.faq-item { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; background: var(--surface); }
.faq-item details { padding: 0; }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--brand); }
.faq-item[open] summary::after { content: "\u2212"; }
.faq-item .faq-a { padding: 0 18px 16px; color: var(--text-2); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 12px; }
.related-link {
  display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); background: var(--surface); font-weight: 600; font-size: .92rem; transition: .16s;
}
.related-link:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 46px 0 30px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer-col h4 { margin: 0 0 12px; font-size: .92rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer-col a { display: block; color: var(--text-2); padding: 4px 0; font-size: .9rem; }
.footer-col a:hover { color: var(--brand); text-decoration: none; }
.footer-note { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .widget-box { padding: 18px; }
}
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease,transform .6s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); z-index: 999; opacity: 0; pointer-events: none; transition: .3s;
}
.toast.show { opacity: 1; }
/* tool-specific widgets */
.dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 44px 20px; text-align: center;
  cursor: pointer; transition: .18s; color: var(--text-2); font-size: .95rem;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--grad-soft); }
.dropzone .dz-inner b { color: var(--brand); }
.die {
  width: 56px; height: 56px; border-radius: 14px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; box-shadow: 0 10px 22px -10px rgba(99,102,241,.8);
}
.hash-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .88rem; }
.hash-table th, .hash-table td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); }
.hash-table th { background: var(--surface-2); color: var(--muted); font-weight: 700; }
.hash-table td.mono { word-break: break-all; }
.tool-widget { margin-top: 20px; }
input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .md-split { grid-template-columns: 1fr; } }
.md-preview {
  min-height: 220px; padding: 14px 16px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); overflow: auto;
}
.md-preview h1, .md-preview h2, .md-preview h3 { margin-top: .4em; }
.md-preview code { background: var(--surface); padding: 2px 6px; border-radius: 6px; font-family: ui-monospace,Menlo,Consolas,monospace; font-size: .88em; }
.md-preview pre { background: var(--surface); padding: 12px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--border); }
.md-preview blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--brand); color: var(--text-2); }
mark { background: rgba(99, 102, 241, .28); color: var(--text); padding: 1px 4px; border-radius: 4px; }