/* ============================================================
   AIAS components
   New visual components introduced for the cluster pages.
   Loaded after shared.css.
   ============================================================ */

/* ---- Stat strip -------------------------------------------- */
.stat-strip {
  background: var(--gradient-brand);
  padding: 3.5rem var(--pad-x-desktop);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.stat-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: var(--max-content);
  margin: 0 auto;
  text-align: center;
}
.stat-strip-item .stat-num {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--white);
  display: block;
  margin-bottom: 0.5rem;
}
.stat-strip-item .stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint-mid);
}
@media (max-width: 900px) {
  .stat-strip { padding: 2.5rem var(--pad-x-mobile); }
  .stat-strip-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .stat-strip-item .stat-num { font-size: 2.2rem; }
}

/* ---- Three-layer architecture diagram ---------------------- */
.three-layer {
  background: #0f1f30;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0, 128, 128, 0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(81, 188, 188, 0.12), transparent 45%);
  color: var(--white);
  padding: 6rem var(--pad-x-desktop);
  position: relative;
  overflow: hidden;
}
.three-layer .section-tag { color: var(--mint-mid); }
.three-layer .section-title { color: var(--white); max-width: 720px; }
.three-layer .section-lede { color: rgba(255,255,255,0.75); }
.three-layer-svg-wrap {
  margin: 3rem auto 2rem;
  max-width: 980px;
  display: block;
}
.three-layer-svg {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 700px) {
  .three-layer-svg-wrap { display: none; }
}
.layer-stack {
  display: grid;
  gap: 1.5rem;
  max-width: 980px;
  margin: 3rem auto 0;
}
.layer-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 2rem 2.25rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(81, 188, 188, 0.25);
  border-radius: var(--radius-md);
  position: relative;
  transition: all 0.25s;
}
.layer-card:hover {
  background: rgba(81, 188, 188, 0.08);
  border-color: var(--mint-mid);
  transform: translateX(4px);
}
.layer-num {
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--mint-mid);
  line-height: 1;
  letter-spacing: -0.02em;
  opacity: 0.9;
}
.layer-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.layer-body .layer-kind {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint-mid);
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(81, 188, 188, 0.35);
  border-radius: 100px;
  margin-bottom: 0.75rem;
}
.layer-body p {
  font-size: 0.98rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.65;
  max-width: 580px;
}
.layer-flow {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 128, 128, 0.18);
  border: 1px solid rgba(81, 188, 188, 0.4);
  color: var(--mint-mid);
  font-size: 1.4rem;
  flex-shrink: 0;
}
.layer-card + .layer-card::before {
  content: '';
  position: absolute;
  top: -1.4rem;
  left: 80px;
  width: 1px;
  height: 1.4rem;
  background: linear-gradient(to bottom, transparent, var(--mint-mid));
}
@media (max-width: 900px) {
  .three-layer { padding: 4rem var(--pad-x-mobile); }
  .layer-card { grid-template-columns: 56px 1fr; padding: 1.5rem; gap: 1rem; }
  .layer-card + .layer-card::before { left: 56px; }
  .layer-num { font-size: 2.4rem; }
  .layer-body h3 { font-size: 1.15rem; }
  .layer-flow { display: none; }
}

/* ---- Side-by-side comparison panel ------------------------- */
.compare-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: var(--max-content);
  margin: 0 auto;
}
.compare-card {
  padding: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid;
  position: relative;
}
.compare-card.rule-based {
  background: linear-gradient(180deg, #f4f9fc 0%, #ffffff 100%);
  border-color: #c9d8e3;
}
.compare-card.agentic {
  background: linear-gradient(180deg, #f0fbf9 0%, #ffffff 100%);
  border-color: #b7e2da;
}
.compare-card .compare-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}
.compare-card.rule-based .compare-eyebrow { background: #1e4563; color: var(--white); }
.compare-card.agentic   .compare-eyebrow { background: var(--teal); color: var(--white); }
.compare-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.compare-card p {
  font-size: 1rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.compare-examples { margin-top: 1.5rem; }
.compare-examples h4 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.75rem;
}
.compare-examples ul { list-style: none; padding: 0; }
.compare-examples li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #444;
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  border-bottom: 1px dashed #e8e8e8;
}
.compare-examples li:last-child { border-bottom: none; }
.compare-card.rule-based .compare-examples li::before {
  content: '\2192';
  position: absolute; left: 0; color: var(--navy); font-weight: 700;
}
.compare-card.agentic .compare-examples li::before {
  content: '\2192';
  position: absolute; left: 0; color: var(--teal); font-weight: 700;
}
@media (max-width: 900px) {
  .compare-panel { grid-template-columns: 1fr; }
  .compare-card { padding: 1.75rem; }
}

/* ---- Worked-example card ----------------------------------- */
.worked-example {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  max-width: var(--max-content);
  margin: 0 auto;
  border: 1px solid #e6e6e6;
}
.worked-example .we-image {
  /* Base placeholder pattern shows when the real image is missing.
     The inline style sets the real image on top via background-image. */
  background-color: var(--mint-light);
  background-image:
    linear-gradient(135deg, rgba(0, 128, 128, 0.18) 0%, rgba(30, 69, 99, 0.28) 100%),
    repeating-linear-gradient(45deg, rgba(30, 69, 99, 0.06) 0 14px, transparent 14px 28px);
  background-size: cover;
  background-position: center;
  min-height: 360px;
  position: relative;
}
.worked-example .we-image::before {
  content: 'AIAS';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: rgba(30, 69, 99, 0.18);
}
.worked-example .we-image[style*="url"]::before { content: none; }
.worked-example .we-body {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.worked-example .we-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.75rem;
}
.worked-example .we-client {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.worked-example .we-sector {
  font-size: 0.92rem;
  color: #888;
  margin-bottom: 1.5rem;
}
.worked-example blockquote {
  font-size: 1.1rem;
  line-height: 1.65;
  color: #444;
  font-style: italic;
  border-left: 3px solid var(--teal);
  padding-left: 1.25rem;
  margin: 0 0 1.5rem 0;
}
.worked-example .we-outcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  text-align: center;
}
.worked-example .we-stat {
  flex: 0 0 auto;
}
.worked-example .we-stat .num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}
.worked-example .we-stat .label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-top: 0.35rem;
  display: block;
}
@media (max-width: 900px) {
  .worked-example { grid-template-columns: 1fr; }
  .worked-example .we-image { min-height: 220px; }
  .worked-example .we-body { padding: 2rem; }
  .worked-example .we-client { font-size: 1.4rem; }
}

/* ---- "How we built ours" callout --------------------------- */
.dogfood-section { padding: 2rem var(--pad-x-desktop); background: var(--white); }
.dogfood-callout {
  background: var(--mint-light);
  border-left: 4px solid var(--teal);
  padding: 2rem 2.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  max-width: 820px;
  margin: 0 auto;
}
.dogfood-callout .df-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--deep-teal);
  margin-bottom: 0.5rem;
}
.dogfood-callout h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.dogfood-callout p {
  font-size: 0.98rem;
  color: #555;
  line-height: 1.7;
}

/* ---- Floating sticky table of contents --------------------- */
/* Fixed left sidebar that floats over content. Only shown on wide screens. */
.toc-floating {
  position: fixed;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #e0e6e6;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow-card);
  font-size: 0.82rem;
  max-height: 70vh;
  overflow-y: auto;
}
.toc-floating .toc-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #e8eded;
}
.toc-floating ul { list-style: none; padding: 0; margin: 0; }
.toc-floating li { margin-bottom: 0.45rem; }
.toc-floating a {
  color: #555;
  text-decoration: none;
  display: block;
  padding: 0.2rem 0 0.2rem 0.7rem;
  border-left: 2px solid transparent;
  transition: all 0.18s;
  line-height: 1.35;
}
.toc-floating a:hover,
.toc-floating a.active {
  color: var(--teal);
  border-left-color: var(--teal);
}
@media (max-width: 1500px) {
  .toc-floating { display: none; }
}

/* ---- Legacy in-flow TOC (kept for completeness) ------------ */
.with-toc {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
  max-width: var(--max-content);
  margin: 0 auto;
}
.toc {
  position: sticky;
  top: 6rem;
  align-self: start;
  font-size: 0.85rem;
}
.toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e0e0e0;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.6rem; }
.toc a {
  color: #555;
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: all 0.2s;
  line-height: 1.4;
}
.toc a:hover, .toc a.active {
  color: var(--teal);
  border-left-color: var(--teal);
}
.toc-content > section:first-child { padding-top: 0; }
.toc-content > section { padding-left: 0; padding-right: 0; }
@media (max-width: 1100px) {
  .with-toc { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
}

/* ---- Town hero variant (regional pages) -------------------- */
.page-hero--region {
  position: relative;
}
.page-hero--region .region-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mint-mid);
  margin-bottom: 1.25rem;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(81, 188, 188, 0.4);
  border-radius: 100px;
  background: rgba(81, 188, 188, 0.08);
}
.page-hero--region .region-tag::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mint-mid);
  box-shadow: 0 0 0 4px rgba(81, 188, 188, 0.2);
}

/* ---- Pillar cluster footer (related pages) ----------------- */
.cluster-footer {
  background: #f7fafa;
  padding: 5rem var(--pad-x-desktop);
  border-top: 1px solid #e8eded;
}
.cluster-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: var(--max-content);
  margin: 0 auto;
}
.cluster-block h4 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #d8e3e3;
}
.cluster-list { list-style: none; padding: 0; columns: 2; column-gap: 2rem; }
.cluster-list li { padding: 0.5rem 0; break-inside: avoid; }
.cluster-list a {
  color: var(--charcoal);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.cluster-list a::before {
  content: '\2192';
  color: var(--teal);
  font-weight: 700;
  transition: transform 0.15s;
}
.cluster-list a:hover { color: var(--teal); }
.cluster-list a:hover::before { transform: translateX(3px); }
@media (max-width: 900px) {
  .cluster-footer { padding: 3rem var(--pad-x-mobile); }
  .cluster-footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .cluster-list { columns: 1; }
}

/* ---- Prose with image -------------------------------------- */
.prose-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: var(--max-content);
  margin: 0 auto;
}
.prose-media .prose-media-img img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.prose-media .prose-media-text { max-width: none; }
.prose-media .prose-media-text .prose,
.prose-media .prose-media-text { max-width: none; }
.prose-media--left { direction: rtl; }
.prose-media--left > * { direction: ltr; }
@media (max-width: 900px) {
  .prose-media { grid-template-columns: 1fr; gap: 2rem; }
  .prose-media--left { direction: ltr; }
}

/* ---- Long prose ------------------------------------------- */
.prose { max-width: 720px; }
.prose h2 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 3rem 0 1rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 2rem 0 0.75rem;
}
.prose p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #444;
  margin-bottom: 1.25rem;
}
.prose p strong { color: var(--charcoal); }
.prose ul, .prose ol {
  margin: 0 0 1.5rem 1.5rem;
  font-size: 1.02rem;
  line-height: 1.75;
  color: #444;
}
.prose li { margin-bottom: 0.5rem; }
.prose blockquote {
  border-left: 4px solid var(--teal);
  background: var(--mint-light);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  font-size: 1.08rem;
  font-style: italic;
  color: #444;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.prose blockquote cite {
  display: block;
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 700;
  color: var(--deep-teal);
  margin-top: 0.75rem;
  letter-spacing: 0.05em;
}

/* ---- Region map (UK SVG with town pins) -------------------- */
.region-section {
  background: #0f1f30;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0, 128, 128, 0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(81, 188, 188, 0.12), transparent 45%);
  color: var(--white);
}
.region-section .section-tag { color: var(--mint-mid); }
.region-section .section-title { color: var(--white); }
.region-map-wrap {
  max-width: 980px;
  margin: 0 auto 2.5rem;
}
.region-map-svg { width: 100%; height: auto; display: block; }
.region-section .town-grid { max-width: 980px; }
.region-section .town-tile {
  background: rgba(255,255,255,0.04);
  border-color: rgba(81,188,188,0.25);
  color: var(--white);
}
.region-section .town-tile:hover {
  background: rgba(81,188,188,0.1);
  border-color: var(--mint-mid);
}
@media (max-width: 700px) {
  .region-map-wrap { display: none; }
}

/* ---- Town list (regional pillar) --------------------------- */
.town-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: var(--max-content);
  margin: 0 auto;
}
.town-tile {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border: 1px solid #e0e6e6;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--charcoal);
  font-size: 0.98rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}
.town-tile::after {
  content: '\2192';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal);
  opacity: 0;
  transition: all 0.2s;
}
.town-tile:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  padding-right: 2.5rem;
}
.town-tile:hover::after { opacity: 1; right: 1rem; }
@media (max-width: 900px) {
  .town-grid { grid-template-columns: 1fr 1fr; }
}
