/**
 * Roadmap timeline (sections/roadmap-timeline.liquid).
 *
 * A release calendar, not a changelog: the organising fact of each entry is
 * WHEN, so the period ("SEPTEMBER", "Q4 2026") is set in the heading face at
 * display scale. From tablet up it gets its own rail beside the spine -
 * milestone labels down the left, work on the right - and sticks while a
 * long entry scrolls past, so the reader always knows which chapter they are
 * in. On mobile the rail folds away and the period sits as a chapter mark
 * above its card, spine on the left.
 *
 * The spine is segmented per entry rather than one unbroken line: each entry
 * draws its own connector down to the next marker, so the line itself can
 * carry that entry's status - solid success behind shipped work, plain
 * through the current build, dashed ahead of plans. Read top to bottom it is
 * a progress bar through time.
 *
 * Markers and chips encode state without relying on colour alone: shipped is
 * a filled success node carrying a check (the chip repeats it); in progress
 * is a brand-ringed node with a slow breathing halo - the only ambient
 * motion on the page, because it is the one thing actually alive; planned is
 * a dashed hollow, an outline of something that does not exist yet.
 *
 * Entries are quiet outline cards (same bones as .preorder-batch) that lift
 * on hover; a small caret on the card's left edge points back at the
 * entry's own marker so card and node read as one object. Shipped entries
 * recede whole - they are history, not news - while the in-progress card
 * carries a faint brand cast: it is the entry people came to check.
 *
 * All colours are theme tokens or color-mix() tints of them, so dark mode
 * falls out of the token swap with no rules here.
 */
.section-roadmap {
  padding-block: var(--space-8);
}

.roadmap-intro {
  max-width: 640px;
  margin-bottom: var(--space-7);
}

.roadmap-intro__title {
  margin: 0 0 var(--space-3);
}

.roadmap-intro__text {
  color: var(--color-muted);
}

/* Geometry lives in variables because the connector, the marker and the
   card caret all have to agree on where the spine's centreline is - one
   number, three consumers, two breakpoints. */
.roadmap {
  --roadmap-rail-w: 0px;
  --roadmap-spine-w: 36px;
  --roadmap-marker-size: 18px;
  --roadmap-marker-top: 2px;
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 920px;
}

.roadmap__entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--roadmap-spine-w) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'marker rail'
    'marker body';
  padding-bottom: var(--space-7);
}

.roadmap__entry:last-child {
  padding-bottom: 0;
}

/* A second or third product in the same month sits closer to the one
   above it than a new month does, so the gap itself says "same chapter". */
.roadmap__entry--continues {
  margin-top: calc(var(--space-7) * -1 + var(--space-4));
}

/* The segmented spine: this entry's connector down to the next entry's
   marker, stopping short of both nodes so the line reads as segments
   between stations rather than a rod skewering them. */
.roadmap__entry::before {
  content: '';
  position: absolute;
  top: calc(var(--roadmap-marker-top) + var(--roadmap-marker-size) + 6px);
  bottom: 6px;
  left: calc(var(--roadmap-rail-w) + (var(--roadmap-spine-w) / 2) - 1px);
  border-left: 2px solid var(--color-line);
}

.roadmap__entry:last-child::before {
  display: none;
}

.roadmap__entry--shipped::before {
  border-left-color: color-mix(in srgb, var(--color-success) 55%, var(--color-line));
}

.roadmap__entry--planned::before {
  border-left-style: dashed;
}

.roadmap__rail {
  grid-area: rail;
  min-width: 0;
}

/* Markers sit level with the period's cap height, so the chapter mark and
   its node read as one object. */
.roadmap__marker {
  grid-area: marker;
  justify-self: center;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--roadmap-marker-size);
  height: var(--roadmap-marker-size);
  margin-top: var(--roadmap-marker-top);
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-line);
  background-color: var(--color-bg);
}

.roadmap__marker .icon {
  width: 10px;
  height: 10px;
}

.roadmap__entry--shipped .roadmap__marker {
  border-color: var(--color-success);
  background-color: var(--color-success);
  color: var(--color-bg);
}

.roadmap__entry--in_progress .roadmap__marker {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand) 16%, transparent);
}

/* The live core of the in-progress node - a ring alone read as "empty". */
.roadmap__entry--in_progress .roadmap__marker::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--color-brand);
}

.roadmap__entry--planned .roadmap__marker {
  border-style: dashed;
}

@media (prefers-reduced-motion: no-preference) {
  .roadmap__entry--in_progress .roadmap__marker {
    animation: roadmap-breathe 2.6s ease-in-out infinite;
  }

  @keyframes roadmap-breathe {
    0%,
    100% {
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand) 16%, transparent);
    }
    50% {
      box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-brand) 7%, transparent);
    }
  }

  /* Entrance stagger, same rhythm as the card grids in base.css: capped
     because past the fourth entry the reader is scrolling, and each entry
     re-earns its own reveal on the way down. */
  .roadmap > .roadmap__entry:nth-child(2) {
    transition-delay: 80ms;
  }

  .roadmap > .roadmap__entry:nth-child(3) {
    transition-delay: 160ms;
  }

  .roadmap > .roadmap__entry:nth-child(4) {
    transition-delay: 240ms;
  }
}

/* The chapter mark. */
.roadmap__period {
  margin: 0 0 var(--space-3);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* The card. Quiet at rest - the spine is the drawing, cards are the notes
   pinned to it - and lifted on hover/focus like the theme's product cards. */
.roadmap__body {
  grid-area: body;
  position: relative;
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-m);
  background-color: var(--color-bg);
}

.roadmap__entry:hover .roadmap__body,
.roadmap__entry:focus-within .roadmap__body {
  border-color: color-mix(in srgb, var(--color-ink) 22%, var(--color-line));
  box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--color-ink) 30%, transparent);
}

/* It is the entry people came to check, so it wears a trace of brand even
   at rest. A trace: the period rail and marker already shout for it. */
.roadmap__entry--in_progress .roadmap__body {
  border-color: color-mix(in srgb, var(--color-brand) 28%, var(--color-line));
  background-color: color-mix(in srgb, var(--color-brand) 3%, var(--color-bg));
}

.roadmap__entry--in_progress:hover .roadmap__body,
.roadmap__entry--in_progress:focus-within .roadmap__body {
  border-color: color-mix(in srgb, var(--color-brand) 45%, var(--color-line));
  box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--color-brand) 35%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .roadmap__body {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }

  .roadmap__entry:hover .roadmap__body,
  .roadmap__entry:focus-within .roadmap__body {
    transform: translateY(-2px);
  }
}

.roadmap__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
}

/* Status chips: tinted, not solid - a solid fill next to the filled marker
   was two exclamation points on one sentence. Each chip repeats its
   marker's grammar (check / live dot / dashed outline) so state survives
   any single cue failing. */
.roadmap__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 22px;
  padding-inline: var(--space-2);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.roadmap__status .icon {
  width: 10px;
  height: 10px;
}

.roadmap__status--shipped {
  background-color: color-mix(in srgb, var(--color-success) 12%, var(--color-bg));
  color: var(--color-success);
}

.roadmap__status--in_progress {
  background-color: color-mix(in srgb, var(--color-brand) 10%, var(--color-bg));
  color: var(--color-brand);
}

.roadmap__status--planned {
  border: 1px dashed color-mix(in srgb, var(--color-muted) 45%, var(--color-line));
  color: var(--color-muted);
}

.roadmap__status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--color-brand);
}

@media (prefers-reduced-motion: no-preference) {
  .roadmap__status-dot {
    animation: roadmap-dot 2.6s ease-in-out infinite;
  }

  @keyframes roadmap-dot {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.4;
    }
  }
}

.roadmap__title {
  margin: 0 0 var(--space-2);
}

.roadmap__text {
  color: var(--color-muted);
}

/* Done is done: shipped entries recede whole, not just their pill. */
.roadmap__entry--shipped .roadmap__period,
.roadmap__entry--shipped .roadmap__title {
  color: var(--color-muted);
}

.roadmap__entry--shipped .roadmap__media {
  opacity: 0.75;
}

.roadmap__media {
  margin-top: var(--space-4);
  border-radius: var(--radius-s);
  overflow: hidden;
  background-color: var(--color-card-media);
}

.roadmap__media img {
  display: block;
  width: 100%;
  height: auto;
}

.roadmap__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  color: var(--color-ink);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--color-ink);
  padding-bottom: 2px;
}

.roadmap__link:hover {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
}

.roadmap__disclaimer {
  max-width: 920px;
  margin: var(--space-7) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
}

@media screen and (min-width: 750px) {
  .roadmap {
    --roadmap-rail-w: 200px;
    --roadmap-spine-w: 48px;
    --roadmap-marker-size: 22px;
    --roadmap-marker-top: 3px;
  }

  .roadmap__entry {
    grid-template-columns: var(--roadmap-rail-w) var(--roadmap-spine-w) minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: 'rail marker body';
    padding-bottom: var(--space-8);
  }

  .roadmap__rail {
    text-align: right;
  }

  /* Sticky uses the same offset as the collection page's facet rail, so a
     long entry scrolls past while its chapter mark holds station beside
     the spine. */
  .roadmap__period {
    position: sticky;
    top: var(--space-5);
    margin: 0;
    font-size: 26px;
    /* The global break-word (base.css) split month names mid-word at this
       rail width ("SEPTEM / BER"); a chapter mark wraps between words or
       not at all. */
    overflow-wrap: normal;
  }

  .roadmap__marker .icon {
    width: 12px;
    height: 12px;
  }

  /* The caret: the card points back at its own marker, so node and note
     read as one object. Background/border are inherited from the card,
     which keeps it correct through the hover border shift and the
     in-progress tint alike; being a child, it paints over the card's own
     left border behind it. */
  .roadmap__body::before {
    content: '';
    position: absolute;
    top: calc(var(--roadmap-marker-top) + (var(--roadmap-marker-size) / 2) - 5px);
    left: -6px;
    width: 10px;
    height: 10px;
    background-color: inherit;
    border-left: 1px solid;
    border-bottom: 1px solid;
    border-color: inherit;
    transform: rotate(45deg);
  }
}

@media screen and (min-width: 990px) {
  .section-roadmap {
    padding-block: var(--space-9);
  }

  .roadmap__body {
    padding: var(--space-6);
  }
}

