/* The tools, from the 2026-11 C3 design (`mockups/landing/C3 Tools.dc.html`): the /tools hub, and
 * the six tool pages listed in `src/data/features.json` (`body: tool`, loaded after feature.css).
 *
 * The tool pages keep feature.css's plain semantic markup; this sheet turns its single reading
 * column into the design's full-width bands: a two-column hero, sections alternating between the
 * page's ground and a lighter band, steps as a lit timeline, the worked example as tiles, the
 * limits as a callout, the questions as the shared accordion look and the next pages as cards.
 * A `.feature__pair` (entry-check) sets two sections side by side on a wide screen.
 */

:root { --page-bg: var(--ground); }
body.tool, body.tools-hub { background: var(--ground); font-size: 15px; line-height: 1.55; }

/* -- The strip of tools under the nav (build.py `tool_strip`) ------------------------------------- */

.tool-strip {
  position: sticky;
  top: 68px;
  z-index: 15;
  border-bottom: 1px solid var(--hair);
  background: rgba(5, 8, 15, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.tool-strip__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tool-strip__inner::-webkit-scrollbar { display: none; }
.tool-strip a {
  position: relative;
  flex: none;
  padding: 14px 14px 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.tool-strip a:hover { color: var(--text); }
.tool-strip a[aria-current='page'] { color: var(--text); }
.tool-strip a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: rgb(var(--rgb));
  box-shadow: 0 0 12px rgba(var(--rgb), 0.8);
}
.tool-strip__all { color: var(--text-dim) !important; padding-left: 0 !important; }
@media (max-width: 700px) { .tool-strip__inner { padding: 0 12px; } }

/* -- The page -------------------------------------------------------------------------------------- */

/* Each band spans the page; its content sits in the C3 column. */
body.tool .feature { max-width: none; padding: 0 0 0; }
body.tool .feature__hero,
body.tool .feature > .feature__section,
body.tool .feature__pair,
body.tool .feature__next {
  padding-inline: max(40px, calc((100% - 1200px) / 2));
  padding-block: clamp(80px, 9vw, 128px);
  border-top: 1px solid var(--hair);
}
@media (max-width: 700px) {
  body.tool .feature__hero,
  body.tool .feature > .feature__section,
  body.tool .feature__pair,
  body.tool .feature__next { padding-inline: 20px; }
}

/* The hero: the kicker and heading on the left, the lede and the buttons on the right. */
body.tool .feature__hero {
  position: relative;
  overflow: hidden;
  border-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 24px 72px;
  align-items: end;
  background: linear-gradient(180deg, #0C1522, #08101B);
}
body.tool .feature__hero::before, body.tool .feature__hero::after { content: none; }
body.tool .feature__hero > * { position: relative; }
body.tool .feature__hero .eyebrow {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 600 12.5px/1.3 var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tc, var(--brand-light));
}
body.tool .feature__hero .eyebrow::before { content: ''; width: 24px; height: 2px; background: currentColor; flex: none; }
body.tool .feature__hero h1 {
  grid-column: 1;
  margin: 0;
  font: 600 clamp(38px, 4.8vw, 64px)/1.02 var(--font-display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}
body.tool .feature__lede { grid-column: 2; grid-row: 1 / span 2; align-self: end; font-size: 17px; line-height: 1.65; color: var(--text-bright); }
body.tool .feature__cta { grid-column: 2; margin: 0; }
@media (max-width: 1019px) {
  body.tool .feature__lede, body.tool .feature__cta { grid-column: 1; grid-row: auto; }
}
body.tool .feature .btn {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
}
body.tool .feature .btn--primary {
  background: linear-gradient(180deg, var(--brand-vivid), var(--brand));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(52, 104, 228, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
body.tool .feature .btn--ghost {
  border: 1px solid rgba(140, 175, 235, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
body.tool .feature .btn--ghost:hover { background: rgba(255, 255, 255, 0.07); }

/* Sections alternate between the ground and the band. */
body.tool .feature > .feature__section,
body.tool .feature__pair { background: var(--ground); }
body.tool .feature > :nth-child(odd of .feature__section, .feature__pair) { background: linear-gradient(180deg, #0C1522, #08101B); border-top-color: rgba(140, 175, 235, 0.10); }
body.tool .feature__section { gap: 18px; }
body.tool .feature__section > * { max-width: 860px; }
body.tool .feature__section > .path-figure, body.tool .feature__section > .feature__table { max-width: none; }
body.tool .feature__section h2 {
  margin: 0;
  font: 600 clamp(28px, 3vw, 40px)/1.1 var(--font-display);
  letter-spacing: -0.03em;
}
body.tool .feature__section p { font-size: 16px; line-height: 1.7; color: var(--text-muted); }
body.tool .feature__section strong, body.tool .feature__section b { color: var(--text); }

/* Two sections side by side: each loses its own band and padding to the pair's. */
.feature__pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 48px 72px;
  align-items: start;
}
.feature__pair .feature__section, .feature__stack .feature__section { padding: 0; border: 0; background: none; }
.feature__stack { display: flex; flex-direction: column; gap: 24px; }
.feature__stack .feature__section {
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--hair-2);
  background: #0A111C;
}
body.tool .feature__stack .feature__section h2 { font-size: 22px; letter-spacing: -0.02em; }
body.tool .feature__stack .feature__section p { font-size: 14.5px; line-height: 1.65; }

/* Steps: a lit timeline of numbered discs. */
body.tool .feature__steps { position: relative; gap: 22px; }
body.tool .feature__steps::before {
  content: '';
  position: absolute;
  left: 20px; top: 40px; bottom: 20px;
  width: 1px;
  background: linear-gradient(rgba(var(--trgb, 91, 149, 250), 0.5), rgba(91, 149, 250, 0.1));
}
body.tool .feature__steps li { padding-left: 56px; font-size: 15px; line-height: 1.6; color: var(--text-muted); }
body.tool .feature__steps li::before {
  width: 40px; height: 40px;
  top: -4px;
  background: var(--ground);
  border: 1px solid rgba(var(--trgb, 91, 149, 250), 0.5);
  box-shadow: 0 0 16px -4px rgba(var(--trgb, 91, 149, 250), 0.6);
  color: rgb(var(--trgb, 91, 149, 250));
  font: 600 16px var(--font-display);
}

/* The worked example: its label/value pairs as a grid of tiles. */
body.tool .feature__example {
  position: relative;
  gap: 18px;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid rgba(var(--trgb, 91, 149, 250), 0.3);
  background: linear-gradient(180deg, var(--surface-raised) 0%, var(--surface) 200px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 90px -40px rgba(var(--trgb, 91, 149, 250), 0.4);
}
body.tool .feature__example h3 { margin: 0; font: 600 24px var(--font-display); letter-spacing: -0.02em; }
body.tool .feature__example dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--hair-2);
}
body.tool .feature__example dl > dt, body.tool .feature__example dl > dd { background: #0B131E; padding: 0 16px; margin: 0; text-align: left; }
body.tool .feature__example dt { padding-top: 14px !important; font-size: 12px; color: var(--text-dim); }
body.tool .feature__example dd { padding-bottom: 14px !important; font: 600 15px var(--font-sans); color: var(--text); }
/* A dt and its dd are one tile: lay the pairs out down two columns. */
body.tool .feature__example dl { grid-auto-flow: dense; }
body.tool .feature__example dt:nth-of-type(odd) { grid-column: 1; }
body.tool .feature__example dd:nth-of-type(odd) { grid-column: 1; }
body.tool .feature__example dt:nth-of-type(even) { grid-column: 2; }
body.tool .feature__example dd:nth-of-type(even) { grid-column: 2; }
/* A hairline between rows of tiles: across the top of every tile after the first row. */
body.tool .feature__example dt:nth-of-type(n + 3) { box-shadow: inset 0 1px 0 var(--hair-2); }
body.tool .feature__example p { font-size: 14.5px; line-height: 1.65; }

/* What it does not do: a callout with the warning colour. */
body.tool .feature__limits h2::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 12px;
  vertical-align: 0.15em;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
}
body.tool .feature > .feature__limits { border-left: 0; }
.feature__stack .feature__limits { border: 1px solid rgba(251, 191, 36, 0.25); background: rgba(251, 191, 36, 0.04); }

/* Questions: the shared accordion look (`.acc` in components.css), on feature.css's markup. */
body.tool .feature__faq { align-items: stretch; gap: 10px; }
body.tool .feature__faq > * { max-width: 880px; width: 100%; margin-inline: auto; }
body.tool .feature__faq h2 { margin: 0 auto 20px; text-align: center; }
body.tool .feature__faq details {
  padding: 0;
  border: 1px solid var(--hair-2);
  border-radius: 14px;
  background: rgba(10, 17, 28, 0.6);
  transition: background 300ms, border-color 300ms;
}
body.tool .feature__faq details[open] { border-color: rgba(var(--trgb, 91, 149, 250), 0.4); background: rgba(22, 35, 55, 0.8); }
body.tool .feature__faq summary { padding: 18px 22px; font-size: 16px; }
body.tool .feature__faq summary::after {
  content: '+';
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(91, 149, 250, 0.14);
  color: var(--brand-lighter);
  transition: transform 400ms var(--ease-settle);
}
body.tool .feature__faq details[open] summary::after { content: '+'; transform: rotate(45deg); }
body.tool .feature__faq details p { margin: 0; padding: 0 22px 20px; font-size: 15px; }

/* Next: large cards. */
body.tool .feature__next { background: var(--ground); gap: 20px; }
body.tool .feature__next h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 12.5px var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-light);
}
body.tool .feature__next h2::before { content: ''; width: 24px; height: 2px; background: currentColor; }
body.tool .feature__next-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
body.tool .feature__next-grid a {
  position: relative;
  gap: 4px;
  padding: 26px 64px 26px 26px;
  border-radius: 18px;
  border: 1px solid var(--hair-2);
  background: linear-gradient(180deg, var(--surface) 0%, #0B131E 160px);
}
body.tool .feature__next-grid a::after {
  content: '\2192';
  position: absolute;
  right: 26px; top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--brand-lighter);
  transition: transform 300ms var(--ease-out);
}
body.tool .feature__next-grid a:hover { transform: translateY(-3px); border-color: rgba(91, 149, 250, 0.5); background: linear-gradient(180deg, var(--surface) 0%, #0B131E 160px); }
body.tool .feature__next-grid a:hover::after { transform: translate(4px, -50%); }
body.tool .feature__next-grid strong { font: 600 22px var(--font-display); }
body.tool .feature__next-grid span { font-size: 14.5px; color: var(--text-muted); }

/* The guide's call to action, which the build inserts above "Next" (`guide_cta`). */
body.tool .guide-cta { margin: 0; border-radius: 0; border-inline: 0; padding-inline: max(40px, calc((100% - 1200px) / 2)); }

/* The entry-check path chart in the page's green. */
body.tool .pc-signal { stroke: var(--positive); }
body.tool .pc-band { fill: var(--positive); fill-opacity: 0.12; }
body.tool .pc-dot, body.tool .pc-callout:not(.pc-callout--dim) { fill: var(--positive); }
body.tool .path-key--signal::before { background: var(--positive); }
body.tool .path-key--band::before { background: rgba(52, 211, 153, 0.2); }
body.tool .path-figure {
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: #08101B;
  box-shadow: 0 40px 100px -40px rgba(52, 211, 153, 0.3);
}

/* Each tool page's accent, from its place in features.json. */
body.tool:has(.tool-strip a[aria-current='page'][href*='multi-market']) { --trgb: 91, 149, 250; }
body.tool:has(.tool-strip a[aria-current='page'][href*='trading-alerts']) { --trgb: 244, 114, 182; }
body.tool:has(.tool-strip a[aria-current='page'][href$='/backtesting']) { --trgb: 245, 158, 11; }
body.tool:has(.tool-strip a[aria-current='page'][href*='entry-check']) { --trgb: 52, 211, 153; }
body.tool:has(.tool-strip a[aria-current='page'][href*='parameter-search']) { --trgb: 45, 212, 191; }
body.tool:has(.tool-strip a[aria-current='page'][href*='strategy-optimisation']) { --trgb: 167, 139, 250; }
body.tool .feature__hero .eyebrow { --tc: rgb(var(--trgb, 91, 149, 250)); }

/* -- The /tools hub ------------------------------------------------------------------------------- */

.tools-hub__head { position: relative; overflow: hidden; padding: 0; }
.tools-hub__sky { position: absolute; inset: 0; pointer-events: none; }
.tools-hub__glow { left: 50%; top: -360px; width: 1400px; height: 900px; margin-left: -700px;
  background: radial-gradient(closest-side, rgba(52, 104, 228, 0.24), rgba(52, 104, 228, 0.06) 55%, transparent); }
.tools-hub__glow-teal { right: 6%; top: 200px; width: 460px; height: 420px; --c: rgba(45, 212, 191, 0.10); }
.tools-hub__stars { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.tools-hub__copy { position: relative; padding-top: clamp(72px, 9vw, 120px); padding-bottom: clamp(80px, 9vw, 128px); display: flex; flex-direction: column; gap: 20px; }
.tools-hub__copy .lede { max-width: 680px; }
.tool-cards {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}
.tool-card {
  --lit-c: rgba(var(--rgb), 0.12);
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--hair-2);
  background: linear-gradient(180deg, var(--surface) 0%, #0B131E 180px);
  color: var(--text);
  transition: transform 400ms var(--ease-settle), border-color 300ms, opacity 900ms var(--ease-out);
}
.tool-card:hover { color: var(--text); transform: translateY(-4px); border-color: rgba(var(--rgb), 0.55); }
.tool-card > * { position: relative; }
.tool-card__top { display: flex; align-items: center; justify-content: space-between; }
.tool-card__kick { display: inline-flex; align-items: center; gap: 8px; font: 600 11.5px var(--font-mono); letter-spacing: 1.5px; color: rgb(var(--rgb)); }
.tool-card__kick::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.tool-card__top .i { width: 20px; height: 20px; color: rgb(var(--rgb)); }
.tool-card__name { margin-top: auto; font: 600 26px var(--font-display); letter-spacing: -0.02em; }
.tool-card__blurb { font-size: 14.5px; line-height: 1.55; color: var(--text-muted); }
.tools-hub__more { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 8px; }

@media (max-width: 700px) {
  body.tool .path-figure { padding: 16px 12px; }
  body.tool .feature__example, .feature__stack .feature__section { padding: 22px; }
}
