/* Tools section: /tools/ grid and /tools/<slug>/ pages.
   Loaded after styles.css. Tokens, buttons, .pagehead, .section__*, .inds,
   .cap__link and .cta come from styles.css. Only new pieces live here.
   Vendor marks show in their own colours (assets/images/tools/<slug>.svg). */

/* ---------- hero ---------- */
.toolhead .eyebrow a { color: inherit; text-decoration: none; }
.toolhead .eyebrow a:hover { color: var(--text); }
.toolhead__mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.toolhead__logo { width: 36px; height: 36px; object-fit: contain; }
.toolhead__title { max-width: 18ch; }
.toolhead { padding-bottom: clamp(1rem, 2vw, 1.5rem); }
.toolhead__answer { align-self: flex-start; max-width: 62ch; font-size: 1.12rem; }
.toolhead__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
}
.toolhead__vendor {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.toolhead__vendor:hover { text-decoration-color: currentColor; }
.toolhead__badge,
.tile__badge {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--accent-tone);
}

/* ---------- section rhythm ---------- */
.toolsec { padding: clamp(2rem, 4vw, 3rem) 0; }
.toolsec__head { max-width: 680px; margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem); }
.toolsec__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.toolsec__lede {
  margin: 0.7rem 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* inline links in copy */
.toolhead__answer a,
.toolsec__lede a,
.toolfact dd a,
.toolcard p a,
.checklist a,
.callout__text a,
.tfaq__a a,
.tiles__empty a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s var(--ease);
}
.toolhead__answer a:hover,
.toolsec__lede a:hover,
.toolfact dd a:hover,
.toolcard p a:hover,
.checklist a:hover,
.callout__text a:hover,
.tfaq__a a:hover,
.tiles__empty a:hover { text-decoration-color: currentColor; }

/* ---------- fact cards ---------- */
.toolfacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 0.75rem;
  margin: 0;
}
.toolfact {
  padding: 1.1rem 1.2rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.toolfact dt {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.toolfact dd {
  margin: 0.5rem 0 0;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

/* ---------- numbered cards (what we build, how we choose) ---------- */
.toolcards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.toolcard {
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.toolcard__num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--accent-tone);
}
.toolcard__title {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.toolcard p { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--text-muted); }

/* ---------- logo chips (works with, more tools) ---------- */
.toolworks { margin-top: clamp(1.5rem, 3vw, 2rem); }
.toolworks__label {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.logochips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.logochip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem 0.45rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
a.logochip:hover { border-color: var(--text); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.logochip__mark { width: 20px; height: 20px; object-fit: contain; flex: none; }
.toolworks--others { margin-top: clamp(2rem, 4vw, 3rem); }
.toolworks--others .cap__link { margin-top: 1.1rem; }

/* ---------- callout (one per page) ---------- */
.callout {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  padding: 1.2rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-tone);
  border-radius: var(--radius-sm);
}
.callout__label {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-tone);
}
.callout__text { margin: 0; font-size: 1.05rem; font-weight: 500; line-height: 1.5; color: var(--text); }

/* ---------- fit: two checklists ---------- */
.toolfit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.toolfit__col {
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toolfit__col--no { background: var(--bg-elev); }
.toolfit__title {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.checklist li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  line-height: 1.45;
  color: var(--text-muted);
}
.tick { margin-top: 0.12rem; fill: var(--accent-tone); stroke: #fff; }
.tick--no { fill: none; stroke: var(--text-soft); }

/* ---------- Attio panel ---------- */
.toolattio {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  background-image:
    linear-gradient(rgba(24, 24, 27, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 24, 27, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
}
.toolattio__head .toolsec__title { margin-top: 1.1rem; }
.toolattio__head .cap__link { margin-top: 1.2rem; }
.toolattio .checklist li { padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.credential {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem 0.45rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  transition: border-color 0.3s var(--ease);
}
.credential:hover { border-color: var(--text); }
.credential__mark { width: 18px; height: 18px; object-fit: contain; }

/* ---------- FAQ (details/summary, no JS) ---------- */
.tfaq { max-width: 820px; border-top: 1px solid var(--border-strong); }
.tfaq__item { border-bottom: 1px solid var(--border-strong); }
.tfaq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.tfaq__q::-webkit-details-marker { display: none; }
.tfaq__q:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 4px; }
.tfaq__icon { position: relative; flex: none; width: 14px; height: 14px; }
.tfaq__icon::before,
.tfaq__icon::after {
  content: "";
  position: absolute;
  top: 6.25px;
  left: 0;
  width: 14px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease);
}
.tfaq__icon::after { transform: rotate(90deg); }
.tfaq__item[open] .tfaq__icon::after { transform: rotate(0deg); }
.tfaq__a p { margin: 0 0 1.2rem; max-width: 68ch; line-height: 1.6; color: var(--text-muted); }

/* ---------- /tools/ : search + tile grid ---------- */
.toolgrid { padding: 0 0 clamp(2.5rem, 5vw, 4rem); }
.toolsearch { position: relative; display: flex; align-items: center; margin-bottom: clamp(1.25rem, 2.5vw, 2rem); }
.toolsearch[hidden] { display: none; }
.toolsearch__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.toolsearch__icon { position: absolute; left: 1.1rem; color: var(--text-soft); pointer-events: none; }
.toolsearch__input {
  width: 100%;
  height: 56px;
  padding: 0 7.5rem 0 3rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.toolsearch__input::placeholder { color: var(--text-soft); }
.toolsearch__input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px var(--ring); }
.toolsearch__input::-webkit-search-cancel-button { display: none; }
.toolsearch__count {
  position: absolute;
  right: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  pointer-events: none;
}
.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
}
.tile[hidden] { display: none; }
.tile__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 180px;
  padding: 1.15rem 1.05rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.3rem; }
.tile__logo { width: 28px; height: 28px; object-fit: contain; flex: none; }
.tile__cat {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: right;
  line-height: 1.5;
}
.tile__name { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.tile__badge { margin-top: 0.4rem; }
.tile__line { margin-top: 0.5rem; font-size: 0.85rem; line-height: 1.45; color: var(--text-muted); }
.tile__link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tile__link:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.tiles__empty { margin: 2rem 0 0; color: var(--text-muted); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .toolfit,
  .toolattio { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .toolcards { grid-template-columns: 1fr; }
  .toolcard__title { margin-top: 0.9rem; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile__link { min-height: 0; padding: 1rem 0.85rem 1.1rem; }
  .tile__top { flex-direction: column; margin-bottom: 0.9rem; }
  .tile__cat { text-align: left; }
  .toolsearch__input { padding-right: 1rem; }
  .toolsearch__count { display: none; }
  .toolhead__mark { width: 56px; height: 56px; }
  .toolhead__logo { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile__link, .logochip, .credential, .tfaq__icon::before, .tfaq__icon::after, .toolsearch__input { transition: none; }
  .tile__link:hover, a.logochip:hover { transform: none; }
}
