/* The roadmap page (roadmap.html). Layers on the tokens in style.css, in the look of changelog.css: a panel head
   with the gold wash, then one vertical line of opaque cards on the plain ground. Phones get the line in the left
   gutter; from 900px it runs down the middle and the cards alternate sides (js/roadmap.js sets is-left / is-right on
   the VISIBLE cards, so a filtered view still alternates). Status is always words; a node's fill only echoes it. */

/* ---------- Head ---------- */
.rm-head {
  border-bottom: 1px solid var(--line-faint);
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(200, 169, 94, 0.08), transparent 60%),
    var(--bg-panel);
}
.rm-head-inner { max-width: 1080px; margin: 0 auto; padding: 56px 24px 28px; }
.rm-head-inner h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 14px; }
.rm-kicker {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  margin: 0 0 10px;
}
.rm-lede { color: var(--muted); max-width: 60ch; margin: 0 0 14px; }
.rm-fresh { color: var(--muted); font-size: 0.85rem; margin: 0 0 4px; }
.rm-next { color: var(--ink); margin: 0 0 22px; overflow-wrap: anywhere; }
.rm-next-link { color: var(--gold-bright); font-weight: 700; }

/* ---------- Controls ---------- */
.rm-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 18px 0 14px;
}
.rm-chips, .rm-range { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.rm-chip {
  font-family: Cinzel, Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  min-height: 36px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.rm-chip:hover { color: var(--gold-bright); border-color: var(--gold-deep); }
.rm-chip[aria-pressed="true"] { color: var(--bg); background: var(--gold); border-color: var(--gold-bright); }
.rm-chip:disabled, .rm-nextup:disabled { opacity: 0.55; cursor: default; }
.rm-nextup { min-height: 36px; }
.rm-summary { color: var(--ink); margin: 0; min-height: 1.65em; font-size: 0.95rem; }

/* ---------- Countdown banner (a fixed-hour drop within a week) ---------- */
.rm-countdown { max-width: 1080px; margin: 24px auto 0; padding: 0 24px; }
.rm-cd-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  border: 1px solid var(--gold-deep);
  border-radius: 6px;
  background: var(--gold-wash);
  padding: 12px 18px;
}
.rm-cd-h { font-size: 0.72rem; letter-spacing: 0.2em; color: var(--gold-bright); margin: 0; }
.rm-cd-line { color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.rm-cd-title { color: var(--gold-bright); font-weight: 700; }
.rm-cd-left { color: var(--gold-bright); font-variant-numeric: tabular-nums; }

/* ---------- The line: phones first (line in the left gutter) ---------- */
.rm-list { max-width: 1080px; margin: 0 auto; padding: 28px 24px 80px; }
.rm-state { color: var(--muted); padding: 40px 0; text-align: center; margin: 0; }
.rm-line { position: relative; list-style: none; margin: 0; padding: 0; }
.rm-line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: var(--line);
}
.rm-line > li { position: relative; }
.rm-line > li[hidden], .rm-countdown[hidden], .rm-fresh[hidden], .rm-next[hidden] { display: none; }

.rm-item { padding-left: 40px; margin: 0 0 16px; }
.rm-node {
  position: absolute;
  left: 9px;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--gold-deep);
  background: var(--bg);
}
.rm-node[data-status="live"] { background: var(--gold); border-color: var(--gold); }
.rm-node[data-status="testing"] {
  border-color: var(--gold-bright);
  background: radial-gradient(circle, var(--gold-bright) 0 2.5px, var(--bg) 3px);
}
.rm-node[data-status="progress"] {
  border-color: var(--gold);
  background: linear-gradient(90deg, var(--gold) 50%, var(--bg) 50%);
}

/* ---------- Cards ---------- */
.rm-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  scroll-margin-top: 90px;                 /* clear of the sticky nav when opened by its link */
  transition: border-color 0.12s ease;
}
.rm-card:hover { border-color: var(--gold-deep); }
.rm-card:focus { outline: none; }
.rm-card:focus-visible { outline: 1.5px dashed var(--gold-bright); outline-offset: 4px; }
.rm-card:target { border-color: var(--gold); }
.rm-eyebrow {
  font-family: Cinzel, Georgia, serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.rm-title {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.rm-blurb { color: var(--muted); font-size: 0.95rem; line-height: 1.55; margin: 0 0 10px; overflow-wrap: anywhere; }
.rm-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-size: 0.86rem;
}
.rm-status {
  font-family: Cinzel, Georgia, serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.6;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.rm-status[data-status="live"] { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.rm-status[data-status="testing"] { color: var(--gold-bright); border-color: var(--gold-bright); }
.rm-status[data-status="progress"] { color: var(--gold); border-color: var(--gold-deep); }
.rm-when { color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rm-rel { color: var(--muted); }
.rm-rel:empty { display: none; }
.rm-rel::before { content: "\00b7"; color: var(--gold-deep); margin-right: 10px; }
.rm-aside, .rm-moved { color: var(--muted); font-size: 0.86rem; margin: 6px 0 0; overflow-wrap: anywhere; }
.rm-moved { font-style: italic; }
.rm-notes {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 0;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-decoration: none;
}
.rm-notes::after { content: " \2192"; letter-spacing: 0; }
.rm-notes:hover { color: var(--gold-bright); text-decoration: none; }

/* ---------- Month dividers, the EARLIER stub, TODAY ---------- */
.rm-month { margin: 26px 0 16px; }
.rm-month-label {
  display: inline-block;
  position: relative;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  line-height: 1.5;
  color: var(--gold);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  margin: 0;
}
.rm-earlier, .rm-empty { padding-left: 40px; margin: 0 0 18px; }
.rm-earlier-line { color: var(--muted); margin: 0; }
.rm-textbtn {
  font-family: Cinzel, Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  background: none;
  border: 0;
  padding: 6px 2px;
  min-height: 32px;
  cursor: pointer;
}
.rm-textbtn:hover { color: var(--gold-bright); }
.rm-empty .rm-state { padding: 18px 0; text-align: left; }

.rm-today { padding-left: 40px; margin: 24px 0; scroll-margin-top: 90px; }
.rm-today::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-bright), rgba(240, 212, 137, 0));
}
.rm-node.rm-today-node {
  top: 50%;
  margin-top: -7px;
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}
.rm-today-label {
  display: inline-block;
  position: relative;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  line-height: 1.5;
  color: var(--gold-bright);
  background: var(--bg);
  border: 1px solid var(--gold-deep);
  border-radius: 999px;
  padding: 3px 14px;
  margin: 0;
}

/* ---------- From 900px: the line down the middle, cards alternating ---------- */
@media (min-width: 900px) {
  .rm-line::before { left: 50%; margin-left: -1px; }
  .rm-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    padding-left: 0;
    margin: 0 0 18px;
    pointer-events: none;                  /* a tucked row's empty half must not swallow clicks on the card above */
  }
  .rm-item > * { pointer-events: auto; }
  .rm-item:not(.is-first) { margin-top: -56px; }     /* tuck each card beside the end of the one before */
  .rm-item > .rm-node {
    position: relative;
    left: auto;
    top: auto;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin-top: 22px;
  }
  .rm-item > .rm-card { grid-row: 1; min-height: 132px; }   /* >= 2 x the tuck + a gap: same-side cards never touch */
  .rm-item.is-left > .rm-card { grid-column: 1; }
  .rm-item.is-right > .rm-card { grid-column: 3; }
  .rm-item > .rm-card::after {
    content: "";
    position: absolute;
    top: 28px;
    width: 21px;
    height: 1px;
    background: var(--line);
  }
  .rm-item.is-left > .rm-card::after { right: -22px; }
  .rm-item.is-right > .rm-card::after { left: -22px; }
  .rm-month, .rm-earlier, .rm-empty, .rm-today { padding-left: 0; text-align: center; }
  .rm-month { margin: 34px 0 22px; }
  .rm-empty .rm-state { text-align: center; }
  /* the label above, the node on the line below it, the hairline through the node */
  .rm-today { margin: 30px 0 34px; padding-bottom: 30px; }
  .rm-node.rm-today-node { top: auto; bottom: 0; margin-top: 0; left: 50%; margin-left: -7px; }
  .rm-today::before {
    top: auto;
    bottom: 6px;
    background: linear-gradient(90deg, rgba(240, 212, 137, 0), var(--gold-bright) 50%, rgba(240, 212, 137, 0));
  }
}

/* ---------- Fade-up on first view: ONLY with motion allowed and IntersectionObserver present (js adds rm-anim) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rm-line.rm-anim .rm-card { transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.12s ease; }
  .rm-line.rm-anim .rm-card:not(.is-seen) { opacity: 0; transform: translateY(12px); }
}

/* ---------- The plain list for readers without JavaScript ---------- */
.rm-static { max-width: 780px; margin: 0 auto; }
.rm-static .rm-state { padding: 16px 0 8px; text-align: left; }
.rm-static-h { font-size: 1.1rem; margin: 22px 0 8px; }
.rm-static-list { color: var(--muted); margin: 0; padding-left: 20px; }
.rm-static-list li { margin-bottom: 6px; overflow-wrap: anywhere; }
.rm-static-list strong { color: var(--ink); }

@media (max-width: 560px) {
  .rm-head-inner { padding: 40px 16px 24px; }
  .rm-list { padding: 20px 16px 60px; }
  .rm-countdown { padding: 0 16px; }
  .rm-card { padding: 14px 14px; }
  .rm-controls { justify-content: flex-start; }
}
