/* Quiet Tools — visual system.
   Contrast note: every foreground/background pair below was measured against
   WCAG 2.1 AA (4.5:1 for body text, 3:1 for large text and UI borders). The
   ratio is written next to any colour that sits near the threshold, so a later
   "small tweak" cannot quietly drop it under. We ship a contrast checker; the
   site failing it would be the loudest possible argument against the product. */

:root {
  color-scheme: light dark;

  --bg:      #faf9f6;
  --bg-alt:  #f2f1ec;
  --card:    #ffffff;
  --ink:     #14130e;
  --ink2:    #4e4c44;   /* 8.4:1  */
  --mute:    #6f6d64;   /* 4.99:1 — was #8a877c at 3.46:1, which failed AA */
  --line:    #e4e2d9;
  --line2:   #d3d0c4;
  --accent:  #1f6b48;   /* 5.9:1  */
  --accent2: #e8f2ec;
  --bad:     #a83228;   /* 5.6:1  */
  --warn:    #855a0c;   /* 5.1:1  */
  --ok:      #1f6b48;

  --r:   11px;
  --r-s: 7px;
  --sp:  clamp(18px, 2.5vw, 24px);
  --shadow: 0 1px 2px rgba(20, 19, 14, .05), 0 6px 20px -12px rgba(20, 19, 14, .14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0e0d0b;
    --bg-alt:  #171613;
    --card:    #16150f;
    --ink:     #f3f1ea;
    --ink2:    #b6b3a8;   /* 9.2:1 */
    --mute:    #8a877c;   /* 5.29:1 — was #7d7a70 at 4.42:1 */
    --line:    rgba(255,255,255,.09);
    --line2:   rgba(255,255,255,.17);
    --accent:  #6ecb93;   /* 8.7:1 */
    --accent2: rgba(110,203,147,.12);
    --bad:     #f0837a;
    --warn:    #e3b35c;
    --ok:      #6ecb93;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 0 20px 96px;
}
.wrap { max-width: 780px; margin: 0 auto; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* A visible focus ring is not decoration — it is the only way a keyboard user
   knows where they are. Never remove it; make it good instead. */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- masthead ---------- */
.bar {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 0 0;
  margin-bottom: 34px;
}
.bar a.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--ink);
  font-weight: 620; font-size: 15px; letter-spacing: -.01em;
}
.bar svg { display: block; }
.bar .sep { color: var(--line2); }
.bar .here { color: var(--mute); font-size: 14px; }

header.page { margin-bottom: 30px; }
h1 {
  font-size: clamp(28px, 4.6vw, 35px);
  line-height: 1.15;
  letter-spacing: -.028em;
  margin: 0 0 12px;
  font-weight: 660;
}
.lede {
  color: var(--ink2);
  font-size: clamp(16px, 1.9vw, 17.5px);
  margin: 0;
  max-width: 62ch;
}

/* ---------- surfaces ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; background: var(--bg-alt); }

label { display: block; font-size: 13px; font-weight: 620; letter-spacing: .01em; margin-bottom: 7px; }
.hint { font-size: 13.5px; color: var(--mute); margin: 7px 0 0; }
.note { color: var(--ink2); font-size: 14.5px; }
.note strong { color: var(--ink); }

/* ---------- controls ---------- */
input[type="text"], input[type="number"], input[type="datetime-local"],
input[type="file"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: var(--r-s);
  transition: border-color .12s ease, background .12s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--mute); }
textarea {
  min-height: 150px; resize: vertical;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13.5px; line-height: 1.6;
}
input[type="color"] {
  width: 54px; height: 44px; padding: 3px; cursor: pointer;
  border: 1px solid var(--line2); border-radius: var(--r-s); background: var(--bg);
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: auto; }

button {
  font: inherit; font-weight: 620; font-size: 14.5px;
  padding: 11px 18px;
  color: var(--bg); background: var(--ink);
  border: 1px solid transparent; border-radius: var(--r-s);
  cursor: pointer;
  transition: transform .08s ease, opacity .12s ease, border-color .12s ease;
}
button:hover { opacity: .88; }
button:active { transform: translateY(1px); }
button.ghost {
  background: transparent; color: var(--ink); border-color: var(--line2);
}
button.ghost:hover { border-color: var(--ink); opacity: 1; }

.row { display: flex; gap: 13px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1 1 190px; min-width: 0; }
.row > .fixed { flex: 0 0 auto; }

/* ---------- index grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }
.tool {
  display: block; position: relative;
  padding: 19px 19px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none; color: inherit;
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.tool:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool .ico { display: block; color: var(--accent); margin-bottom: 12px; }
.tool b { display: block; font-size: 15.5px; font-weight: 640; margin-bottom: 5px; letter-spacing: -.008em; }
.tool span { display: block; font-size: 13.5px; color: var(--ink2); line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tool:hover { transform: none; }
}

/* ---------- data ---------- */
.badge {
  display: inline-block;
  font: 620 11.5px/1 ui-monospace, Consolas, monospace;
  padding: 6px 9px; border-radius: 5px; letter-spacing: .05em;
  border: 1px solid transparent;
}
.badge.pass { background: var(--accent2); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.badge.fail { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.badge.warn { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); font-weight: 620; padding-top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:last-child td { padding-bottom: 0; }

code {
  font: 13.5px ui-monospace, "SF Mono", Consolas, monospace;
  background: var(--bg-alt); color: var(--ink);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line);
}
pre code { border: 0; background: none; padding: 0; }

/* ---------- footer ---------- */
footer {
  margin-top: 52px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--mute); line-height: 1.75;
}
footer a { color: var(--ink2); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
