/* songco.de/roadmap: four lanes of cards (ideas, planned, building now,
 * shipped), with votes and the idea form.
 *
 * Loaded after /blog/blog.css and built on its tokens. Same rules: dark only,
 * and the accent is for the primary action and for live state (what is being
 * built now).
 *
 * Wide screens show the lanes side by side, left to right the way an idea
 * travels. Narrow ones stack them with what is happening now first.
 */

.rm-hero { padding-bottom: 40px; }
.rm [hidden] { display: none !important; }
.rm .btn { border: 0; font-family: inherit; cursor: pointer; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ——— lanes ——— */

.rm { display: flex; flex-direction: column; gap: 48px; }
.rm-lane { display: flex; flex-direction: column; min-width: 0; }
.rm-lane[data-lane='building'] { order: 1; }
.rm-lane[data-lane='planned'] { order: 2; }
.rm-lane[data-lane='ideas'] { order: 3; }
.rm-lane[data-lane='shipped'] { order: 4; }
.rm-status { order: 5; }
.rm > *:not(.rm-status) { max-width: 760px; }
/* nothing being built: the lane steps aside on a narrow screen */
.rm-lane[data-empty][data-lane='building'] { display: none; }

@media (min-width: 1080px) {
  .rm {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }
  .rm > *:not(.rm-status) { max-width: none; }
  .rm-lane { order: 0 !important; }
  .rm-lane[data-empty][data-lane='building'] { display: flex; }
  .rm-lane {
    min-height: 240px;
    padding: 14px;
    border-radius: var(--r-xl);
    background: rgba(255, 255, 255, 0.018);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .rm-status { grid-column: 1 / -1; }

  .rm-who { grid-template-columns: 1fr !important; }
}

.rm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin-bottom: 12px; padding-inline: 2px; }
.rm-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.rm-count { color: var(--text-3); font-size: 13px; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.rm-lane[data-lane='building'] .rm-h::before {
  content: '';
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(184, 255, 46, 0.6);
  animation: rm-pulse 2s ease-in-out infinite;
}
@keyframes rm-pulse { 50% { opacity: 0.35; } }

/* top / new */
.rm-sort {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.rm-sort button {
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.rm-sort button:hover { color: var(--text-2); }
.rm-sort button[aria-pressed='true'] { background: var(--surface-3); color: var(--text); }

/* ——— cards ——— */

.rm-list { display: flex; flex-direction: column; gap: 8px; }
.rm-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.rm-item.rm-new { animation: rm-in var(--dur-2) var(--ease) both; }
@keyframes rm-in { from { opacity: 0; transform: translateY(4px); } }
.rm-lane[data-lane='building'] .rm-item:not(.rm-skel) { box-shadow: inset 0 0 0 1px var(--accent-line); }

.rm-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 2px; }
.rm-item-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.rm-detail {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.rm-meta { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* our answer, as a note on the card */
.rm-reply {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.rm-reply-by {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: normal;
}
.rm-reply-by svg { width: 14px; height: 14px; border-radius: 4px; }
.rm-reply-by .mark-tile { fill: #0a0b0d; }
.rm-reply-by .mark-bars { fill: var(--accent); }

/* ——— the vote button ——— */

.rm-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 44px;
  height: 50px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.rm-vote:hover { background: var(--surface-3); color: var(--text); }
.rm-vote:active { transform: scale(0.94); }
.rm-vote svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-2) var(--ease); }
.rm-vote .n { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.rm-vote[aria-pressed='true'] {
  background: var(--surface-4);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
}
.rm-vote[aria-pressed='true'] svg { fill: currentColor; }
.rm-vote.bump svg { animation: rm-bump 0.34s cubic-bezier(0.3, 1.35, 0.5, 1); }
@keyframes rm-bump { 40% { transform: translateY(-3px); } }

/* shipped cards carry a check where the vote was */
.rm-done { display: grid; place-items: center; width: 44px; height: 36px; color: var(--text-3); }
.rm-done svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rm-lane[data-lane='shipped'] .rm-item:not(.rm-skel) { background: transparent; }
.rm-lane[data-lane='shipped'] .rm-item-title { color: var(--text-2); font-weight: 500; }

.rm-empty {
  padding: 18px 12px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
  font-size: 13.5px;
  text-align: center;
}

/* placeholders while the lists load */
.rm-skel .rm-vote { cursor: default; }
.bone {
  display: block;
  height: 11px;
  margin-top: 4px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: rm-sweep 1.4s ease-in-out infinite;
}
.bone-sm { height: 8px; margin-top: 8px; opacity: 0.7; }
@keyframes rm-sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ——— the form ——— */

.rm-form {
  margin-bottom: 12px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--dur-2) var(--ease);
}
.rm-form:hover, .rm-form.open, .rm-form:focus-within { box-shadow: inset 0 0 0 1px var(--line-strong); }

.rm-input {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  outline: none;
}
.rm-input::placeholder { color: var(--text-3); }
.rm-title { height: 48px; padding: 0 14px; font-size: 15px; font-weight: 500; border-radius: var(--r-lg); }
.rm-title:focus-visible { box-shadow: none; }

/* the rest of the form opens below the title */
.rm-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-2) var(--ease); }
.rm-form.open .rm-more { grid-template-rows: 1fr; }
.rm-more-inner { min-height: 0; overflow: hidden; padding: 0 14px; }
.rm-form.open .rm-more-inner { padding-bottom: 14px; }
.rm-more-inner textarea { min-height: 60px; padding: 0; resize: vertical; line-height: 1.5; }

.rm-who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.rm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rm-field > span { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.rm-field .rm-input {
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 14px;
  transition: box-shadow var(--dur-1) var(--ease);
}
.rm-field .rm-input:focus { box-shadow: inset 0 0 0 1px var(--line-strong); }
.rm-field small { color: var(--text-3); font-size: 11.5px; }

.rm-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.rm-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.rm-actions .btn[disabled] { opacity: 0.4; cursor: default; transform: none; }
.rm-actions .btn-primary[disabled]:hover { background: var(--accent); }
.rm-cancel { background: transparent; color: var(--text-2); }
.rm-cancel:hover { background: var(--surface-2); color: var(--text); }
.rm-error { margin-top: 12px; color: #ff7a70; font-size: 13px; }
.rm-error:empty { display: none; }

.rm-sent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 14px;
  animation: rm-in var(--dur-2) var(--ease) both;
}
.rm-sent strong { color: var(--text); font-weight: 600; }

.rm-status { color: var(--text-3); font-size: 13px; }
.rm-status:empty { display: none; }

@media (max-width: 600px) {
  .rm-who { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .rm-lane[data-lane='building'] .rm-h::before, .bone, .rm-vote.bump svg, .rm-item.rm-new, .rm-sent { animation: none; }
  .rm-more { transition: none; }
}

/* lane headings sit smaller once the lanes are side by side */
@media (min-width: 1080px) {
  .rm-h { font-size: 17px; }
}
