#problema { background: var(--paper); }

.prob-wrap {
  position: relative;
  display: flex; align-items: center; gap: 0;
  min-height: 220px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 24px; overflow: hidden;
  padding: 48px;
  isolation: isolate;
}

/* SVG that draws the convergence lines from each tag to the Kentro logo */
.prob-sigil {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.prob-sigil .sigil-link {
  fill: none;
  stroke: rgba(255,99,71,0.6);
  stroke-width: 1.2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(255,99,71,0.45));
  opacity: 0;
}
/* Stroke-dashoffset is animated per-path via WAAPI in problema.js
   (path lengths vary, so a single keyframe range cannot work). */

/* Particles that travel along the same paths */
.prob-particles {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;
}
.sigil-particle {
  position: absolute;
  top: 0; left: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 8px rgba(255,99,71,0.95), 0 0 16px rgba(255,99,71,0.5);
  opacity: 0;
  offset-rotate: 0deg;
  offset-distance: 0%;
  transform: translate(-50%, -50%);
}
.prob-wrap.sigil-on .sigil-particle {
  animation: sigil-fly 7s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes sigil-fly {
  0%, 12%   { offset-distance: 0%;   opacity: 0; transform: translate(-50%,-50%) scale(.6); }
  18%       { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  62%       { offset-distance: 100%; opacity: 1; transform: translate(-50%,-50%) scale(1); }
  72%       { opacity: 1; transform: translate(-50%,-50%) scale(1.6); }
  85%       { offset-distance: 100%; opacity: 0; transform: translate(-50%,-50%) scale(.4); }
  100%      { offset-distance: 100%; opacity: 0; }
}

.prob-left {
  flex: 1;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  position: relative;
  z-index: 3;
}

.prob-tag {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; background: var(--paper);
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
  opacity: 0; transform: translateX(-20px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
.prob-tag.in { opacity: 1; transform: none; }
.prob-wrap.sigil-on .prob-tag.in { animation: tag-jitter 4.8s ease-in-out infinite; }
.prob-wrap.sigil-on .prob-tag.in:nth-child(2) { animation-delay: -0.6s; animation-duration: 5.2s; }
.prob-wrap.sigil-on .prob-tag.in:nth-child(3) { animation-delay: -1.2s; animation-duration: 5.6s; }
.prob-wrap.sigil-on .prob-tag.in:nth-child(4) { animation-delay: -1.8s; animation-duration: 5.0s; }
.prob-wrap.sigil-on .prob-tag.in:nth-child(5) { animation-delay: -2.4s; animation-duration: 5.4s; }
.prob-wrap.sigil-on .prob-tag.in:nth-child(6) { animation-delay: -3.0s; animation-duration: 4.6s; }
@keyframes tag-jitter {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(0.6px, -0.8px); }
  50%      { transform: translate(-0.5px, 0.6px); }
  75%      { transform: translate(0.4px, 0.7px); }
}

/* Subtle "trying to connect" — a faint dashed cross-link pulse between tag groups */
.prob-tag::before {
  content: ''; position: absolute; top: 50%; right: -8px;
  width: 8px; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,99,71,0.4), transparent);
  opacity: 0;
  pointer-events: none;
}
.prob-wrap.sigil-on .prob-tag.in::before {
  animation: tag-bridge 4.2s ease-in-out infinite;
}
.prob-wrap.sigil-on .prob-tag.in:nth-child(3n)::before { display: none; }
@keyframes tag-bridge {
  0%, 100% { opacity: 0; transform: scaleX(.4); }
  40%      { opacity: 0.55; transform: scaleX(1); }
  55%      { opacity: 0; transform: scaleX(1.2); }
}

.prob-tag-icon { width: 28px; height: 28px; opacity: .5; }

.prob-tag-name {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  font-weight: 500;
}

.prob-tag-broken {
  font-size: 10px; color: var(--hot);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .06em; display: flex; align-items: center; gap: 5px;
}

.prob-tag::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg, var(--hot) 0, var(--hot) 4px, transparent 4px, transparent 9px
  );
}

/* Arrow */
.prob-arrow {
  flex-shrink: 0; padding: 0 32px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative;
  z-index: 3;
}
.prob-arrow-line {
  width: 2px; height: 80px;
  background: linear-gradient(to bottom, var(--hot), transparent);
  flex-shrink: 0;
}
.prob-arrow-head {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--hot);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prob-arrow-tail {
  width: 2px; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--ink));
}

/* Right — Kentro mark */
.prob-right {
  flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  opacity: 0; transform: translateX(20px);
  transition: opacity .7s .6s ease, transform .7s .6s cubic-bezier(.2,.8,.2,1);
  position: relative;
  z-index: 3;
}
.prob-right.in { opacity: 1; transform: none; }

.prob-kentro-mark {
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  position: relative;
}
.prob-kentro-mark::after {
  content: ''; position: absolute; inset: -10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,99,71,0.5);
  opacity: 0;
  pointer-events: none;
}
.prob-wrap.sigil-on .prob-kentro-mark { animation: kentro-pulse 1.6s ease-out infinite; }
.prob-wrap.sigil-on .prob-kentro-mark::after { animation: kentro-ring 1.6s ease-out infinite; }
@keyframes kentro-pulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,.18), 0 0 0 0 rgba(255,99,71,0); transform: scale(1); }
  35%      { box-shadow: 0 12px 40px rgba(0,0,0,.18), 0 0 0 14px rgba(255,99,71,0.18); transform: scale(1.04); }
}
@keyframes kentro-ring {
  0%   { opacity: 0.7; transform: scale(.85); }
  90%  { opacity: 0;   transform: scale(1.35); }
  100% { opacity: 0;   transform: scale(1.35); }
}
.prob-kentro-mark svg { width: 54px; height: 54px; }

.prob-kentro-wordmark {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 22px; letter-spacing: -.02em; text-transform: lowercase;
}
.prob-kentro-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}

/* Tagline */
.prob-tagline {
  text-align: center; margin-top: 56px;
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 300;
  font-size: clamp(32px, 5vw, 60px); letter-spacing: -.04em; line-height: .95;
}
.prob-tagline em {
  display: inline-block;
  background: linear-gradient(135deg, #FF4D2E 0%, #FF8050 55%, #FFBA80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@media(max-width:900px) {
  .prob-wrap { flex-direction: column; gap: 24px; padding: 28px; }
  .prob-left { grid-template-columns: 1fr 1fr; }
  .prob-arrow { flex-direction: row; padding: 0; }
  .prob-arrow-line,
  .prob-arrow-tail {
    width: 40px; height: 2px;
    background: linear-gradient(to right, var(--hot), transparent);
  }
}

@media(max-width:520px) {
  .prob-wrap { padding: 20px; border-radius: 18px; }
  .prob-left { gap: 8px; }
  .prob-tag { padding: 12px 12px; border-radius: 10px; }
  .prob-tag-name { font-size: 10px; }
  .prob-tag-broken { font-size: 9px; }
  .prob-tag-icon { width: 22px; height: 22px; }
  .prob-kentro-mark { width: 80px; height: 80px; }
  .prob-kentro-mark svg { width: 44px; height: 44px; }
  .prob-tagline { margin-top: 36px; font-size: clamp(28px, 8vw, 44px); }
}
