/* CAT website – single stylesheet, no frameworks.
   Colors are derived from the blue CAT logo (navy #12396d/#1a54a1, light cyan bar #9cd7e4). */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --surface: #ffffff;
  --panel: #f0f3f7;
  --text: #17202b;
  --muted: #556170;
  --border: #e0e6ed;
  --accent: #1c6dcc;          /* links and buttons: >= 4.5:1 on every light background */
  --accent-hover: #1659a8;
  --accent-contrast: #ffffff;
  --brand: #4f9be6;           /* decorative lines */
  --brand-soft: #eaf3fc;      /* tints */
  --tag-bg: #a8d8e8;          /* "New" tags: colors of the logo's bottom bar */
  --tag-text: #0e2c52;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 30px rgba(16, 24, 40, .07);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1160px;
  --header-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1216;
    --bg-alt: #12171c;
    --surface: #161b21;
    --panel: #1a2027;
    --text: #e6ebf0;
    --muted: #9aa6b2;
    --border: #27303a;
    --accent: #79b8ff;
    --accent-hover: #9ccaff;
    --accent-contrast: #0e1216;
    --brand-soft: #10233a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--panel); padding: .1em .35em; border-radius: 5px; }
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: var(--accent-contrast); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons, pills, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: .92rem; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: .88rem; text-decoration: none; margin-bottom: 22px;
}
.pill:hover { border-color: var(--brand); color: var(--text); }
.pill-tag, .badge {
  background: var(--tag-bg); color: var(--tag-text); border-radius: 999px;
  padding: 2px 9px; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.badge { margin-right: 6px; vertical-align: 1px; }
.eyebrow { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-bottom: .6em; }
.more { font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; }
.more::after { content: "→"; transition: transform .15s; }
.more:hover::after { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 36px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.site-nav ul a:hover { color: var(--text); background: var(--panel); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 42px; height: 42px; color: var(--text); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 20px 20px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: 12px 8px; font-size: 1.05rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(40px, 6vw, 80px) 0 clamp(24px, 4vw, 48px);
  background: radial-gradient(900px 480px at 12% -10%, var(--brand-soft), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 3.7rem); line-height: 1.05; letter-spacing: -0.035em; }
.hero h1 .accent { color: var(--accent); display: block; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 28px; list-style: none; padding: 0; margin: 0; font-size: .95rem; color: var(--muted); }
.hero-media { margin: 0; }
.hero-media img { width: 100%; filter: drop-shadow(0 18px 28px rgba(16, 24, 40, .10)); }

/* check-mark list items (hero facts, feature lists, requirements) */
.facts li, .checks li { position: relative; padding-left: 26px; }
.facts li::before, .checks li::before {
  content: ""; position: absolute; left: 3px; top: .42em; width: 6px; height: 11px;
  border: solid var(--accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.checks { list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 8px; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 760px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.section-lead { font-size: 1.1rem; color: var(--muted); margin: 0; }
.center-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* ---------- Overview flow: input -> CAT -> outputs ---------- */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.25fr) 28px minmax(0, 1.25fr); gap: 16px; align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.flow-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.flow-step strong { font-size: 1.15rem; }
.flow-step > span:last-child { color: var(--muted); font-size: .92rem; }
.flow-k { color: var(--accent); font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.flow-cat { border-color: var(--brand); background: linear-gradient(var(--brand-soft), var(--surface)); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 8px 0 0; }
.tags li { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.flow-arrow { width: 28px; height: 28px; position: relative; }
.flow-arrow::before { content: ""; position: absolute; inset: 7px 9px 7px 3px; border: solid var(--muted); border-width: 2.5px 2.5px 0 0; transform: rotate(45deg); }
.flow-out { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.flow-out a {
  display: grid; gap: 1px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s;
}
.flow-out a:hover { border-color: var(--brand); transform: translateX(3px); }
.flow-out span { color: var(--muted); font-size: .9rem; }

@media (max-width: 900px) {
  .flow { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .flow-arrow { justify-self: center; transform: rotate(90deg); }
}

/* ---------- Feature rows ---------- */
.feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
  padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--border);
}
.feature.reverse .feature-media { order: -1; }
.feature.wide { align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.feature.wide .feature-media { grid-column: 1 / -1; }
.feature.wide .feature-text:nth-child(2) { padding-top: 2.2em; }
.feature-text p { color: var(--muted); }
.feature-text .eyebrow { color: var(--accent); }
.feature-media {
  margin: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(16px, 3vw, 28px); display: grid; gap: 12px; align-self: center;
}
.feature-media img { width: 100%; border-radius: 8px; }
.feature-media.natural img { width: auto; max-width: 100%; margin-inline: auto; }
.feature-media .swipe { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
@media (max-width: 700px) {
  .feature-media .swipe img { min-width: 640px; max-width: none; }
  .feature-media .swipe + figcaption::after { content: " Swipe to see the full figure."; }
}
@media (max-width: 900px) {   /* vector figures with small text: keep the text at about 10px or larger */
  .feature-media .swipe-wide img { min-width: 820px; max-width: none; }
  .feature-media .swipe-wide + figcaption::after { content: " Swipe to see the full figure."; }
}
.feature-media figcaption { color: var(--muted); font-size: .88rem; text-align: center; }
/* ROI figure: a volume and a surface atlas on one subject, with some of its regional values */
.roi-figure { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
/* caption, image and table line up across the cards */
.roi-figure > figure { margin: 0; display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.feature-media .roi-figure figcaption { color: var(--muted); font-size: .8rem; line-height: 1.3; text-align: left; }
.roi-figure figcaption strong { display: block; color: var(--text); font-size: .9rem; }
.feature-media .roi-figure img { width: 100%; height: auto; aspect-ratio: 1.3; object-fit: contain; border-radius: 0; }
.roi-values { width: 100%; align-self: end; border-collapse: collapse; font-size: .78rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.roi-values th, .roi-values td { padding: 4px 0; border-top: 1px solid var(--border); text-align: left; font-weight: 400; }
.roi-values thead th { border-top: 0; color: var(--muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.roi-values td, .roi-values thead th:last-child { text-align: right; white-space: nowrap; padding-left: 8px; }
.roi-values i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; background: var(--c); }
@media (max-width: 480px) { .roi-figure { grid-template-columns: minmax(0, 1fr); } }
/* VBM figure: input and label map in the first row, the three tissue maps below */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 10px; }
.tiles figure { margin: 0; grid-column: span 2; }
.tiles figure:nth-child(-n+2) { grid-column: span 3; }
.tiles figcaption { font-size: .8rem; margin-top: 6px; }
/* surface figure: cut-away with its key (thickness colors, surfaces drawn on the T1 slice) and folding measures */
.surface-main { margin: 0; display: grid; gap: 12px; }
.feature-media .surface-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font-size: .82rem; }
.surface-key span { display: inline-flex; align-items: center; gap: 6px; }
.surface-key i, .surface-folding i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #2b0b3f, #521557, #7b2064, #a7295d, #cc4150, #ea5f42, #f59055, #fbbb79, #fde3a7); }
.surface-key i { width: 80px; }
.surface-key .lines { flex-wrap: wrap; justify-content: center; column-gap: 14px; }
.surface-key .lines span::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--line); }
.surface-key .pial { --line: #11b2fc; }
.surface-key .central { --line: #ffb43c; }
.surface-key .white { --line: #3ddc2f; }
.surface-folding { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.surface-folding figure { margin: 0; display: grid; grid-row: span 3; grid-template-rows: subgrid; justify-items: center; align-items: end; }
.feature-media .surface-folding figcaption { color: var(--text); font-size: .78rem; font-weight: 600; line-height: 1.25; }
.surface-folding .cbar { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 5px; color: var(--muted); font-size: .7rem; line-height: 1.2; }
.surface-folding .cbar i { width: 30px; height: 5px; }
@media (max-width: 480px) {   /* bar above its end labels */
  .surface-folding .cbar { display: grid; grid-template-columns: auto auto; justify-content: space-between; width: min(100%, 92px); }
  .surface-folding .cbar i { grid-column: 1 / -1; grid-row: 1; width: 100%; }
  .surface-folding .cbar span:last-child { justify-self: end; }
}

.chip-group h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.2em 0 .6em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 1em; padding: 0; }
.chips li { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }

@media (max-width: 900px) {
  .feature, .feature.wide { grid-template-columns: minmax(0, 1fr); }
  .feature.reverse .feature-media { order: 0; }
  .feature.wide .feature-text:nth-child(2) { padding-top: 0; }
}

/* ---------- Approach: editorial two-column text ---------- */
.approach { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.approach-intro { position: sticky; top: calc(var(--header-h) + 32px); }
.approach-intro .eyebrow { color: var(--muted); }   /* quieter label in this text-only section */
.approach-intro h2 { margin-bottom: .6em; }
.approach-intro p { color: var(--muted); font-size: 1.05rem; }
.approach-intro .approach-ref { font-size: .95rem; padding-top: 1em; border-top: 1px solid var(--border); }
.principles { list-style: none; margin: 0; padding: 0; counter-reset: principle; }
.principles li {
  counter-increment: principle; display: grid; grid-template-columns: 2.4em minmax(0, 1fr);
  padding: 22px 0; border-top: 1px solid var(--border);
}
.principles li:last-child { border-bottom: 1px solid var(--border); }
.principles li::before { content: counter(principle); grid-row: 1 / span 2; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4; }
.principles h3 { font-size: 1.1rem; line-height: 1.35; margin: 0 0 .3em; }
.principles p { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
  .approach { grid-template-columns: minmax(0, 1fr); }
  .approach-intro { position: static; }
}

/* ---------- Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); margin: 0; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Workflow steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.steps h3 { font-size: 1.15rem; margin-top: 14px; }
.steps p { color: var(--muted); margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-weight: 700; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Disclosures ---------- */
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
details > summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details[open] > summary::after { content: "–"; }
.under-hood { margin-top: 48px; }
.under-hood-body { padding: 0 22px 24px; display: grid; gap: 24px; }
.under-hood-body img { border-radius: 10px; }
.methods { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px 24px; margin: 0; }
.methods dt { font-weight: 600; }
.methods dd { margin: 0; color: var(--muted); }
@media (max-width: 640px) { .methods { grid-template-columns: minmax(0, 1fr); gap: 2px; } .methods dd { margin-bottom: 12px; } }

/* ---------- Cite ---------- */
.citation { margin: 0 0 16px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; overflow-wrap: anywhere; }
.cite-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.bibtex { margin-bottom: 20px; }
.bibtex pre { margin: 0 22px 22px; padding: 16px; background: var(--panel); border-radius: var(--radius-sm); overflow-x: auto; font: .82rem/1.5 var(--mono); }

/* ---------- Download ---------- */
.dl-card h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 28px 0 12px; }
.dl-card .btn { margin-top: 4px; }
.install { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; color: var(--muted); }
.install li::marker { color: var(--accent); font-weight: 700; }
.dl-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; }
.dl-table th, .dl-table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); }
.dl-table thead th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dl-table tbody th { font-weight: 600; }
.dl-table tr.is-current { background: var(--brand-soft); }
.dl-table tr.is-current th::after { content: "Your system"; display: block; font-size: .72rem; font-weight: 600; color: var(--accent); }
.dl-more { text-align: center; color: var(--muted); font-size: .95rem; margin-top: 32px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 56px 0 24px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-about img { height: 44px; width: auto; margin-bottom: 14px; }
.footer-about p { color: var(--muted); max-width: 30em; }
.site-footer h2 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer nav a { color: var(--text); text-decoration: none; }
.site-footer nav a:hover { color: var(--accent); }
.footer-bottom { margin-top: 40px; color: var(--muted); font-size: .88rem; }
.footer-bottom p { margin: 0; padding-top: 20px; border-top: 1px solid var(--border); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-about { grid-column: 1 / -1; } }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .container { padding-inline: 16px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .cta-row .btn { flex: 1 1 100%; }
}
