/* Tools index page, rebuilt with the Neuroviax site identity.

   The site sets its root font size to about 9.4px, so rem values are tiny
   here. Every size on this page is therefore in px, taken from the
   measured template: body 15px DM Sans, headings Red Hat Display 800,
   primary #e4572e, navy #121842, gray #f2f2f2.
   All rules are scoped to .tools-index. */

.tools-index {
  --navy: #121842;
  --navy-2: #1c2358;
  --primary: #e4572e;
  --primary-dark: #c9461f;
  --text: #4a4f63;
  --heading: #121842;
  --gray: #f2f2f2;
  --line: #e2e5ee;
  --white: #ffffff;
  --title-font: 'Red Hat Display', sans-serif;
  --body-font: 'DM Sans', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Cluster colours used by the inline styles of each card */
  --c-neuro: #e4572e;
  --c-cbt: #4d8ef0;
  --c-dbt: #0e8f8a;
  --c-well: #2fa36b;
  --c-prod: #b8860b;
  --c-social: #d9487a;
  --c-mh: #c93f6e;
  --c-personality: #7c4dff;

  background: var(--white);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.tools-index h1,
.tools-index h2,
.tools-index h3 {
  margin: 0;
  font-family: var(--title-font);
  font-weight: 800;
  color: var(--heading);
  line-height: 1.2;
}

.tools-index a {
  color: inherit;
  text-decoration: none;
}

/* The site sets overflow hidden on html and body, which turns body into a
   scroll box and stops position: sticky. clip hides sideways overflow the
   same way without that side effect, so the topic bar can stay in view. */
html:has(.tools-index),
html:has(.tools-index) body {
  overflow-x: clip;
  overflow-y: visible;
}

/* The shared page-title band is shorter on this page: the topics matter more */
body:has(.tools-index) #dt_pagetitle {
  padding-top: 150px;
  padding-bottom: 34px;
  min-height: 0;
}
body:has(.tools-index) #dt_pagetitle h1 {
  font-size: clamp(26px, 3vw, 38px);
}

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

/* Intro line and the tool filter */
.tools-index .ti-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 18px;
  text-align: center;
}
.tools-index .ti-lead {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}
.tools-index .ti-search input {
  width: 100%;
  padding: 12px 20px 12px 46px;
  border: 1px solid #cfd4e3;
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121842' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m20 20-4.6-4.6'/%3E%3C/svg%3E") no-repeat 18px center / 18px;
  font: 16px var(--body-font);
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(18, 24, 66, .06);
}
.tools-index .ti-search input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

/* Topic bar: sticks under the site header */
.tools-index .cluster-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(18, 24, 66, .06);
  transition: top .2s;
}
.tools-index .cluster-nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.tools-index .cluster-tab {
  --tab: var(--navy);
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font: 600 13.5px/1.3 var(--body-font);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.tools-index .cluster-tab[hidden] { display: none; }
.tools-index .cluster-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gray);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}
.tools-index .cluster-tab:hover {
  border-color: var(--tab);
  background: color-mix(in srgb, var(--tab) 7%, var(--white));
}
.tools-index .cluster-tab.active {
  border-color: var(--tab);
  background: color-mix(in srgb, var(--tab) 12%, var(--white));
}
.tools-index .cluster-tab.active .cluster-count {
  background: var(--tab);
  color: var(--white);
}
.tools-index .cluster-tab:focus-visible {
  outline: 2px solid var(--tab);
  outline-offset: 2px;
}

/* Topic sections */
.tools-index .main-content {
  padding: 36px 20px 24px;
  background: var(--gray);
}
.tools-index .ti-empty {
  max-width: 1200px;
  margin: 0 auto 24px;
  font-size: 16px;
  text-align: center;
}
.tools-index .cluster-block {
  max-width: 1200px;
  margin: 0 auto 44px;
}
.tools-index .cluster-block[hidden] { display: none; }
.tools-index .ti-head {
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 4px solid var(--c);
}
.tools-index .cluster-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
}
.tools-index .ti-count {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font: 700 12.5px var(--body-font);
}
.tools-index .ti-intro {
  margin: 4px 0 0;
  max-width: 820px;
  font-size: 15px;
  line-height: 1.55;
}

/* Cards: the whole card is the link; four across on wide screens */
.tools-index .tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.tools-index .tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(18, 24, 66, .05);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tools-index .tool-card[hidden] { display: none; }
.tools-index .tool-card:hover,
.tools-index .tool-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(18, 24, 66, .10);
}
.tools-index .tool-card:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}
.tools-index .tool-name {
  font: 800 17px/1.3 var(--title-font);
  color: var(--heading);
}
.tools-index .tool-desc {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.tools-index .tool-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.tools-index .tool-time {
  color: #5d6378;
}
.tools-index .tool-go {
  font-weight: 700;
  color: var(--primary-dark);
}
.tools-index .tool-card:hover .tool-go {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 768px) {
  body:has(.tools-index) #dt_pagetitle {
    padding-top: 120px;
    padding-bottom: 24px;
  }
  .tools-index .ti-hero {
    padding: 22px 16px 14px;
  }
  .tools-index .ti-lead {
    font-size: 15px;
  }
  .tools-index .main-content {
    padding: 28px 16px 16px;
  }
  .tools-index .cluster-title {
    font-size: 21px;
  }
  .tools-index .tool-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  /* One row that slides sideways with a finger */
  .tools-index .cluster-nav-inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 8px 16px;
  }
  .tools-index .cluster-nav-inner::-webkit-scrollbar {
    display: none;
  }
  .tools-index .cluster-tab {
    flex: 0 0 auto;
    scroll-snap-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tools-index *,
  .tools-index *::before,
  .tools-index *::after {
    transition-duration: .01ms !important;
  }
}
