/* ============================================================================
   METANOIA · THE PROBLEM — V3 · "The Gap"
   Intention → Action axis. Five break-points (the problems) reveal one at a
   time in a focal readout. Auto-advances; click any node to jump.
   Phase I · Prism — a measured diagnostic axis.
   ============================================================================ */

.problem-v3 { padding: 150px 0 140px; }
.problem-v3 .wrap-narrow {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 48px;
  position: relative;
}

/* ---------- centered eyebrow (full width) ---------- */
.problem-v3 .problem-eyebrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 0 78px;
}

/* ---------- two-column split: intro left · model right ---------- */
.problem-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}

/* ---------- left: thesis (title + lede), flush-left ---------- */
.problem-intro { text-align: left; }
.problem-intro h2 {
  margin: 0 0 30px;
  font-family: var(--font-display); font-weight: 400;
  color: var(--fg1);
  text-wrap: balance;
}
.problem-intro .ph-lead {
  display: block;
  font-size: clamp(18px, 1.9vw, 24px);
  letter-spacing: -0.01em; line-height: 1.3;
  color: var(--fg2); font-weight: 400;
  margin-bottom: 16px;
}
.problem-intro .ph-main {
  display: block;
  text-transform: capitalize;
  font-size: clamp(38px, 4.6vw, 64px); line-height: 1.05; letter-spacing: -0.03em;
}
.problem-intro h2 .grad {
  background: var(--gradient-phases);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.problem-intro .lede {
  margin: 0;
  max-width: 460px;
  font-size: clamp(16px, 1.6vw, 18.5px); line-height: 1.65;
  color: var(--fg2); font-weight: 300;
  text-align: left;
  text-wrap: pretty;
}
.problem-intro .lede em {
  font-style: normal; font-weight: 500;
  color: var(--fg1);
}

/* ---------- disruption coda — full-width centered closing line ---------- */
.gap-coda {
  position: relative;
  max-width: 640px;
  margin: 96px auto 0;
  padding-top: 44px;
  text-align: center;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(18px, 1.9vw, 23px); line-height: 1.5; letter-spacing: -0.01em;
  color: var(--fg3);
  text-wrap: balance;
}
.gap-coda::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 2px; border-radius: 999px;
  background: var(--gradient-spectrum);
  opacity: 0.8;
}
.gap-coda em {
  font-style: normal; font-weight: 500;
  color: var(--fg1);
}

/* ============================ THE GAP STAGE ============================ */
.gap-stage {
  width: 100%;
  margin: 0;
}

/* ---------- focal readout card (one problem at a time) ---------- */
.gap-readout {
  position: relative;
}
.gap-card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 42px 46px 40px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  background:
    radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--c, var(--act-1)) 9%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0));
  overflow: hidden;
  text-align: center;
  transition: background 420ms var(--ease-out-soft);
}
.gap-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--c, var(--act-1));
  box-shadow: 0 0 16px var(--c, var(--act-1));
  opacity: 0.7;
  transition: background 420ms var(--ease-out-soft), box-shadow 420ms var(--ease-out-soft);
}

.gap-progress {
  display: inline-flex; flex-direction: column; align-items: center; gap: 11px;
  font-family: var(--font-display); font-weight: 600;
  font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--fg3);
  margin-bottom: 30px;
}
.gap-progress .gp-label { color: var(--fg3); }
.gap-progress .gp-track { display: inline-flex; align-items: center; gap: 12px; }
.gap-progress .gp-cur {
  color: var(--c, var(--act-1)); font-variant-numeric: tabular-nums;
  font-size: 13px; letter-spacing: 0.16em;
  transition: color 360ms var(--ease-out-soft);
}
.gap-progress .gp-bar {
  width: 52px; height: 1px; background: rgba(255,255,255,0.12); position: relative; overflow: hidden;
}
.gap-progress .gp-bar::after {
  content: ''; position: absolute; top: 0; bottom: 0;
  width: calc(var(--frac, 0.2) * 100%);
  background: var(--c, var(--act-1));
  box-shadow: 0 0 8px var(--c, var(--act-1));
  transition: width 420ms var(--ease-out-soft), background 360ms var(--ease-out-soft);
}
.gap-progress .gp-bar-right::after { left: 0; }
.gap-progress .gp-bar-left::after { right: 0; }

.gap-readout .gap-stmt {
  margin: 0 0 18px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(24px, 3vw, 38px); line-height: 1.08; letter-spacing: -0.02em;
  color: var(--fg1);
  text-wrap: balance;
  text-transform: capitalize;
}
.gap-readout .gap-stmt em {
  font-style: normal;
  color: var(--c, var(--act-1));
  transition: color 360ms var(--ease-out-soft);
}
.gap-readout .gap-why {
  margin: 0 auto;
  max-width: 440px;
  /* reserve exactly 2 lines so the card never jumps as copy changes */
  min-height: calc(1.58em * 2);
  font-family: var(--font-body); font-weight: 300;
  font-size: clamp(13.5px, 1.35vw, 15px); line-height: 1.58;
  color: var(--fg2);
  text-wrap: pretty;
}

/* crossfade on change */
.gap-readout .gap-stmt,
.gap-readout .gap-why {
  transition: opacity 280ms var(--ease-out-soft), transform 280ms var(--ease-out-soft);
}
.gap-readout.is-changing .gap-stmt,
.gap-readout.is-changing .gap-why {
  opacity: 0; transform: translateY(8px);
}

/* ---------- the intention → action axis (sits BELOW the card) ---------- */
.gap-axis {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin: 64px auto 0;
  max-width: 620px;
}
.gap-end {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(13px, 1.4vw, 15px); letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.1;
}
.gap-end .ge-tag {
  display: block;
  font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--fg3);
  margin-bottom: 5px;
}
.gap-end.gap-intention { text-align: right; color: var(--act-1); }
.gap-end.gap-action    { text-align: left;  color: var(--act-7); }

/* the track holding the line + nodes */
.gap-track {
  position: relative;
  height: 36px;
}
.gap-line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  transform: translateY(-0.5px);
  background: linear-gradient(90deg, var(--act-1), var(--act-2), var(--act-3), var(--act-5), var(--act-7));
  opacity: 0.3;
  transform-origin: left center;
}
.gap-stage[data-revealed] .gap-line {
  animation: gap-line-draw 1100ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes gap-line-draw {
  from { transform: translateY(-0.5px) scaleX(0); }
  to   { transform: translateY(-0.5px) scaleX(1); }
}

.gap-node {
  position: absolute;
  top: 50%; left: var(--pos);
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent; border: 0; padding: 0;
  cursor: pointer;
  z-index: 1;
}
.gap-node .gn-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--canvas-black);
  border: 1.5px solid var(--c);
  box-shadow: 0 0 0 4px var(--canvas-black);
  transition: transform 320ms var(--ease-spring), box-shadow 320ms var(--ease-out-soft), background 320ms var(--ease-out-soft);
}
.gap-node:hover .gn-dot { transform: scale(1.25); }
.gap-node:focus-visible { outline: none; }
.gap-node:focus-visible .gn-dot {
  box-shadow: 0 0 0 4px var(--canvas-black), 0 0 0 7px color-mix(in srgb, var(--c) 40%, transparent);
}
.gap-node[data-active] .gn-dot {
  background: var(--c);
  transform: scale(1.5);
  box-shadow: 0 0 0 7px var(--canvas-black), 0 0 18px var(--c);
}

/* scroll-reveal stagger for nodes */
.gap-node { opacity: 0; }
.gap-stage[data-revealed] .gap-node { opacity: 1; transition: opacity 460ms var(--ease-out-soft); }
.gap-stage[data-revealed] .gap-node:nth-child(2) { transition-delay: 360ms; }
.gap-stage[data-revealed] .gap-node:nth-child(3) { transition-delay: 470ms; }
.gap-stage[data-revealed] .gap-node:nth-child(4) { transition-delay: 580ms; }
.gap-stage[data-revealed] .gap-node:nth-child(5) { transition-delay: 690ms; }
.gap-stage[data-revealed] .gap-node:nth-child(6) { transition-delay: 800ms; }

/* ---------- resolve link ---------- */
.problem-resolve {
  margin: 72px auto 0;
  text-align: center;
}
.resolve-link {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 500;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg2);
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 240ms var(--ease-out-soft), color 240ms var(--ease-out-soft), background 240ms var(--ease-out-soft);
}
.resolve-link .resolve-arrow { display: inline-block; transition: transform 240ms var(--ease-out-soft); }
.resolve-link:hover {
  border-color: color-mix(in srgb, var(--act-7) 50%, rgba(255,255,255,0.1));
  color: var(--fg1);
  background: color-mix(in srgb, var(--act-7) 6%, transparent);
}
.resolve-link:hover .resolve-arrow { transform: translateX(4px); }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .problem-split {
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: stretch;
  }
  .problem-intro { text-align: center; }
  .problem-intro .lede { margin: 0 auto; text-align: center; }
  .problem-v3 .problem-eyebrow { margin-bottom: 40px; }
}

@media (max-width: 640px) {
  .problem-v3 { padding: 100px 0 96px; }
  .problem-v3 .wrap-narrow { padding: 0 24px; }
  .gap-axis { grid-template-columns: 1fr; gap: 14px; }
  .gap-end { text-align: center !important; }
  .gap-end.gap-intention { order: 0; }
  .gap-track { order: 1; }
  .gap-end.gap-action { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .gap-line { animation: none !important; transform: translateY(-0.5px) !important; }
  .gap-node { opacity: 1 !important; transition: none !important; }
  .gap-readout .gap-stmt, .gap-readout .gap-why { transition: none !important; }
}
