/* ============================================================
   RIAWORKS — Timeline "A Jornada" · 1997 → 2026 · v3 (mock aprovado)
   Linha ortogonal que se desenha com o scroll e PLUGA nos cards;
   cards ricos (ícone/chip/índice); construção da logo em cadeia
   (gabarito pontilhado + ? → cubos rolando um a um); ponta neon.
   Estados apagados/transições vivem sob .jornada.live (JS);
   sem JS ou com prefers-reduced-motion, tudo aparece montado.
   ============================================================ */

.jornada {
  --live: #4ade80;
  position: relative;
  z-index: 1;
  padding: clamp(4rem, 10vh, 8rem) clamp(1.2rem, 4vw, 4rem) 4rem;
  max-width: 1280px;
  margin: 0 auto;
}
.jornada::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 26% at 12% 18%, rgba(250,93,25,0.05), transparent 70%),
    radial-gradient(36% 24% at 88% 72%, rgba(250,93,25,0.045), transparent 70%),
    repeating-linear-gradient(0deg,  rgba(255,255,255,0.025) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg,  rgba(255,255,255,0.010) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.010) 0 1px, transparent 1px 16px);
  -webkit-mask-image: radial-gradient(90% 92% at 50% 50%, #000 40%, transparent 88%);
          mask-image: radial-gradient(90% 92% at 50% 50%, #000 40%, transparent 88%);
  z-index: 0;
}

.jornada-head {
  text-align: center;
  margin-bottom: clamp(3.4rem, 9vh, 6rem);
}
.jornada-head h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 1.1rem;
}
.rewind-counter {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: var(--orange);
  opacity: 0.85;
  min-height: 1.4em;
}

/* ---------- trilho ---------- */
.tl-wrap { position: relative; }
#tlSpine {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
}
.spine-glow-outer { fill:none; stroke:var(--orange); stroke-width:18; opacity:.07; filter:blur(14px); stroke-linecap:round; }
.spine-glow       { fill:none; stroke:#ff7a33;      stroke-width:7;  opacity:.26; filter:blur(6px);  stroke-linecap:round; }
.spine-core       { fill:none; stroke:#ff8a45;      stroke-width:2.4; stroke-linecap:round; }

/* ponta neon: sempre piscando onde o traço parou */
.tip-core {
  fill: #ffc27a;
  animation: tip-blink 1.15s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255,170,90,0.95)) drop-shadow(0 0 14px rgba(250,93,25,0.7));
}
.tip-halo {
  fill: none;
  stroke: rgba(255,160,80,0.55);
  stroke-width: 2;
  animation: tip-ping 1.5s ease-out infinite;
}
@keyframes tip-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes tip-ping {
  0% { r: 6; opacity: .8; }
  100% { r: 22; opacity: 0; }
}

/* ---------- item ---------- */
.tl-item {
  position: relative;
  display: flex;
  margin-bottom: clamp(2.4rem, 6vh, 3.6rem);
}
.tl-item.card-right { justify-content: flex-end; }
.tl-item.card-left  { justify-content: flex-start; }

/* ---------- card rico ---------- */
.tl-card {
  position: relative;
  width: min(416px, 100%);
  background: #161b1ea3;
  border: 1px solid rgba(46,50,54,0.15);
  border-radius: 16px;
  padding: 1.6rem 1.8rem 1.5rem;
  backdrop-filter: blur(4px);
}
.tl-card::after {
  content: '';
  position: absolute; right: 12px; bottom: 12px;
  width: 14px; height: 14px;
  border-right: 2px solid rgba(250,93,25,0.55);
  border-bottom: 2px solid rgba(250,93,25,0.55);
  border-radius: 0 0 4px 0;
}

.tl-card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.95rem;
}
.tl-icircle {
  flex: 0 0 54px;
  width: 54px; height: 54px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 25%, rgba(250,93,25,0.10), rgba(0,0,0,0.25) 70%);
  border: 1px solid rgba(250,93,25,0.45);
  box-shadow: 0 0 18px rgba(250,93,25,0.12) inset, 0 0 14px rgba(250,93,25,0.10);
}
.tl-icircle svg { width: 24px; height: 24px; stroke: var(--orange-soft); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* cards com asset: ilha 110px transbordando acima; LABEL ao lado da ilha, TÍTULO abaixo
   (padrão validado no card RAC e replicado nos 11) */
.tl-head-asset { position: relative; display: block; padding-top: 40px; }
.tl-icircle-asset {
  position: absolute; top: -65px; left: -50px;
  width: auto; height: 93px; /* altura fixa = geometria do padrão RAC; base da ilha e gap iguais nos 11 */
  display: block;
  flex: none; margin: 0;
  background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible;
}
.tl-icircle-asset img {
  display: block; height: 93px; width: auto;
  filter: drop-shadow(0 12px 16px rgba(0,0,0,0.55));
}
.tl-head-asset .tl-overline {
  position: absolute; top: 0; left: 74px;
  padding-left: 0; margin: 0;
}
.tl-head-asset .tl-head-txt h3 { padding-left: 0; }
.tl-head-txt { min-width: 0; }
.tl-overline {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--orange);
  margin-bottom: 0.38rem;
}
.tl-card h3 {
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.tl-card.has-3d .tl-idx { top: auto; bottom: 16px; right: 36px; }
.tl-idx {
  position: absolute;
  top: 16px; right: 18px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: #5b6066;
  white-space: nowrap;
}
.tl-body {
  font-size: 0.93rem;
  line-height: 1.75;
  color: #b3b8be;
  margin-bottom: 1.05rem;
}
.tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: #d4d8dc;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
}
.tl-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px rgba(250,93,25,0.8);
}
.tl-chip.live .dot {
  background: var(--live);
  box-shadow: 0 0 8px rgba(74,222,128,0.8);
}

/* ---------- encaixe: nó NA linha, stub plugado no card ----------
   âncoras são filhas do ITEM (imóveis): card 416px pinado na borda =>
   offsets literais. Só o card desliza na entrada; o nó já está NA linha. */
.tl-node {
  position: absolute;
  top: 40px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  background: var(--bg);
  box-shadow: 0 0 14px rgba(250,93,25,0.55), 0 0 34px rgba(250,93,25,0.18);
  z-index: 2;
}
.tl-node::after {
  content: '';
  position: absolute; inset: 6px;
  border-radius: 50%;
  background: var(--orange);
}
.tl-stub {
  position: absolute;
  top: 52px;
  height: 2px;
  background: linear-gradient(90deg, #ff8a45, rgba(250,93,25,0.85));
  box-shadow: 0 0 8px rgba(250,93,25,0.5);
  z-index: 1;
}
.tl-plug {
  position: absolute;
  top: 49px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(250,93,25,0.9);
  z-index: 3;
}
.tl-item.card-right .tl-node { right: 462px; }
.tl-item.card-right .tl-stub { right: 416px; width: 46px; }
.tl-item.card-right .tl-plug { right: 412px; }
.tl-item.card-left .tl-node { left: 462px; }
.tl-item.card-left .tl-stub { left: 416px; width: 46px; }
.tl-item.card-left .tl-plug { left: 412px; }

/* ---------- ano lateral com linha-guia ---------- */
.tl-side {
  position: absolute;
  top: 42px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}
.tl-item.card-right .tl-side { right: 492px; flex-direction: row; }
.tl-item.card-left  .tl-side { left:  492px; flex-direction: row-reverse; }
.tl-side-year {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(250,93,25,0.35);
}
.tl-leader {
  width: 46px;
  border-top: 1px dashed rgba(250,93,25,0.55);
}

/* ---------- mini-ilhas 3D nos cards-chave ---------- */
.tl-icon3d {
  position: absolute;
  top: -80px;
  width: 118px;
  filter: drop-shadow(0 16px 18px rgba(0,0,0,0.5));
  pointer-events: none;
  z-index: 4;
}
.tl-item.card-right .tl-icon3d { right: -56px; }
.tl-item.card-left  .tl-icon3d { left: -56px; }

/* ============================================================
   MONTAGEM "CANTEIRO DE OBRAS": gabarito 100% pontilhado com 3
   interrogações piscando; cubos entram GRANDES, rolando em 3D,
   em cadeia (um assenta, o próximo já parte). Conteúdo injetado
   pelo JS em .tl-assembly. Ordem: CIMA → ESQUERDA → DIREITA.
   ============================================================ */
.tl-assembly { position: relative; width: 100%; aspect-ratio: 686 / 647; }
.asm-ghost { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.asm-ghost path {
  fill: none;
  stroke: rgba(250,93,25,0.5);
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.asm-ghost g { opacity: .6; transition: opacity .55s ease; }
.asm-ghost .q {
  font-family: var(--font-mono);
  font-size: 128px;
  fill: rgba(255,150,80,0.55);
  text-anchor: middle;
  animation: q-blink 1.9s ease-in-out infinite;
}
.asm-ghost .qb { animation-delay: .45s; }
.asm-ghost .qc { animation-delay: .9s; }
@keyframes q-blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.tl-assembly.tgt-top .g-top,
.tl-assembly.tgt-left .g-left,
.tl-assembly.tgt-right .g-right { animation: ghost-target 1s ease-in-out infinite; }
@keyframes ghost-target { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.tl-assembly.b-top .g-top, .tl-assembly.b-left .g-left, .tl-assembly.b-right .g-right,
.tl-assembly.hold-right .g-right .q { opacity: 0; }

.tl-assembly .cube {
  position: absolute;
  width: 50%;
  opacity: 0;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,0.5));
  will-change: transform, opacity;
}
.tl-assembly .c-top   { left: 25%; top: 0; z-index: 1; }
.tl-assembly .c-left  { left: 0; top: 42.35%; z-index: 2; }
.tl-assembly .c-right { left: 50%; top: 42.35%; z-index: 2; }
.tl-assembly .cube.travel { z-index: 6; }
.tl-assembly .cube.set {
  opacity: 1;
  animation: cube-settle .5s ease-out, cube-idle 5.5s ease-in-out .5s infinite;
}
.tl-assembly .c-left.set  { animation-delay: 0s, 1.1s; }
.tl-assembly .c-right.set { animation-delay: 0s, 2.2s; }
@keyframes cube-settle {
  0% { filter: drop-shadow(0 14px 18px rgba(0,0,0,0.5)) drop-shadow(0 0 26px rgba(250,93,25,0.65)); }
  100% { filter: drop-shadow(0 14px 18px rgba(0,0,0,0.5)); }
}
@keyframes cube-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.4%); }
}
/* cubo da direita PAIRANDO (checkpoint 2017 / reduced-motion parcial) */
.tl-assembly .c-tilt {
  position: absolute;
  left: 53%; top: 16%;
  width: 46%;
  opacity: 0;
  z-index: 6;
  filter: drop-shadow(0 18px 20px rgba(0,0,0,0.55));
  transition: opacity .4s ease;
}
.tl-assembly.hold-right .c-tilt { opacity: 1; animation: cube-hover 3.2s ease-in-out infinite; }
.tl-assembly.hold-right .c-right { opacity: 0 !important; }
@keyframes cube-hover {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6%) rotate(2deg); }
}
.asm-glow {
  position: absolute;
  left: 12%; right: 12%; bottom: -5%;
  height: 20%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(250,93,25,0.42), transparent 70%);
  filter: blur(10px);
  opacity: .2;
  transition: opacity .6s ease;
}
.tl-assembly.b-top .asm-glow { opacity: .45; }
.tl-assembly.b-top.b-left .asm-glow { opacity: .65; }
.tl-assembly.b-top.b-left.b-right .asm-glow { opacity: .95; }

/* ---------- trilho sticky da montagem (desktop largo) ---------- */
.tl-build-rail {
  position: absolute;
  right: calc(-1 * ((100vw - 1280px) / 2) + 10px);
  top: 0; bottom: 0;
  width: 170px;
  pointer-events: none;
  z-index: 3;
}
.tl-build {
  position: sticky;
  top: 30vh;
  text-align: center;
}
.tl-build .tl-assembly { width: 158px; margin: 0 auto; }
.tl-build-year {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.tl-build-cap {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  line-height: 1.6;
  color: var(--ink-dim);
}
@media (max-width: 1660px) {
  .tl-build-rail { width: 118px; right: calc(-1 * ((100vw - 1280px) / 2) - 54px); }
  .tl-build .tl-assembly { width: 112px; }
}
@media (max-width: 1420px) { .tl-build-rail { display: none; } }

/* ---------- checkpoints de construção (mobile) ---------- */
@media (min-width: 861px) { .tl-checkpoint { display: none; } }
.tl-cp-year {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: rgba(19,21,23,0.92);
  border: 1px solid rgba(250,93,25,0.28);
  border-radius: 999px;
  padding: 0.28rem 0.9rem;
  position: relative;
  z-index: 2;
}
.tl-cp-cap {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  background: rgba(19,21,23,0.9);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  position: relative;
  z-index: 2;
}

/* ---------- remate: a linha entrega a logo montada ---------- */
.tl-finale {
  position: relative;
  padding-top: 1rem;
  text-align: center;
}
.tl-finale-logo {
  position: relative;
  width: 280px;
  margin: 0 auto;
}
.tl-finale-logo::before {
  content: '';
  position: absolute;
  left: 50%; bottom: -4px;
  width: 230px; height: 64px;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(250,93,25,0.32), transparent 70%);
  filter: blur(12px);
}
.tl-finale-logo img { width: 100%; display: block; filter: drop-shadow(0 22px 34px rgba(0,0,0,0.6)); }
.tl-finale-cap {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--orange);
}
.jornada-remate {
  margin-top: 1.1rem;
  text-align: center;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  font-weight: 600;
  line-height: 1.5;
}

/* ============================================================
   MOBILE (≤860px): cards alternam recuo esq/dir; a linha
   serpenteia pelo lado oposto CONTORNANDO cada card e plugando
   na borda; checkpoints de construção no meio do trilho.
   ============================================================ */
@media (max-width: 860px) {
  /* cards apagados carregam translateX de entrada: clipa para não
     esticar a área rolável horizontal no mobile */
  .jornada { padding-left: 1.1rem; padding-right: 1.1rem; overflow-x: clip; }
  .tl-item { margin-bottom: 5.2rem; } /* vão maior = corredor para a linha cruzar entre os cards */
  .tl-card { width: calc(100% - 52px); padding: 1.35rem 1.4rem 1.3rem; }
  .tl-card h3 { font-size: 1.08rem; }
  .tl-body { font-size: 0.88rem; }

  .tl-item.card-right .tl-node { right: auto; left: 8px; }
  .tl-item.card-right .tl-stub { right: auto; left: 30px; width: 22px; }
  .tl-item.card-right .tl-plug { right: auto; left: 48px; }
  .tl-item.card-left .tl-node { left: auto; right: 8px; }
  .tl-item.card-left .tl-stub { left: auto; right: 30px; width: 22px; }
  .tl-item.card-left .tl-plug { left: auto; right: 48px; }

  .tl-side { top: -32px; }
  .tl-leader { display: none; }
  .tl-side-year { font-size: 0.95rem; }
  .tl-item.card-right .tl-side { right: auto; left: 52px; flex-direction: row; }
  .tl-item.card-left .tl-side { left: auto; right: 52px; flex-direction: row-reverse; }

  .tl-icon3d { width: 84px; top: -56px; }
  .tl-item.card-right .tl-icon3d { right: -10px; }
  .tl-item.card-left .tl-icon3d { left: -10px; }

  /* mini-ilhas dos cards: menores e no lado OPOSTO ao plug/ano
     (card-left tem linha+ano à direita → ilha à esquerda, e vice-versa);
     left -50px clipava no overflow-x e o ano sobrepunha a ilha */
  .tl-icircle-asset, .tl-icircle-asset img { height: 72px; }
  .tl-icircle-asset { top: -44px; }
  .tl-item.card-left .tl-icircle-asset { left: -10px; right: auto; }
  .tl-item.card-right .tl-icircle-asset { left: auto; right: -10px; }
  .tl-item.card-left .tl-head-asset .tl-overline { left: 92px; }
  .tl-item.card-right .tl-head-asset .tl-overline { left: 0; }
  /* ilha à direita cobriria o índice no topo → índice desce para a base */
  .tl-card .tl-idx { top: auto; bottom: 14px; right: 34px; }

  .tl-checkpoint {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto 3.6rem;
  }
  .tl-checkpoint .tl-assembly { width: 150px; }
  .tl-checkpoint .asm-ghost { opacity: .65; }

  .tl-finale-logo { width: 220px; }
}

/* ============================================================
   MODO VIVO (.jornada.live, aplicado pelo JS quando motion ok):
   estados apagados + transições. Sem .live, tudo visível.
   ============================================================ */
.jornada.live .tl-node {
  border-color: #3c4045;
  box-shadow: none;
  transition: border-color .4s ease, box-shadow .4s ease;
}
.jornada.live .tl-node::after { background: #3c4045; transition: background .4s ease; }
.jornada.live .tl-stub { opacity: 0; transition: opacity .45s ease .1s; }
.jornada.live .tl-plug { opacity: 0; transition: opacity .45s ease .2s; }
.jornada.live .tl-side { opacity: .35; transition: opacity .5s ease; }
.jornada.live .tl-side-year { color: var(--ink-dim); text-shadow: none; transition: color .5s ease, text-shadow .5s ease; }
.jornada.live .tl-card {
  opacity: 0;
  filter: blur(8px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1),
              transform .8s cubic-bezier(.22,1,.36,1),
              filter .8s ease;
}
.jornada.live .tl-item.card-right .tl-card { transform: translateX(72px) translateY(18px) scale(.97); }
.jornada.live .tl-item.card-left  .tl-card { transform: translateX(-72px) translateY(18px) scale(.97); }
.jornada.live .tl-item.lit .tl-node {
  border-color: var(--orange);
  box-shadow: 0 0 14px rgba(250,93,25,0.55), 0 0 34px rgba(250,93,25,0.18);
}
.jornada.live .tl-item.lit .tl-node::after { background: var(--orange); }
.jornada.live .tl-item.lit .tl-stub { opacity: 1; }
.jornada.live .tl-item.lit .tl-plug { opacity: 1; }
.jornada.live .tl-item.lit .tl-side { opacity: 1; }
.jornada.live .tl-item.lit .tl-side-year { color: var(--ink); text-shadow: 0 0 18px rgba(250,93,25,0.35); }
.jornada.live .tl-item.lit .tl-card { opacity: 1; transform: none; filter: none; }
.jornada.live .tl-finale-logo {
  opacity: 0;
  transform: translateY(26px) scale(.94);
  transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1);
}
.jornada.live .tl-finale-logo.lit { opacity: 1; transform: none; }
.jornada.live .tl-cp-year { color: var(--ink-dim); transition: color .5s ease; }
.jornada.live .tl-checkpoint.lit .tl-cp-year { color: var(--ink); }
/* no modo vivo, cubos começam ocultos (o motor de voo controla) */
.jornada.live .tl-assembly .cube:not(.set):not(.travel) { opacity: 0; }
/* sem modo vivo (no-JS / reduced-motion): logo completa, sem gabarito */
.jornada:not(.live) .tl-assembly .cube { opacity: 1; }
.jornada:not(.live) .tl-assembly .c-tilt { opacity: 0; }
.jornada:not(.live) .asm-ghost { opacity: 0; }
.jornada:not(.live) .asm-glow { opacity: .95; }
