/* ================= Base / Desktop ================= */
.gtl-timeline {
  --gtl-bg: #081612;
  --gtl-bg2: #06120f;
  --gtl-card-start: #167a57;
  --gtl-card-end: #0b1e17;
  --gtl-line: #2e4a40;
  --gtl-dot: #ffffff;
  --gtl-text: #ecf5ef;
  --gtl-muted: #d9eee5;
  --gtl-radius: 18px;
  --dot: 18px; /* desktop dot size */

  position: relative;
  padding: 10px 12px 10px;
  color: var(--gtl-text);
  background: radial-gradient(1200px 700px at 50% -10%, #0b2a20 0%, var(--gtl-bg) 38%, var(--gtl-bg2) 100%);
  font-family:
    "Urbanist",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}
.gtl-timeline h2 {
  text-align: center;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 3vw, 42px);
  margin: 0 0 60px;
}

.gtl-timeline__list {
  --gap: 90px; /* vertical distance between items (desktop) */
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  display: grid;
  gap: var(--gap);

  /* add padding so the rail starts/ends exactly at dot centers */
  padding-top: calc(var(--dot) / 2);
  padding-bottom: calc(var(--dot) / 2);
  margin-bottom: 36px; /* space above CTA */
}

/* Single continuous rail on desktop (no per-item segments) */
.gtl-timeline__list::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--dot) / 2);
  bottom: calc(var(--dot) / 2);
  width: 2px;
  background: var(--gtl-line);
  opacity: 0.9;
  z-index: 0;
}

/* Items */
.gtl-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  position: relative;
}

/* Center dot (desktop) */
.gtl-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--gtl-dot);
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.08),
    inset 0 0 0 2px #101010;
  z-index: 1;
}

/* Remove earlier per-item connectors (we have a full rail now) */
.gtl-item::after {
  display: none;
}

.gtl-card {
  background: radial-gradient(120% 180% at 20% 10%, rgba(255, 255, 255, 0.06) 0%, transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.08)),
    linear-gradient(135deg, var(--gtl-card-start), var(--gtl-card-end));
  border-radius: var(--gtl-radius);
  padding: 28px 26px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  max-width: 520px;
  position: relative;
  z-index: 2; /* keep above rail */
}
.gtl-card h4 {
  margin: 0 0 14px;
  font-weight: 700;
  font-size: 20px;
}
.gtl-card p {
  margin: 0;
  color: var(--gtl-muted);
  line-height: 1.6;
  font-size: 17px;
}

/* Alternate sides on desktop */
.gtl-item:nth-child(odd) .gtl-card {
  grid-column: 1;
  justify-self: end;
  margin-right: 40px;
}
.gtl-item:nth-child(even) .gtl-card {
  grid-column: 2;
  justify-self: start;
  margin-left: 40px;
}

/* CTA */
.gtl-timeline .cta {
  display: block;
  margin: 10px auto 0;
  text-align: center;
  font-weight: 700;
  color: #fff;
  padding: 18px 25px;
  border-radius: 14px;
  max-width: 680px;
  background: linear-gradient(270deg, #ff3e3e, #ff6a3a, #ff3e3e);
  background-size: 400% 400%;
  animation: ctaGradient 6s ease infinite;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.gtl-timeline .cta small {
  display: block;
  font-weight: 600;
  opacity: 0.95;
}
@keyframes ctaGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ================= Mobile: all-left + continuous left rail ================= */

/* ============ Mobile: all-left + dots perfectly on the rail ============ */
/* ========= Mobile: dot on the line, cards cleared to the right ========= */
@media (max-width: 768px) {
  /* one place to tune things */
  .gtl-timeline {
    --dot: 0px; /* dot diameter */
    --rail-width: 0px; /* line thickness */
    --rail-left: 24px; /* LEFT edge of the line (tweak 23–26px if needed) */
    /* space between the OUTER edge of the dot and the card */
  }

  .gtl-timeline {
    padding: 40px 16px 60px;
  }
  .gtl-timeline h2 {
    margin-bottom: 36px;
    font-size: 26px;
  }

  .gtl-timeline__list {
    --gap: 36px;
    position: relative;
    display: block;

    /* rail + full dot + extra gutter = card never touches the dot */
    padding-left: calc(var(--rail-left) + var(--dot) + var(--gutter));

    /* rail starts/ends at dot centers */
    padding-top: calc(var(--dot) / 2);
    padding-bottom: calc(var(--dot) / 2);
    margin-bottom: 36px;
  }

  /* single continuous rail */
  .gtl-timeline__list::before {
    content: "";
    position: absolute;
    left: var(--rail-left); /* left EDGE of the line */
    top: calc(var(--dot) / 2);
    bottom: calc(var(--dot) / 2);
    width: var(--rail-width);
    background: var(--gtl-line);
    opacity: 0.9;
    z-index: 0; /* behind dot & card */
  }
  .gtl-item::before {
    box-shadow:
      0 0 0 6px rgba(255, 255, 255, 0),
      inset 0 0 0 2px #101010;
  }
  .gtl-item {
    position: relative;
    display: block;
    margin-bottom: var(--gap);
  }
  .gtl-item:last-child {
    margin-bottom: 0;
  }

  /* dot centered on the rail */
  .gtl-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: calc(var(--rail-left) + (var(--rail-width) / 2) - (var(--dot) / 2));
    width: var(--dot);
    height: var(--dot);
    border-radius: 50%;
    background: #fff;
    box-shadow:
      0 0 0 6px rgba(255, 255, 255, 0.08),
      inset 0 0 0 2px #101010;
    z-index: 2; /* above the card */
  }

  /* kill desktop alternation & any extra margins */
  .gtl-item::after {
    display: none;
  }
  .gtl-item .gtl-card {
    margin-left: 0 !important; /* rely on list padding for spacing */
    margin-right: 0 !important;
    width: auto;
    max-width: none;
    padding: 18px;
    border-radius: 16px;
    position: relative;
    z-index: 1; /* below dots, above rail */
  }

  .gtl-card h4 {
    font-size: 18px;
    margin-bottom: 6px;
  }
  .gtl-card p {
    font-size: 15px;
    line-height: 1.55;
  }

  .gtl-timeline .cta {
    margin-top: 40px;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cta,
  .sticky-btn,
  .js-open {
    animation: none !important;
  }
}

/* Subtle periodic shake with a long idle */
@keyframes cta-pulse-shake {
  0%,
  92%,
  100% {
    transform: translateX(0) rotate(0);
  }
  2% {
    transform: translateX(-2px) rotate(-0.5deg);
  }
  4% {
    transform: translateX(2px) rotate(0.5deg);
  }
  6% {
    transform: translateX(-2px) rotate(-0.5deg);
  }
  8% {
    transform: translateX(2px) rotate(0.5deg);
  }
  10% {
    transform: translateX(-1px) rotate(-0.25deg);
  }
  12% {
    transform: translateX(1px) rotate(0.25deg);
  }
}

/* Apply to ALL CTAs */
.cta,
.sticky-btn,
.js-open {
  animation: cta-pulse-shake 5s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}

/* Optional: a slightly stronger shake when hovered/focused */
@keyframes cta-shake-quick {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  20% {
    transform: translateX(-2px) rotate(-0.5deg);
  }
  40% {
    transform: translateX(2px) rotate(0.5deg);
  }
  60% {
    transform: translateX(-2px) rotate(-0.5deg);
  }
  80% {
    transform: translateX(2px) rotate(0.5deg);
  }
}
.cta:hover,
.cta:focus,
.sticky-btn:hover,
.sticky-btn:focus,
.js-open:hover,
.js-open:focus {
  animation:
    cta-pulse-shake 8s ease-in-out infinite,
    cta-shake-quick 0.6s ease-in-out;
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cta,
  .sticky-btn {
    animation: none !important;
  }
  .cta::after,
  .sticky-btn::after {
    animation: none !important;
  }
}

/* make buttons a clipping context for the sheen */
.cta,
.sticky-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate; /* keeps the sheen above background, below text */
}

/* the white sheen */
.cta::after,
.sticky-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%; /* start off the left side */
  width: 50%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 45%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  animation: btn-shine 3.6s ease-in-out infinite;
  /* optional: make it happen less often */
  animation-delay: 1s;
}


/* faster pass on hover/focus */
.cta:hover::after,
.cta:focus::after,
.sticky-btn:hover::after,
.sticky-btn:focus::after {
  animation-duration: 1.2s;
}

@keyframes btn-shine {
  0% {
    left: -150%;
  }
  55% {
    left: 130%;
  } /* sweep across */
  100% {
    left: 130%;
  } /* idle offscreen */
}
