/* ============================================
   TIMELINE / JOURNEY PAGE
   Vanilla reimplementation · site palette
   Reuses :root tokens from style.css
   ============================================ */

.jt-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 128px 24px 96px;
  overflow: hidden;
}

/* ── Header ── */
.jt-header {
  text-align: center;
  margin-bottom: 80px;
  position: relative;
  z-index: 2;
}

.jt-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.jt-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  display: inline-block;
  position: relative;
}
.jt-title::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -12px;
  transform: translateX(-50%);
  width: 56px; height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

/* ── Floating orbs ── */
.jt-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.jt-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.16;
  background: var(--accent);
}
.jt-orb:nth-child(1) { width: 260px; height: 260px; top: 8%;  left: 6%;  animation: tlFloat 22s ease-in-out infinite; }
.jt-orb:nth-child(2) { width: 200px; height: 200px; top: 30%; left: 78%; opacity: 0.1;  animation: tlFloat 28s ease-in-out infinite reverse; }
.jt-orb:nth-child(3) { width: 320px; height: 320px; top: 52%; left: 12%; opacity: 0.08; animation: tlFloat 34s ease-in-out infinite; }
.jt-orb:nth-child(4) { width: 180px; height: 180px; top: 70%; left: 70%; animation: tlFloat 26s ease-in-out infinite reverse; }
.jt-orb:nth-child(5) { width: 220px; height: 220px; top: 86%; left: 30%; opacity: 0.1;  animation: tlFloat 30s ease-in-out infinite; }
.jt-orb:nth-child(6) { width: 150px; height: 150px; top: 18%; left: 45%; opacity: 0.09; animation: tlFloat 24s ease-in-out infinite reverse; }

@keyframes tlFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.15); }
  66%      { transform: translate(-30px, 30px) scale(1.05); }
}

/* ── Timeline structure ── */
.jt-timeline {
  position: relative;
  z-index: 2;
}

/* central vertical line */
.jt-timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent) 8%, var(--accent) 92%, transparent);
  box-shadow: 0 0 14px rgba(255, 0, 79, 0.5);
}

.jt-item {
  position: relative;
  width: 50%;
  margin-bottom: 72px;
  box-sizing: border-box;
}
.jt-item[data-side="left"]  { left: 0;   padding-right: 56px; }
.jt-item[data-side="right"] { left: 50%; padding-left: 56px; }

/* node on the line */
.jt-node {
  position: absolute;
  top: 6px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  color: #fff;
  z-index: 3;
  cursor: default;
  transition: box-shadow 0.3s, transform 0.3s;
}
.jt-item[data-side="left"]  .jt-node { right: -20px; }
.jt-item[data-side="right"] .jt-node { left: -20px; }

.jt-item:hover .jt-node,
.jt-item:focus-within .jt-node {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(255, 0, 79, 0.18), 0 0 20px rgba(255, 0, 79, 0.6);
}

/* ── Card ── */
.jt-card {
  position: relative;
  background: rgba(22, 22, 22, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.35s ease;
  transform:
    perspective(1000px)
    rotateY(calc(var(--tiltX, 0) * var(--tilt-dir, 1) * 1deg))
    rotateX(calc(var(--tiltY, 0) * -1deg));
  transform-style: preserve-3d;
}
.jt-item[data-side="left"]  .jt-card { --tilt-dir: -1; }
.jt-item[data-side="right"] .jt-card { --tilt-dir: 1; }

.jt-card:hover,
.jt-card:focus {
  border-color: var(--border-h);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}

/* media */
.jt-media {
  position: relative;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  background: var(--surface-2);
}
.jt-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.jt-card:hover .jt-media img { transform: scale(1.06); }
.jt-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(8, 8, 8, 0.85));
}

.jt-cat {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 5px;
  color: #fff;
  border: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.6);
  backdrop-filter: blur(6px);
}
.jt-cat--milestone { color: var(--accent);  border-color: var(--border-h); }
.jt-cat--blog      { color: var(--live);     border-color: rgba(74, 222, 128, 0.5); }
.jt-cat--project   { color: #38bdf8;          border-color: rgba(56, 189, 248, 0.5); }

/* body */
.jt-body { padding: 18px 20px 20px; }

.jt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.jt-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.jt-pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: tlPulse 2s ease-in-out infinite;
}
@keyframes tlPulse {
  0%, 100% { transform: scale(1);   opacity: 0.7; }
  50%      { transform: scale(1.5); opacity: 1; }
}

.jt-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

/* expandable description */
.jt-desc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
  margin-top: 0;
}
.jt-desc > * { overflow: hidden; }
.jt-card:hover .jt-desc,
.jt-card:focus .jt-desc,
.jt-card.is-open .jt-desc {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 12px;
}
.jt-desc p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 12px;
}
.jt-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
}

/* bottom progress bar */
.jt-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  transition: width 0.5s ease;
}
.jt-card:hover .jt-progress,
.jt-card:focus .jt-progress,
.jt-card.is-open .jt-progress { width: 100%; }

/* ── Scroll reveal (JS toggles .is-visible) ── */
.jt-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.jt-item[data-side="left"]  { transform: translate(-40px, 24px); }
.jt-item[data-side="right"] { transform: translate(40px, 24px); }
.jt-item.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}
/* keep the card tilt after reveal */
.jt-item.is-visible .jt-card { will-change: transform; }

.jt-hint {
  text-align: center;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  position: relative;
  z-index: 2;
}

/* ── Responsive: single left-rail column ── */
@media (max-width: 760px) {
  .jt-page {
    padding: 104px 16px 72px;
    overflow-x: hidden;
  }

  /* header scales down */
  .jt-header { margin-bottom: 56px; }
  .jt-kicker { font-size: 11px; }

  /* rail pinned to the far left */
  .jt-timeline::before {
    left: 16px;
    transform: none;
  }

  /* full-width cards, room for rail + node on the left */
  .jt-item,
  .jt-item[data-side="left"],
  .jt-item[data-side="right"] {
    width: 100%;
    left: 0;
    margin-left: 0;
    padding-left: 46px;
    padding-right: 0;
    margin-bottom: 40px;
  }

  /* node centred on the rail */
  .jt-node,
  .jt-item[data-side="left"]  .jt-node,
  .jt-item[data-side="right"] .jt-node {
    left: 16px;
    right: auto;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .jt-item:hover .jt-node,
  .jt-item:focus-within .jt-node {
    transform: translateX(-50%) scale(1.12);
  }

  /* no 3D tilt on mobile */
  .jt-card { transform: none !important; }

  /* reveal: vertical only (no lateral shift → no horizontal scroll) */
  .jt-item,
  .jt-item[data-side="left"],
  .jt-item[data-side="right"] { transform: translateY(24px); }
  .jt-item.is-visible,
  .jt-item[data-side="left"].is-visible,
  .jt-item[data-side="right"].is-visible { transform: translateY(0); }

  /* closure banner breathes */
  .jt-closure { margin-top: 48px; padding: 28px 20px; }
  .jt-closure-quote { font-size: 40px; }
  .jt-closure p { font-size: 15px; }
}

/* ── Accessibility: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .jt-orb { animation: none; }
  .jt-pulse { animation: none; }
  .jt-card { transform: none !important; }
  .jt-item { transition: opacity 0.3s ease; transform: none; }
}

/* ── Closure Banner ── */
.jt-closure {
  max-width: 680px;
  margin: 64px auto 0;
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(22, 22, 22, 0.4) 0%, rgba(8, 8, 8, 0.7) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.jt-closure::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.jt-closure-quote {
  font-family: var(--sans);
  font-size: 48px;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: -10px;
  opacity: 0.8;
}
.jt-closure p {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.8;
  color: var(--text-2);
  letter-spacing: -0.01em;
  margin: 0;
}

.closure-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s ease, text-shadow 0.2s ease;
}
.closure-link:hover {
  text-shadow: 0 0 8px rgba(255, 0, 79, 0.6);
  opacity: 0.9;
}

.jt-action-link {
  transition: all 0.25s ease;
}
.jt-action-link:hover {
  text-shadow: 0 0 8px rgba(255, 0, 79, 0.5);
  opacity: 0.85;
}
