/* ==========================================================================
   Tooltrusty — core stylesheet
   Design: deep slate canvas, electric lime accent, warm off-white type.
   Single stylesheet, no framework, no build step.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --slate-900: #0b0e13;
  --slate-850: #0e1116;
  --slate-800: #131820;
  --slate-750: #171d26;
  --slate-700: #1e2732;
  --slate-600: #2a3543;

  /* Ink */
  --ink-100: #f3f5f2;
  --ink-200: #d7dcd6;
  --ink-300: #a3adb8;
  --ink-400: #7c8794;
  --ink-500: #5b6675;

  /* Accent */
  --lime-400: #d4fb6a;
  --lime-500: #c6f24e;
  --lime-600: #a8d92f;
  --lime-glow: rgba(198, 242, 78, 0.16);

  /* Support hues (used sparingly, category coding) */
  --hue-text: #c6f24e;
  --hue-image: #66e0c0;
  --hue-dev: #8bb4ff;
  --hue-calc: #ffb35c;
  --hue-seo: #b39bff;

  --ok: #6ee7a8;
  --warn: #ffcc66;
  --err: #ff7a75;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm */
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --maxw: 1180px;
  --maxw-prose: 68ch;
  --radius: 14px;
  --radius-sm: 9px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 220ms;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--slate-850);
  color: var(--ink-200);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas, video { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-100);
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 0.6em;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); }
h3 { font-size: clamp(1.12rem, 2vw, 1.32rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1.1em; }

a {
  color: var(--lime-500);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.9em; }
/* long unbroken tokens (data URIs, selectors, paths) must not force a
   paragraph wider than the screen on a narrow phone */
:not(pre) > code { overflow-wrap: anywhere; word-break: break-word; }

code {
  background: var(--slate-700);
  border: 1px solid var(--slate-600);
  padding: 0.12em 0.42em;
  border-radius: 5px;
  color: var(--lime-400);
}

pre {
  background: var(--slate-900);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.6;
  color: var(--ink-200);
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

hr {
  border: 0;
  border-top: 1px solid var(--slate-700);
  margin: 2.5rem 0;
}

/* Visible, unmistakable focus */
:focus-visible {
  outline: 3px solid var(--lime-500);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lime-500);
  color: var(--slate-900);
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3rem, 7vw, 5.25rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }

.prose { max-width: var(--maxw-prose); }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--lime-600); }

/* Small monospace label — used instead of all-caps eyebrow text */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-400);
  margin-bottom: 0.9rem;
}
.tag::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--lime-600);
}

.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  color: var(--ink-300);
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   4. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 17, 22, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--slate-700);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -0.03em;
  color: var(--ink-100);
  text-decoration: none;
  flex: none;
}
.brand:hover { text-decoration: none; color: var(--ink-100); }
.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  display: block;
}
.brand span em { font-style: normal; color: var(--lime-500); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--ink-300);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-links a:hover {
  color: var(--ink-100);
  background: var(--slate-750);
  text-decoration: none;
}
.nav-links a[aria-current="page"] {
  color: var(--lime-500);
  background: rgba(198, 242, 78, 0.08);
}

.nav-toggle {
  display: none;
  background: var(--slate-750);
  border: 1px solid var(--slate-600);
  color: var(--ink-100);
  border-radius: 9px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  align-items: center;
  gap: 0.45rem;
}
.nav-toggle:hover { border-color: var(--lime-600); }
.nav-toggle svg { width: 17px; height: 17px; }

@media (max-width: 1060px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--slate-850);
    border-bottom: 1px solid var(--slate-700);
    padding: 0.5rem var(--gutter) 1.1rem;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 0.72rem 0.5rem; font-size: 1rem; }
  .nav { position: relative; }
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--slate-700);
  background:
    radial-gradient(120% 80% at 76% 6%, rgba(198, 242, 78, 0.10), transparent 58%),
    radial-gradient(90% 70% at 8% 100%, rgba(102, 224, 192, 0.07), transparent 60%),
    var(--slate-900);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.032) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 12%, transparent 78%);
  pointer-events: none;
}

.hero-arcs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}
.hero-arcs path {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  animation: draw-arc 2.1s var(--ease) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes draw-arc { to { stroke-dashoffset: 0; } }

.hero-inner {
  position: relative;
  z-index: 2;
  padding-block: clamp(3.4rem, 9vw, 6.2rem) clamp(3rem, 7vw, 4.75rem);
  max-width: 58rem;
}

.hero h1 {
  font-size: clamp(2rem, 6.2vw, 4rem);
  letter-spacing: -0.035em;
  margin-bottom: 0.5em;
  overflow-wrap: break-word;
}
.hero h1 .accent { color: var(--lime-500); }

/* Below the breakpoint the phrase is allowed to wrap, so the swept underline
   (which assumes a single line box) is replaced by a plain text decoration. */
@media (max-width: 719px) {
  .hero h1 .accent {
    text-decoration: underline;
    text-decoration-color: var(--lime-600);
    text-decoration-thickness: 0.07em;
    text-underline-offset: 0.12em;
  }
}
@media (min-width: 720px) {
  .hero h1 .accent {
    position: relative;
    white-space: nowrap;
  }
  .hero h1 .accent::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0.06em;
    height: 0.09em;
    background: var(--lime-600);
    opacity: 0.42;
    transform-origin: left;
    transform: scaleX(0);
    animation: swipe 700ms var(--ease) 900ms forwards;
  }
}
@keyframes swipe { to { transform: scaleX(1); } }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.9rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 4vw, 2.6rem);
  margin-top: 2.6rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--slate-700);
  list-style: none;
  padding-left: 0;
}
.hero-stats li { max-width: 20ch; }
.hero-stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--ink-100);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero-stats span { font-size: 0.85rem; color: var(--ink-400); }

/* Entrance: one deliberate sequence, no looping */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 700ms var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-arcs path { stroke-dashoffset: 0; }
  .hero h1 .accent::after { transform: scaleX(1); }
}

/* --------------------------------------------------------------------------
   6. Buttons & controls
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.78rem 1.25rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45; cursor: not-allowed; transform: none;
}

.btn--primary {
  background: var(--lime-500);
  color: #0b0e13;
  border-color: var(--lime-500);
}
.btn--primary:hover { background: var(--lime-400); border-color: var(--lime-400); color: #0b0e13; }

.btn--ghost {
  background: transparent;
  color: var(--ink-100);
  border-color: var(--slate-600);
}
.btn--ghost:hover { border-color: var(--ink-400); background: var(--slate-750); color: var(--ink-100); }

.btn--sm { padding: 0.52rem 0.85rem; font-size: 0.85rem; border-radius: 8px; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

label, .field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-200);
  margin-bottom: 0.4rem;
}
.hint { font-size: 0.82rem; color: var(--ink-400); margin-top: 0.35rem; }

input[type="text"], input[type="email"], input[type="url"], input[type="number"],
input[type="date"], input[type="password"], input[type="search"],
textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-100);
  background: var(--slate-900);
  border: 1px solid var(--slate-600);
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.8rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.6; resize: vertical; min-height: 190px; }
input:hover, textarea:hover, select:hover { border-color: var(--slate-600); }
input:focus, textarea:focus, select:focus {
  border-color: var(--lime-600);
  box-shadow: 0 0 0 3px var(--lime-glow);
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-500); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%237c8794' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 11px;
  padding-right: 2.1rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--lime-500);
  height: 1.4rem;
}
input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 3px;
  background: var(--slate-900);
  border: 1px solid var(--slate-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--lime-500); width: 1rem; height: 1rem; }

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-200);
  margin-bottom: 0;
  cursor: pointer;
}

.field { margin-bottom: 1.1rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }

/* Drop zone for file-based tools */
.dropzone {
  border: 1.5px dashed var(--slate-600);
  border-radius: var(--radius);
  background: var(--slate-900);
  padding: 2.1rem 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--lime-600);
  background: rgba(198, 242, 78, 0.05);
}
.dropzone strong { display: block; color: var(--ink-100); font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 0.3rem; }
.dropzone span { font-size: 0.86rem; color: var(--ink-400); }
.dropzone input[type="file"] { display: none; }

/* --------------------------------------------------------------------------
   7. Cards & tool grid
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 0.95rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.2rem;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.tool-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--accent, var(--lime-500));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--dur) var(--ease);
}
.tool-card:hover, .tool-card:focus-visible {
  border-color: var(--slate-600);
  background: var(--slate-750);
  transform: translateY(-2px);
  text-decoration: none;
}
.tool-card:hover::after, .tool-card:focus-visible::after { transform: scaleY(1); }
.tool-card h3 {
  font-size: 1.03rem;
  margin: 0;
  color: var(--ink-100);
  letter-spacing: -0.015em;
}
.tool-card p { font-size: 0.875rem; color: var(--ink-400); margin: 0; line-height: 1.55; }
.tool-card .idx {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-500);
}

.cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.35rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--slate-700);
}
.cat-head h2 { margin: 0; }
.cat-head .count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-400); }
.cat-head a { font-size: 0.88rem; font-weight: 600; }

/* Feature strip on home */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.feature {
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.45rem;
}
.feature h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.feature p { font-size: 0.9rem; color: var(--ink-400); margin: 0; }
.feature .ico {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(198, 242, 78, 0.1);
  border: 1px solid rgba(198, 242, 78, 0.22);
  margin-bottom: 0.9rem;
}
.feature .ico svg { width: 17px; height: 17px; stroke: var(--lime-500); }

/* --------------------------------------------------------------------------
   8. Tool page shell
   -------------------------------------------------------------------------- */
.crumbs {
  font-size: 0.82rem;
  color: var(--ink-500);
  padding-top: 1.5rem;
  margin-bottom: 0.35rem;
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.crumbs li::after { content: "/"; margin-left: 0.4rem; color: var(--slate-600); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--ink-400); }
.crumbs a:hover { color: var(--lime-500); }

.tool-head { padding-block: 0.4rem 1.9rem; border-bottom: 1px solid var(--slate-700); }
.tool-head h1 { margin-bottom: 0.35em; }
.tool-head .lead { margin: 0; }

.panel {
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius);
  padding: clamp(1.15rem, 3vw, 1.7rem);
  margin-block: 1.9rem;
}
.panel--flush { padding: 0; overflow: hidden; }

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.panel-head h2 { font-size: 1.1rem; margin: 0; }

.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 780px) { .io-grid { grid-template-columns: 1fr; } }

.out-box {
  background: var(--slate-900);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  min-height: 60px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  color: var(--ink-100);
}
.out-box:empty::before { content: "Output will appear here."; color: var(--ink-500); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}
.stat {
  background: var(--slate-900);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  /* Shrinks on narrow screens so long values (large currency figures,
     grouped thousands) stay on one line instead of being clipped. */
  font-size: clamp(1.05rem, 4.4vw, 1.5rem);
  color: var(--lime-500);
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}
.stat span { font-size: 0.76rem; color: var(--ink-400); }

.note {
  display: flex;
  gap: 0.7rem;
  background: var(--slate-750);
  border: 1px solid var(--slate-700);
  border-left: 3px solid var(--lime-600);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--ink-300);
  margin-block: 1.3rem;
}
.note strong { color: var(--ink-100); }
.note--warn { border-left-color: var(--warn); }

.msg { font-size: 0.87rem; margin-top: 0.7rem; min-height: 1.2em; }
.msg--ok { color: var(--ok); }
.msg--err { color: var(--err); }

.updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-500);
  margin-top: 1.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--slate-700);
}

/* FAQ */
.faq { margin-top: 1rem; }
.faq details {
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-sm);
  background: var(--slate-800);
  padding: 0.9rem 1.05rem;
  margin-bottom: 0.6rem;
}
.faq details[open] { border-color: var(--slate-600); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-100);
  font-family: var(--font-display);
  font-size: 0.99rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--lime-500);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0.75rem 0 0; font-size: 0.92rem; color: var(--ink-300); }

/* Related tools */
.related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.related a {
  display: block;
  border: 1px solid var(--slate-700);
  background: var(--slate-800);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--ink-100);
  font-weight: 600;
  font-size: 0.93rem;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.related a:hover { border-color: var(--lime-600); background: var(--slate-750); text-decoration: none; }
.related a small { display: block; font-weight: 400; color: var(--ink-400); font-size: 0.8rem; margin-top: 0.15rem; }

/* Steps */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 1rem 0 1.4rem; }
.steps li {
  counter-increment: s;
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 0.8rem;
  color: var(--ink-300);
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 0.1rem;
  width: 1.6rem; height: 1.6rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(198, 242, 78, 0.1);
  border: 1px solid rgba(198, 242, 78, 0.28);
  color: var(--lime-500);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* Tables */
.table-scroll { overflow-x: auto; margin-block: 1.2rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--slate-700); }
th { color: var(--ink-100); font-weight: 600; font-family: var(--font-display); font-size: 0.86rem; }
td { color: var(--ink-300); }

/* Ad slot — deliberately labelled and separated from tool controls */
.ad-slot {
  margin-block: 2.2rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--slate-700);
  border-bottom: 1px solid var(--slate-700);
  text-align: center;
  min-height: 90px;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-500);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--slate-900);
  border-top: 1px solid var(--slate-700);
  margin-top: 3rem;
  padding-block: clamp(2.6rem, 6vw, 4rem) 1.6rem;
  font-size: 0.89rem;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(1.6rem, 4vw, 2.6rem);
}
@media (max-width: 720px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-top { grid-template-columns: 1fr; } }

.footer-brand p {
  color: var(--ink-400);
  font-size: 0.88rem;
  max-width: 34ch;
  margin: 0.85rem 0 0;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-100);
  margin-bottom: 0.85rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.42rem; }
.footer-col a { color: var(--ink-400); font-size: 0.86rem; }
.footer-col a:hover { color: var(--lime-500); text-decoration: none; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  justify-content: space-between;
  align-items: center;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.3rem;
  border-top: 1px solid var(--slate-700);
  color: var(--ink-500);
  font-size: 0.82rem;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-bottom a { color: var(--ink-500); }
.footer-bottom a:hover { color: var(--lime-500); text-decoration: none; }

/* --------------------------------------------------------------------------
   10. Tool-specific helpers
   -------------------------------------------------------------------------- */
/* Chequerboard marks transparent areas. Kept low-contrast so it reads as a
   surface rather than competing with the image sitting on it. */
.preview-shell {
  --chk: rgba(255, 255, 255, 0.038);
  background-color: var(--slate-900);
  background-image:
    linear-gradient(45deg, var(--chk) 25%, transparent 25%, transparent 75%, var(--chk) 75%),
    linear-gradient(45deg, var(--chk) 25%, transparent 25%, transparent 75%, var(--chk) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: grid;
  place-items: center;
  min-height: 190px;
}
.preview-shell canvas, .preview-shell img { max-width: 100%; height: auto; border-radius: 4px; }

.swatch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.7rem; }
.swatch {
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--slate-900);
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  width: 100%;
}
.swatch:hover { border-color: var(--lime-600); }
.swatch .chip { height: 66px; display: block; }
.swatch .val {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.45rem 0.55rem;
  color: var(--ink-200);
}

.diff-out { font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.7; }
.diff-out ins { background: rgba(110, 231, 168, 0.16); color: #b9f5d4; text-decoration: none; display: block; padding: 0 0.35rem; border-left: 2px solid var(--ok); }
.diff-out del { background: rgba(255, 122, 117, 0.14); color: #ffc3c1; text-decoration: none; display: block; padding: 0 0.35rem; border-left: 2px solid var(--err); }
.diff-out .same { display: block; padding: 0 0.35rem; color: var(--ink-400); border-left: 2px solid transparent; }

mark.hit { background: var(--lime-500); color: #0b0e13; border-radius: 3px; padding: 0 1px; }

.meter { height: 9px; border-radius: 99px; background: var(--slate-700); overflow: hidden; margin: 0.9rem 0 0.5rem; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--err); transition: width 300ms var(--ease), background 300ms var(--ease); }

.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--slate-700); font-size: 0.88rem; }
.kv li:last-child { border-bottom: 0; }
.kv b { color: var(--ink-100); font-weight: 600; }
.kv span { color: var(--ink-300); font-family: var(--font-mono); font-size: 0.84rem; text-align: right; word-break: break-word; }

.md-preview h1, .md-preview h2, .md-preview h3 { margin-top: 1.1em; }
.md-preview img { border-radius: 6px; }
.md-preview blockquote {
  margin: 0 0 1em;
  padding-left: 1rem;
  border-left: 3px solid var(--lime-600);
  color: var(--ink-300);
}
.md-preview table { margin-bottom: 1em; }

.type-test {
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.9;
  background: var(--slate-900);
  border: 1px solid var(--slate-700);
  border-radius: var(--radius-sm);
  padding: 1rem;
  user-select: none;
}
.type-test .ok { color: var(--ok); }
.type-test .bad { color: var(--err); text-decoration: underline; }
.type-test .cur { background: var(--lime-500); color: #0b0e13; border-radius: 2px; }

.gradient-preview { height: 190px; border-radius: var(--radius-sm); border: 1px solid var(--slate-700); }
.shadow-stage {
  display: grid;
  place-items: center;
  min-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-700);
  background: var(--slate-750);
}
.shadow-box { width: 150px; height: 150px; border-radius: 16px; background: var(--ink-100); }

.copy-field {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.copy-field .out-box { flex: 1; min-height: 0; padding: 0.6rem 0.8rem; }

.list-out { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.list-out li {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  background: var(--slate-900);
  border: 1px solid var(--slate-700);
  border-radius: 7px;
  padding: 0.5rem 0.7rem;
  color: var(--ink-100);
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  word-break: break-all;
}

.thumb-row { display: flex; flex-wrap: wrap; gap: 1rem 1.1rem; align-items: flex-end; }
.thumb-row figure { margin: 0; text-align: center; }
.thumb-row figcaption { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-400); margin-top: 0.35rem; }
.thumb-row canvas { border: 1px solid var(--slate-700); border-radius: 6px; background: var(--slate-900); }

.contact-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---- Grouped hub grids (used on the 30-tool image hub) ---- */
.grid-group {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--slate-600);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.grid-group:first-child { margin-top: 0; }
.grid-group span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  white-space: nowrap;
}
