/* =========================================================
   "Too many sources" source map: eight source types feeding one
   referenced answer. carbonAI/js/source-map.js draws the connectors
   and plays the sequence (card lights up, a node travels its line,
   the matching keyword and chip light up in the answer).
   Desktop: cards | answer | cards with curved connectors.
   Tablet: answer on top, cards in an aligned two-column grid.
   Phone: answer on top, cards in one column.
   ========================================================= */
.problem .section-title { margin-bottom: 14px; }
.problem-sub {
  max-width: min(100%, 40em);
  margin: 0 auto clamp(40px, 6vh, 64px);
  text-align: center;
  text-wrap: balance;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.5;
  color: var(--body, #374151);
}

.sm {
  --sm-gap: clamp(40px, 5vw, 96px);
  --sm-market: #397f86;   /* projects & markets */
  --sm-rules: #e7a33c;    /* rules & standards */
  --sm-company: #8a949b;  /* company & country */
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(380px, 520px) minmax(220px, 290px);
  justify-content: space-between;
  align-items: center;
  column-gap: var(--sm-gap);
}
.sm-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.sm-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* a gentle offset so the two sides don't mirror each other exactly */
.sm-col--right { margin-top: 44px; }
.sm-col--left .sm-card:nth-child(2) { margin-left: 14px; }
.sm-col--right .sm-card:nth-child(3) { margin-right: 14px; }

/* ---------- Source cards ---------- */
.sm-card {
  --c: var(--sm-market);
  position: relative;
  padding: 13px 18px 15px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e1e8e9;
  border-left: 3px solid color-mix(in srgb, var(--c) 55%, #fff);
  box-shadow: 0 1px 2px rgba(8, 26, 28, 0.04), 0 6px 18px rgba(8, 26, 28, 0.06);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease, background-color 0.35s ease;
}
.sm-card[data-group="rules"] { --c: var(--sm-rules); }
.sm-card[data-group="company"] { --c: var(--sm-company); }
.sm-tag {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--c) 85%, #111827);
}
.sm-card h3 {
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink, #111827);
}
.sm-card p {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted, #6b7280);
}
/* Desktop: left-column cards carry their accent on the inner (right) edge,
   mirroring the right column, whose accent is on its inner (left) edge */
@media (min-width: 1200px) {
  .sm-col--left .sm-card {
    border-left: 1px solid #e1e8e9;
    border-right: 3px solid color-mix(in srgb, var(--c) 55%, #fff);
  }
  .sm-col--left .sm-card.is-active {
    border-left-color: color-mix(in srgb, var(--c) 45%, #fff);
    border-right-color: var(--c);
  }
}
/* the card currently contributing to the answer */
.sm-card.is-active {
  background: color-mix(in srgb, var(--c) 6%, #fff);
  border-color: color-mix(in srgb, var(--c) 45%, #fff);
  border-left-color: var(--c);
  box-shadow: 0 2px 4px rgba(8, 26, 28, 0.05), 0 14px 32px color-mix(in srgb, var(--c) 24%, transparent);
  transform: translateY(-3px);
}

/* ---------- Answer card ---------- */
.sm-center { position: relative; z-index: 1; }
.sm-answer {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 52px clamp(22px, 2.4vw, 34px) 26px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e1e8e9;
  box-shadow: 0 2px 6px rgba(8, 26, 28, 0.05), 0 22px 54px rgba(8, 26, 28, 0.12);
}
.sm-bot {
  position: absolute;
  top: -34px;
  left: 50%;
  width: 68px;
  height: 68px;
  margin-left: -34px;
  padding: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(8, 26, 28, 0.14);
  object-fit: contain;
}
.sm-q {
  align-self: center;
  max-width: 100%;
  margin: 0;
  padding: 12px 18px;
  border-radius: 16px;
  background: #eef3f4;
  text-align: center;
  text-wrap: balance;
  font-size: clamp(17px, 1.3vw, 19px); /* same size as the answer */
  line-height: 1.45;
  color: var(--ink, #111827);
}
/* The answers share one grid cell, so the box is always as tall as the longest
   and nothing jumps as they change; only the shown one is visible */
.sm-answers { display: grid; margin-top: 20px; }
.sm-a {
  grid-area: 1 / 1;
  margin: 0;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.6;
  color: var(--ink, #111827);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.sm-a.is-shown { opacity: 1; transform: none; }
.sm-from {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal-dark, #2f696f);
}

/* payoff + trust cue */
.sm-payoff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e8eeee;
}
.sm-payoff strong { font-size: 16px; font-weight: 700; color: var(--ink, #111827); }
.sm-payoff { justify-content: flex-start; }

/* ---------- Connector lines + the travelling node (desktop only) ---------- */
.sm-line {
  fill: none;
  stroke: rgba(57, 127, 134, 0.2);
  stroke-width: 1.25;
  transition: stroke 0.5s ease;
}
.sm-line.is-hot { stroke: var(--hot, #397f86); stroke-width: 1; } /* thinner when lit, so it reads as a fine path */
/* a fine, bright core with a soft electric glow in the source's color */
.sm-node {
  fill: color-mix(in srgb, var(--hot, #397f86) 30%, #fff);
  opacity: 0;
  filter:
    drop-shadow(0 0 0.8px var(--hot, #397f86))
    drop-shadow(0 0 1.5px var(--hot, #397f86))
    drop-shadow(0 0 4px var(--hot, #397f86))
    drop-shadow(0 0 10px color-mix(in srgb, var(--hot, #397f86) 65%, transparent));
}
/* stacked layouts (tablet, phone): the routes share the side margins, so only
   the active line shows, fading in as its card lights up */
.sm.is-stacked .sm-line { stroke: transparent; stroke-width: 1.25; }
.sm.is-stacked .sm-line.is-hot { stroke: var(--hot, #397f86); }
/* lines draw in when the section scrolls into view */
.sm .sm-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.sm.is-in .sm-line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.5s ease;
}

/* Scroll reveal: same fade-and-rise as the rest of the page (index.css .reveal),
   kept alongside the cards' own highlight transition; cards follow the answer
   in a short cascade */
.sm-card.reveal {
  transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
}
.sm-col .sm-card.reveal:nth-child(1) { transition-delay: 0.1s; }
.sm-col .sm-card.reveal:nth-child(2) { transition-delay: 0.2s; }
.sm-col .sm-card.reveal:nth-child(3) { transition-delay: 0.3s; }
.sm-col .sm-card.reveal:nth-child(4) { transition-delay: 0.4s; }
/* once the fade has finished (source-map.js adds .is-settled), the highlight
   responds without the cascade delay */
.sm-card.is-settled { transition-delay: 0s; }

/* ---------- Tablet: answer on top, all eight cards in one shared grid ----------
   (display: contents lifts the cards out of their columns so rows align) */
@media (max-width: 1199px) {
  .sm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
  }
  .sm-col { display: contents; }
  .sm-col--right { margin-top: 0; }
  .sm-col--left .sm-card:nth-child(2), .sm-col--right .sm-card:nth-child(3) { margin: 0; }
  .sm-center { grid-column: 1 / -1; order: -1; width: 100%; max-width: 600px; margin: 34px auto 22px; }
}

/* ---------- Phone: answer on top, cards in one column ---------- */
@media (max-width: 640px) {
  .sm { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  /* compact cards so more of the eight fit on screen at once */
  .sm-card { padding: 9px 16px 10px; border-radius: 10px; }
  .sm-tag { margin-bottom: 2px; font-size: 10.5px; }
  .sm-card h3 { font-size: 15px; }
  .sm-card p { margin-top: 2px; font-size: 13px; line-height: 1.4; }
  .sm-center { margin-bottom: 14px; }
  .sm-answer { padding: 46px 20px 22px; }
  .sm-q { font-size: 17px; } /* same as the answer */
  .sm-a { font-size: 17px; }
  .sm-payoff { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .sm .sm-line { transition: none; stroke-dashoffset: 0; }
  .sm-card, .sm-a { transition: none; }
}

/* Logo strip recedes while the source map is fully in view (source-map.js) */
.home-brands .pr-brands-marquee, .home-brands .brands-label { transition: opacity 0.6s ease; }
.home-brands.is-receded .pr-brands-marquee, .home-brands.is-receded .home-brands .brands-label { opacity: 0; }
.home-brands.is-receded .pr-brands-track { animation-play-state: paused; }
