/* =========================================================
   Toolbench — shared stylesheet
   Edit colors/fonts here once; every page updates.
   ========================================================= */

:root {
  /* palette */
  --bg:        #EEF1F6;
  --surface:   #FFFFFF;
  --ink:       #15181F;
  --muted:     #616B7C;
  --line:      #DEE3EC;
  --accent:    #2B4DFF;
  --accent-ink:#1B36C9;
  --accent-soft:#E5E9FF;
  --good:      #1F9D63;
  --server:    #B4690E;

  /* type */
  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  /* shape */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(21,24,31,.04), 0 8px 24px rgba(21,24,31,.06);
  --shadow-lift: 0 2px 4px rgba(21,24,31,.06), 0 14px 36px rgba(27,54,201,.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -.02em; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--ink); color: #fff; border-radius: 8px;
  font-family: var(--mono); font-size: .95rem; font-weight: 700;
}
.topbar .count-pill {
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .25rem .6rem; white-space: nowrap;
}

/* ---------- hero (homepage) ---------- */
.hero {
  padding: clamp(2.4rem, 7vw, 4.5rem) clamp(1rem, 4vw, 2.5rem) 1.5rem;
  max-width: 1180px; margin: 0 auto;
}
.hero .eyebrow {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-ink);
  margin: 0 0 .8rem;
}
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.04;
  letter-spacing: -.03em; margin: 0 0 .7rem; max-width: 16ch;
}
.hero h1 .hl { color: var(--accent); }
.hero p.lede {
  font-size: clamp(1rem, 2vw, 1.18rem); color: var(--muted);
  margin: 0 0 1.6rem; max-width: 52ch;
}

/* ---------- search + filter ---------- */
.searchwrap {
  position: relative; max-width: 560px;
}
.searchwrap svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
#search {
  width: 100%;
  font-family: var(--body); font-size: 1.02rem;
  padding: .95rem 1rem .95rem 2.9rem;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
#search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchwrap .kbd {
  position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: .12rem .4rem;
  background: var(--bg);
}

.chips {
  display: flex; flex-wrap: wrap; gap: .5rem;
  max-width: 1180px; margin: 1.4rem auto .4rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}
.chip {
  font-family: var(--mono); font-size: .78rem;
  padding: .4rem .8rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: all .14s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: #fff;
}

/* ---------- tools grid ---------- */
.grid-head {
  max-width: 1180px; margin: 1.6rem auto .4rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.grid-head h2 { font-family: var(--display); font-size: 1.1rem; margin: 0; letter-spacing: -.01em; }
.grid-head .result-count { font-family: var(--mono); font-size: .8rem; color: var(--muted); }

.tools {
  list-style: none; margin: 0 auto 4rem; padding: .6rem clamp(1rem, 4vw, 2.5rem) 0;
  max-width: 1180px;
  display: grid; gap: .85rem;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: .55rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
a.tool-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: #C9D2E4; }
.tool-card .cat-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.tool-card .cat-tag .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.tool-card .name { font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: var(--ink); letter-spacing: -.01em; }
.tool-card .meta { margin-top: auto; display: flex; align-items: center; gap: .5rem; }
.badge {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .03em;
  padding: .2rem .5rem; border-radius: 6px; border: 1px solid var(--line);
}
.badge.browser { color: var(--good); border-color: #BFE6CF; background: #F0FBF4; }
.badge.server  { color: var(--server); border-color: #F0DCBE; background: #FDF6EA; }
.badge.soon    { color: var(--muted); background: var(--bg); }
.tool-card.is-soon { opacity: .72; }
.tool-card.is-soon .name { color: var(--muted); }
.no-results { max-width: 1180px; margin: 0 auto; padding: 2rem clamp(1rem,4vw,2.5rem); color: var(--muted); font-family: var(--mono); }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 2rem clamp(1rem, 4vw, 2.5rem); color: var(--muted); font-size: .9rem;
}
.site-foot .inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }

/* =========================================================
   TOOL PAGE LAYOUT  (reused by every tool)
   ========================================================= */
.tool-shell { max-width: 760px; margin: 0 auto; padding: clamp(1.4rem,4vw,2.6rem) clamp(1rem,4vw,1.5rem) 4rem; }
.crumb { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumb a { color: var(--muted); }
.tool-shell h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem,4vw,2.3rem); letter-spacing: -.02em; margin: 0 0 .4rem; }
.tool-shell .sub { color: var(--muted); margin: 0 0 1.8rem; max-width: 54ch; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 1.8rem);
}
.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }

input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; font-family: var(--body); font-size: 1rem; color: var(--ink);
  padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 120px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--body); font-weight: 600; font-size: .98rem; cursor: pointer;
  padding: .72rem 1.2rem; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; border: 1.5px solid var(--accent);
  transition: background .14s, transform .06s;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent-ink); }
.btn.ghost:hover { background: var(--accent-soft); }

.controls { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }

/* result / stats */
.result {
  margin-top: 1.3rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid #C7D0FF;
  font-family: var(--mono); font-size: 1.05rem; word-break: break-word;
}
.result.empty { background: var(--bg); border-color: var(--line); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: .7rem; margin-top: 1.2rem; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem; text-align: center; }
.stat .num { font-family: var(--display); font-weight: 700; font-size: 1.5rem; display: block; }
.stat .lbl { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.toggle-list { display: flex; flex-direction: column; gap: .55rem; }
.toggle-list label { display: flex; align-items: center; gap: .6rem; font-weight: 400; margin: 0; cursor: pointer; }
.toggle-list input { width: auto; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
