/**
 * AI psychologist content cluster: comparison and technical explainer pages.
 * Uses the shared ST tokens and schema-therapy theme.
 */

.ai-cluster {
  background: var(--st-white);
  color: var(--st-text);
  font-family: Manrope, sans-serif;
  overflow: hidden;
}

.ai-cluster *,
.ai-cluster *::before,
.ai-cluster *::after {
  box-sizing: border-box;
}

.ai-cluster-container {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

.ai-cluster-container--wide {
  width: min(1440px, calc(100% - 48px));
}

.ai-cluster-hero {
  position: relative;
  padding: 190px 0 108px;
  background:
    radial-gradient(circle at 82% 18%, rgba(var(--st-primary-rgb), .17), transparent 32%),
    radial-gradient(circle at 12% 75%, rgba(162, 214, 196, .25), transparent 28%),
    linear-gradient(160deg, #fffaf6 0%, #fff 48%, #f8fbfa 100%);
}

.ai-cluster-hero::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(var(--st-primary-rgb), .15) 1px, transparent 1px);
  background-size: 28px 28px;
  content: '';
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
}

.ai-cluster-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .72fr);
  align-items: center;
  gap: clamp(48px, 7vw, 90px);
}

.ai-cluster-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--st-text-lt);
  font-size: 13px;
  font-weight: 600;
}

.ai-cluster-breadcrumbs a {
  color: var(--st-primary-dark);
  text-decoration: none;
}

.ai-cluster-eyebrow {
  margin: 0 0 16px;
  color: var(--st-primary-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.ai-cluster h1 {
  max-width: 880px;
  margin: 0;
  color: var(--st-text);
  font-size: clamp(42px, 5.3vw, 72px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.03;
}

.ai-cluster-lead {
  max-width: 800px;
  margin: 28px 0 0;
  color: var(--st-text-md);
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.6;
}

.ai-cluster-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}

.ai-cluster-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 25px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.ai-cluster-button:hover {
  transform: translateY(-2px);
}

.ai-cluster-button--primary {
  background: linear-gradient(135deg, var(--st-primary), var(--st-primary-dark));
  box-shadow: 0 13px 32px rgba(var(--st-primary-rgb), .28);
  color: #fff;
}

.ai-cluster-button--ghost {
  border-color: var(--st-border);
  background: rgba(255, 255, 255, .8);
  color: var(--st-text);
}

.ai-cluster-button--light {
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .2);
  color: #202020;
}

.ai-cluster-hint {
  margin: 12px 0 0;
  color: var(--st-text-lt);
  font-size: 12px;
  line-height: 1.5;
}

.ai-cluster-summary {
  position: relative;
  padding: 34px;
  border: 1px solid rgba(var(--st-primary-rgb), .22);
  border-radius: 28px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 24px 70px rgba(53, 42, 32, .12);
  backdrop-filter: blur(16px);
}

.ai-cluster-summary::after {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--st-primary-light), var(--st-accent));
  content: '';
  opacity: .75;
  z-index: -1;
}

.ai-cluster-summary > span {
  display: block;
  margin-bottom: 12px;
  color: var(--st-primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ai-cluster-summary strong {
  display: block;
  margin-bottom: 14px;
  font-size: 25px;
  line-height: 1.25;
}

.ai-cluster-summary p {
  margin: 0;
  color: var(--st-text-md);
  font-size: 15px;
  line-height: 1.72;
}

.ai-cluster-section {
  padding: 100px 0;
}

.ai-cluster-section--cream {
  background: var(--st-cream);
}

.ai-cluster-section--dark {
  background: #171819;
  color: #fff;
}

.ai-cluster-section h2,
.ai-cluster-final h2 {
  max-width: 900px;
  margin: 0;
  color: inherit;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.ai-cluster-intro {
  max-width: 880px;
  margin: 22px 0 0;
  color: var(--st-text-md);
  font-size: 18px;
  line-height: 1.75;
}

.ai-cluster-section--dark .ai-cluster-eyebrow {
  color: var(--st-primary-light);
}

.ai-cluster-section--dark .ai-cluster-intro {
  color: rgba(255, 255, 255, .7);
}

.ai-verdict-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 48px;
}

.ai-verdict-grid article {
  min-height: 240px;
  padding: 24px 22px;
  border: 1px solid var(--st-border);
  border-radius: 22px;
  background: #fff;
}

.ai-verdict-grid article:first-child {
  border-color: rgba(var(--st-primary-rgb), .45);
  background: linear-gradient(150deg, #fff 0%, rgba(var(--st-primary-rgb), .09) 100%);
}

.ai-verdict-grid article > span {
  display: block;
  margin-bottom: 34px;
  font-size: 28px;
}

.ai-verdict-grid h3 {
  margin: 0 0 10px;
  color: var(--st-text);
  font-size: 19px;
}

.ai-verdict-grid p {
  margin: 0;
  color: var(--st-text-md);
  font-size: 14px;
  line-height: 1.6;
}

.ai-criteria-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.ai-criteria-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--st-border);
  border-radius: 18px;
}

.ai-criteria-list li > span {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--st-secondary);
  color: var(--st-primary-dark);
  font-size: 13px;
  font-weight: 800;
  place-items: center;
}

.ai-criteria-list strong {
  font-size: 15px;
  line-height: 1.35;
}

.ai-criteria-list p {
  margin: 6px 0 0;
  color: var(--st-text-lt);
  font-size: 13px;
  line-height: 1.5;
}

.ai-table-scroll {
  margin-top: 48px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  background: #202224;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
}

.ai-table-scroll:focus-visible {
  outline: 3px solid var(--st-primary-light);
  outline-offset: 4px;
}

.ai-comparison-table,
.ai-simple-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  color: #fff;
}

.ai-comparison-table caption,
.ai-simple-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ai-comparison-table th,
.ai-comparison-table td,
.ai-simple-table th,
.ai-simple-table td {
  padding: 22px 18px;
  border-right: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  text-align: left;
  vertical-align: top;
}

.ai-comparison-table thead th,
.ai-simple-table thead th {
  position: sticky;
  top: 0;
  background: #151617;
  color: #fff;
  font-size: 14px;
  z-index: 2;
}

.ai-comparison-table thead th:nth-child(2) {
  background: #55382c;
}

.ai-comparison-table tbody th {
  width: 190px;
  background: #191b1c;
}

.ai-comparison-table tbody th strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.ai-comparison-table tbody th span {
  display: block;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.ai-comparison-table td {
  width: 190px;
}

.ai-comparison-table td:nth-child(2) {
  background: rgba(var(--st-primary-rgb), .08);
}

.ai-comparison-table td p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .76);
  font-size: 12px;
  line-height: 1.55;
}

.ai-status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.ai-status--strong { background: #d8f5df; color: #176d35; }
.ai-status--good { background: #dceaff; color: #245c9f; }
.ai-status--mixed { background: #fff0c9; color: #825a00; }
.ai-status--weak { background: #eee; color: #555; }

.ai-table-note {
  max-width: 940px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .56);
  font-size: 13px;
  line-height: 1.65;
}

.ai-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 48px;
}

.ai-feature-panel {
  padding: 34px;
  border: 1px solid var(--st-border);
  border-radius: 24px;
  background: #fff;
}

.ai-feature-panel--accent {
  border-color: rgba(var(--st-primary-rgb), .4);
  background: linear-gradient(145deg, #fff 0%, rgba(var(--st-primary-rgb), .1) 100%);
}

.ai-feature-panel__label {
  display: block;
  margin-bottom: 22px;
  color: var(--st-primary-dark);
  font-size: 16px;
  font-weight: 800;
}

.ai-feature-panel ul {
  display: grid;
  gap: 15px;
  margin: 0;
  padding-left: 22px;
  color: var(--st-text-md);
}

.ai-feature-panel li {
  padding-left: 4px;
  line-height: 1.65;
}

.ai-source-callout {
  margin: 26px 0 0;
  padding: 22px 24px;
  border-left: 4px solid var(--st-primary);
  border-radius: 0 14px 14px 0;
  background: var(--st-cream);
  color: var(--st-text-md);
  font-size: 14px;
  line-height: 1.72;
}

.ai-source-callout a,
.ai-cluster a:not(.ai-cluster-button) {
  color: var(--st-primary-dark);
  font-weight: 700;
  text-underline-offset: 3px;
}

.ai-cluster-centered-action {
  margin-top: 34px;
  text-align: center;
}

.ai-service-list {
  display: grid;
  margin-top: 48px;
  border-top: 1px solid var(--st-border);
}

.ai-service-list article {
  display: grid;
  grid-template-columns: minmax(180px, .4fr) minmax(0, 1.6fr);
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--st-border);
}

.ai-service-list__name {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.ai-service-list__name span {
  color: var(--st-primary);
  font-size: 12px;
  font-weight: 800;
}

.ai-service-list h3 {
  margin: 0;
  color: var(--st-text);
  font-size: 25px;
}

.ai-service-list article > div:last-child > strong {
  display: block;
  margin-top: 18px;
  color: var(--st-text);
  font-size: 14px;
}

.ai-service-list article > div:last-child > strong:first-child {
  margin-top: 0;
}

.ai-service-list p {
  margin: 7px 0 0;
  color: var(--st-text-md);
  font-size: 15px;
  line-height: 1.7;
}

.ai-service-list a {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
}

.ai-history-card {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr);
  gap: 56px;
  padding: clamp(32px, 6vw, 64px);
  border: 1px solid var(--st-border);
  border-radius: 30px;
  background: linear-gradient(145deg, var(--st-cream), #fff);
  box-shadow: 0 24px 60px rgba(50, 38, 30, .08);
}

.ai-history-card h2 {
  font-size: clamp(30px, 3.4vw, 45px);
}

.ai-history-card > div:last-child p {
  margin: 0 0 16px;
  color: var(--st-text-md);
  font-size: 16px;
  line-height: 1.75;
}

.ai-test-list {
  display: grid;
  gap: 12px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: test-step;
}

.ai-test-list li {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
  gap: 28px;
  padding: 24px 28px;
  border: 1px solid var(--st-border);
  border-radius: 18px;
  background: #fff;
}

.ai-test-list strong {
  color: var(--st-text);
  font-size: 16px;
}

.ai-test-list span {
  color: var(--st-text-md);
  font-size: 14px;
  line-height: 1.55;
}

.ai-cluster .st-faq {
  background: #fff;
}

.ai-cluster-sources {
  border-top: 1px solid var(--st-border);
}

.ai-cluster-sources > .ai-cluster-container > p:not(.ai-cluster-eyebrow) {
  max-width: 760px;
  color: var(--st-text-md);
  line-height: 1.7;
}

.ai-cluster-sources ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 36px;
  margin: 30px 0 0;
  padding-left: 20px;
}

.ai-cluster-sources li {
  padding-left: 4px;
  color: var(--st-text-lt);
  font-size: 14px;
  line-height: 1.55;
}

.ai-cluster-final {
  padding: 96px 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, .12), transparent 28%),
    linear-gradient(135deg, #232323, #372820);
  color: #fff;
  text-align: center;
}

.ai-cluster-final h2 {
  margin-right: auto;
  margin-left: auto;
}

.ai-cluster-final > .ai-cluster-container > p:not(.ai-cluster-eyebrow, .ai-cluster-hint) {
  max-width: 720px;
  margin: 20px auto 30px;
  color: rgba(255, 255, 255, .72);
  font-size: 18px;
  line-height: 1.7;
}

.ai-cluster-final .ai-cluster-eyebrow {
  color: var(--st-primary-light);
}

.ai-cluster-final .ai-cluster-hint {
  color: rgba(255, 255, 255, .55);
}

/* Neural-network explainer */
.ai-neural-hero {
  background:
    radial-gradient(circle at 80% 20%, rgba(104, 159, 214, .18), transparent 31%),
    radial-gradient(circle at 18% 75%, rgba(var(--st-primary-rgb), .18), transparent 30%),
    linear-gradient(160deg, #fffaf7 0%, #fff 52%, #f4f9ff 100%);
}

.ai-neural-summary::before {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--st-primary), #6f9fd2);
  box-shadow: 0 10px 24px rgba(var(--st-primary-rgb), .2);
  color: #fff;
  content: 'AI';
  font-size: 18px;
  font-weight: 800;
  line-height: 56px;
  text-align: center;
}

.ai-pipeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 50px 0 0;
  padding: 0;
  list-style: none;
}

.ai-pipeline::before {
  position: absolute;
  top: 28px;
  right: 9%;
  left: 9%;
  height: 2px;
  background: linear-gradient(90deg, var(--st-primary-light), #6f9fd2);
  content: '';
}

.ai-pipeline li {
  position: relative;
  z-index: 1;
  padding: 0 10px;
  text-align: center;
}

.ai-pipeline li > span {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border: 2px solid var(--st-primary-light);
  border-radius: 50%;
  background: #fff;
  color: var(--st-primary-dark);
  font-weight: 800;
  place-items: center;
}

.ai-pipeline strong {
  display: block;
  font-size: 15px;
}

.ai-pipeline p {
  margin: 10px 0 0;
  color: var(--st-text-lt);
  font-size: 13px;
  line-height: 1.55;
}

.ai-simple-table {
  min-width: 760px;
}

.ai-simple-table tbody th {
  width: 180px;
  color: #fff;
  font-size: 14px;
}

.ai-simple-table td {
  width: calc((100% - 180px) / 2);
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
  line-height: 1.6;
}

.ai-simple-table td:last-child {
  background: rgba(var(--st-primary-rgb), .08);
}

.ai-layer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.ai-layer-grid article {
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--st-border);
  border-radius: 22px;
  background: #fff;
}

.ai-layer-grid article > span {
  display: block;
  margin-bottom: 36px;
  color: var(--st-primary);
  font-size: 12px;
  font-weight: 800;
}

.ai-layer-grid h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.ai-layer-grid p {
  margin: 10px 0 0;
  color: var(--st-text-md);
  font-size: 14px;
  line-height: 1.6;
}

.ai-two-columns--balanced {
  gap: 16px;
}

.ai-feature-stack {
  display: grid;
  gap: 16px;
}

.ai-feature-stack article {
  padding: 26px 28px;
  border: 1px solid var(--st-border);
  border-radius: 20px;
  background: #fff;
}

.ai-feature-stack strong {
  font-size: 17px;
}

.ai-feature-stack p {
  margin: 8px 0 0;
  color: var(--st-text-md);
  font-size: 14px;
  line-height: 1.65;
}

.ai-related-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 36px;
}

.ai-related-links a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 22px;
  border: 1px solid var(--st-border);
  border-radius: 18px;
  background: var(--st-cream);
  text-decoration: none;
}

.ai-related-links strong {
  font-size: 15px;
}

.ai-related-links span {
  color: var(--st-text-lt);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.ai-check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.ai-check-grid li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 24px;
  border: 1px solid var(--st-border);
  border-radius: 18px;
  background: #fff;
}

.ai-check-grid li > span {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dff3e5;
  color: #247342;
  font-weight: 900;
  place-items: center;
}

.ai-check-grid p {
  margin: 2px 0 0;
  color: var(--st-text-md);
  font-size: 14px;
  line-height: 1.55;
}

.ai-check-grid strong {
  color: var(--st-text);
}

@media (max-width: 1100px) {
  .ai-cluster-hero__grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  }

  .ai-verdict-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .ai-criteria-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .ai-pipeline {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 12px;
  }

  .ai-pipeline::before {
    display: none;
  }
}

@media (max-width: 800px) {
  .ai-cluster-container,
  .ai-cluster-container--wide {
    width: min(100% - 32px, 700px);
  }

  .ai-cluster-hero {
    padding: 134px 0 74px;
  }

  .ai-cluster-hero__grid,
  .ai-history-card {
    grid-template-columns: 1fr;
  }

  .ai-cluster-summary {
    max-width: 580px;
  }

  .ai-cluster-section,
  .ai-cluster-final {
    padding: 72px 0;
  }

  .ai-verdict-grid,
  .ai-layer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ai-two-columns,
  .ai-related-links {
    grid-template-columns: 1fr;
  }

  .ai-service-list article {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ai-history-card {
    gap: 28px;
  }

  .ai-cluster-sources ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ai-cluster h1 {
    font-size: clamp(36px, 12vw, 50px);
  }

  .ai-cluster-actions,
  .ai-cluster-button {
    width: 100%;
  }

  .ai-cluster-summary,
  .ai-feature-panel,
  .ai-history-card {
    padding: 24px;
    border-radius: 22px;
  }

  .ai-verdict-grid,
  .ai-criteria-list,
  .ai-layer-grid,
  .ai-check-grid,
  .ai-pipeline {
    grid-template-columns: 1fr;
  }

  .ai-verdict-grid article,
  .ai-layer-grid article {
    min-height: 0;
  }

  .ai-test-list li {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px;
  }
}
