/* =========================================================================
   Roadmap — Journey Path layout.
   Re-uses the site's four-element theme variables (--bg, --accent, --grad…)
   so it auto-adopts fire / air / water / earth palettes via [data-theme].
   The .themed-frame wrapper paints the page with the active theme's bg.

   Layout: two-column desktop. Left aside has the brand chunk (caveman SVG
   + H1 + wagon wheel + footer prose). Right side has the milestone trail —
   three sections (now / next / maybe), each with a header marker that
   shares an x-axis with the dots below it, so the spine reads as one
   continuous vertical line from header through every node.
   ========================================================================= */

.themed-frame {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: auto;
  box-sizing: border-box;
  transition: background 0.2s, color 0.2s;
}

/* ---- Shared header / footer chrome --------------------------------------
   These are kept for parity with the rest of the site even though Journey
   uses its own two-column heading (the aside). If you reuse FrameHeader /
   FrameFooter elsewhere on the roadmap page, these rules cover them. */
.frame-header { text-align: center; margin-bottom: 1.5rem; }
.frame-header .caveman-svg {
  width: 64px;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  color: var(--caveman);
  fill: currentColor;
  stroke: currentColor;
}
.frame-header .caveman-svg .eye { fill: var(--bg); stroke: none; }
.frame-h1 {
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 0.25rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}
.frame-sub { color: var(--text-muted); font-size: 14px; margin: 0; }
.frame-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* =========================================================================
   JOURNEY PATH
   ========================================================================= */
.jp-frame {
  /* Desktop wants edge-to-edge; the shared centered-content padding is
     applied as inline padding by the page (40px 44px 32px). */
  display: block;
}

.jp-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: stretch;
  max-width: 1000px;
  margin: 0 auto;
}

/* Aside is a flex column whose children (brand cluster + footer prose)
   are centered together as one composed unit, so empty space only ever
   appears above and below the full cluster — never sandwiched between
   the wheel and the footer. */
.jp-aside {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 4px;
}
.jp-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Slowly-rotating wagon wheel. One full rotation every 14s reads as a
   relaxed idle, not a loading spinner. Tight 6px top margin keeps the
   wheel visually connected to "Inventing the wheel..." above — the
   ellipsis literally trails into the wheel beneath. Held at 60% opacity
   so it reads as ambient texture and doesn't compete with the trail
   data on the right. */
.jp-wheel {
  width: 140px;
  height: 140px;
  display: block;
  margin: 6px 0 0;
  color: var(--caveman);
  opacity: 0.6;
  animation: jp-wheel-spin 14s linear infinite;
  transform-origin: center;
}
@keyframes jp-wheel-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.jp-aside-h1 {
  font-size: 40px;
  font-weight: 600;
  margin: 0 0 0.4rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
/* Subtitle reads as a setup line for the wheel below — italicised, tight
   margin, trailing dots split into their own span so we can space them
   into a visible lead-in. */
.jp-aside-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  font-style: italic;
}
.jp-sub-dots {
  display: inline-block;
  letter-spacing: 0.25em;
  margin-left: 1px;
  color: var(--text-dim);
}
.jp-aside-foot {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

.jp-track { position: relative; }

.jp-section {
  margin-bottom: 22px;
  position: relative;
}

/* ----- Section header mirrors the per-item row's column layout: 18px rail
   column on the left holds the section marker, then title + trailing
   horizontal line. Rail width and gap match .jp-node so the section
   marker sits dead-center over the dots below it. */
.jp-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.jp-section-rail {
  position: relative;
  width: 18px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
}
/* Spine fragment from marker center down past the section header to meet
   the first node's rail — gives the eye a continuous trail from the
   "WORKING ON" marker straight into the first dot. */
.jp-section-rail::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: -8px;
  width: 2px;
  margin-left: -1px;
  background: var(--border);
}
.jp-section.jp-maybe .jp-section-rail::before {
  background: repeating-linear-gradient(
    to bottom,
    var(--border) 0 4px,
    transparent 4px 8px
  );
}

.jp-marker {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: var(--bg);
  position: relative;
  z-index: 1;  /* sit on top of the spine fragment */
}
.jp-marker-now {
  color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.jp-marker-next  { color: var(--text-muted); }
.jp-marker-maybe { color: var(--text-dim); border-style: dashed; }

.jp-section-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.jp-section.jp-now .jp-section-title { color: var(--accent); }
.jp-section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.jp-section.jp-maybe .jp-section-line {
  background: repeating-linear-gradient(
    to right,
    var(--border) 0 4px,
    transparent 4px 8px
  );
}

.jp-nodes {
  display: flex;
  flex-direction: column;
}
.jp-node {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 4px 0;
  position: relative;
}
.jp-node-rail {
  position: relative;
  width: 18px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}
/* Per-node spine fragment. First node's spine runs from its top (meeting
   the section rail spine above) down through the dot; last node terminates
   the spine at the dot's center so it doesn't dangle. */
.jp-node-rail::before {
  content: '';
  position: absolute;
  top: 0; bottom: -8px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--border);
}
.jp-section.jp-maybe .jp-node-rail::before {
  background: repeating-linear-gradient(
    to bottom,
    var(--border) 0 4px,
    transparent 4px 8px
  );
}
.jp-section .jp-nodes .jp-node:last-child .jp-node-rail::before { bottom: 50%; }

.jp-node-dot {
  position: relative;
  z-index: 1;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-hover);
  margin-top: 18px;
  transform-origin: center;
}

/* --- NOW: bursts of two translucent rings ping outward from the active
   dot, then rest. Two pseudo-element rings share the same expand-and-fade
   keyframes; ::after is delayed ~0.45s so the pair reads as a quick double
   ping. The 3s animation cycle leaves a clear ~2s pause between bursts. */
.jp-node.is-active .jp-node-dot {
  background: var(--accent);
  border-color: var(--accent);
}
.jp-node.is-active .jp-node-dot::before,
.jp-node.is-active .jp-node-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
  animation: jp-now-ping 3s ease-out infinite;
}
.jp-node.is-active .jp-node-dot::after { animation-delay: 0.45s; }
@keyframes jp-now-ping {
  0%   { transform: scale(0.9); opacity: 0.6; }
  /* Wave travels out and fades through the first ~half of the cycle… */
  45%  { transform: scale(2.4); opacity: 0; }
  /* …then both pseudos rest until the next cycle begins. */
  100% { transform: scale(2.4); opacity: 0; }
}

/* --- NEXT: gentle "breathing" scale. Each dot is offset by its index so
   the queued dots don't all pulse in unison — feels alive, not robotic.
   Driven by --i set inline on .jp-node. */
.jp-section.jp-next .jp-node .jp-node-dot {
  animation: jp-next-breathe 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.45s);
}
@keyframes jp-next-breathe {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 transparent; }
  50%      { transform: scale(1.18); box-shadow: 0 0 0 3px var(--accent-soft); }
}

/* --- MAYBE: dashed border slowly rotates. Each successive dot has a
   different starting phase so the trio reads as a lazy, unsynced spin
   — the "we'll get to these eventually" vibe rendered in motion.
   Background is opaque (var(--bg)) so the dashed vertical spine doesn't
   bleed through the dot's interior while it rotates. */
.jp-node.is-maybe .jp-node-dot {
  background: var(--bg);
  border-style: dashed;
  animation: jp-maybe-spin 6s linear infinite;
  animation-delay: calc(var(--i, 0) * -2s);
}
@keyframes jp-maybe-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.jp-node-body {
  flex: 1;
  padding: 12px 16px 14px;
  border-radius: 10px;
  margin: 2px 0;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
/* Active item keeps the accent border + accent title — the heavy tinted
   background was dropped so the ping animation does the "look here" work
   without four overlapping accent treatments competing for the eye. */
.jp-node.is-active .jp-node-body { border-color: var(--accent); }
.jp-node-body:hover { background: var(--bg-elevated); }
.jp-node.is-active .jp-node-body:hover { background: transparent; }
.jp-node-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.jp-node.is-active .jp-node-title { color: var(--accent); }
.jp-node-blurb {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Respect reduced-motion preferences — disable trail animations so visitors
   with OS-level motion settings get a static, fully-legible roadmap. */
@media (prefers-reduced-motion: reduce) {
  .jp-node-dot,
  .jp-node-dot::before,
  .jp-node-dot::after,
  .jp-wheel {
    animation: none !important;
  }
}

/* ---- Mobile / narrow ----------------------------------------------------
   Below ~720px the two-column layout collapses to a single column: the
   aside stacks above the track, and the wagon wheel shrinks. The spine
   itself stays intact since it lives on the right column. */
@media (max-width: 720px) {
  .jp-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .jp-aside { padding-top: 8px; }
  .jp-wheel { width: 96px; height: 96px; }
  .jp-aside-h1 { font-size: 32px; }
  .jp-aside-foot { margin-top: 18px; }
}
