/* =============================================================================
   THE ROADMAP — three bars running at once, the log, and the way in.
   In the game's UI 2 language (js/light.js). Frames: one 3px outline that
   follows the stair cut, never an edge bar (owner's rule). Motion is
   transform / opacity / clip only, never stepped.
   ========================================================================== */

body.ui2 #roadmap { position: relative; z-index: 5; padding: 0 0 120px; background: none; }
.rm-page { position: relative; max-width: 1240px; margin: 0 auto; padding: 0 40px; display: flex; flex-direction: column; gap: 14vh; }
.rm-page .sf-h2 .ch { display: inline-block; white-space: pre; opacity: 0; }
.rm-page .sf-h2.ign .ch { animation: ignite 560ms var(--ease-out) both; animation-delay: calc(var(--i) * 24ms); }

/* a framed plate (same construction as every frame on the redone pages) */
.rm-frame, .rm-card, .rm-stats li, .rm-head, .rm-here span { position: relative; isolation: isolate; clip-path: var(--stair-sm); background: var(--frame, color-mix(in srgb, var(--bc, var(--holo)) 34%, #0a1019)); }
.rm-frame::before, .rm-card::before, .rm-stats li::before, .rm-head::before, .rm-here span::before { content: ''; position: absolute; inset: 3px; z-index: -1; clip-path: var(--stair-sm);
  background: var(--dither), var(--fill, rgba(8, 13, 22, 0.92)); }

/* ---------------------------------------------------------------- TOP --- */
.rm-top { padding-top: 150px; display: flex; flex-direction: column; gap: 24px; }
.rm-title { font-size: clamp(54px, 6vw + 16px, 128px); }
.rm-title em { color: var(--holo); }
.rm-top .sf-lede { max-width: 52ch; }
.rm-top > * { opacity: 0; }
.rm-top.seen > * { animation: rise 600ms var(--ease-out) both; }
.rm-top.seen > :nth-child(1) { animation-delay: 0ms; } .rm-top.seen > :nth-child(2) { animation: none; opacity: 1; }
.rm-top.seen > :nth-child(3) { animation-delay: 700ms; } .rm-top.seen > :nth-child(4) { animation-delay: 900ms; } .rm-top.seen > :nth-child(5) { animation-delay: 1200ms; }
.rm-stats { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 900px; gap: 14px; }
.rm-stats li { --frame: color-mix(in srgb, var(--holo) 30%, #0a1019); padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 6px; }
.rm-stats b { font-family: var(--f-num); font-weight: 800; font-size: clamp(40px, 3vw + 14px, 64px); line-height: 1; color: var(--holo); text-shadow: 0 0 22px var(--holo-dim); }
.rm-stats span { font-family: var(--f-label); font-weight: 600; font-size: 14px; letter-spacing: 0.16em; color: var(--ink-3); }
.rm-rule { --bw: 3px; padding: 22px 26px; max-width: 760px; }
.rm-rule .lt-stack { display: flex; flex-direction: column; gap: 8px; }

/* shared bits of copy */
.rm-st { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-label); font-weight: 700; font-size: 13px; letter-spacing: 0.18em; color: var(--bc, var(--holo)); }
.rm-st .lt-pip { --c: var(--bc, var(--holo)); background: var(--bc, var(--holo)); width: 8px; height: 8px; }
.rm-st em { font-style: normal; margin-left: 4px; padding: 1px 6px; font-size: 12px; letter-spacing: 0.14em; color: var(--ink-3); background: rgba(255, 255, 255, 0.06); clip-path: var(--stair-sm); }
.rm-rule .rm-st { --bc: var(--sun); }
.rm-name { margin: 0; font-family: var(--f-title); font-weight: 700; font-size: 24px; line-height: 1.05; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.rm-line { margin: 0; font-family: var(--f-body); font-size: 19px; line-height: 1.3; color: var(--ink-2); }
.rm-sechead { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }
.rm-sechead .sf-h2 { font-size: clamp(44px, 4vw + 16px, 92px); }

/* ------------------------------------------------------------ THE BARS --- */
.rm-heads { display: grid; grid-template-columns: 104px repeat(3, 1fr); gap: 0 18px; margin-bottom: 28px; }
.rm-heads::before { content: ''; }
.rm-head { --frame: color-mix(in srgb, var(--bc) 45%, #0a1019); all: unset; box-sizing: border-box; position: relative; isolation: isolate; clip-path: var(--stair-sm); background: var(--frame);
  padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; cursor: default; }
.rm-head::before { content: ''; position: absolute; inset: 3px; z-index: -1; clip-path: var(--stair-sm); background: var(--dither), color-mix(in srgb, var(--bc) 8%, rgba(8, 13, 22, 0.94)); }
.rm-hname { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: 0.03em; color: var(--bc); }
.rm-ic { width: 26px; height: 26px; flex: none; background: var(--bc); -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.rm-hmeter { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.rm-hmeter .lt-rail > i { background: linear-gradient(90deg, color-mix(in srgb, var(--bc) 60%, transparent), var(--bc) 80%, #fff); transition-duration: 1600ms; }
.rm-hmeter b { font-size: 24px; color: var(--ink); } .rm-hmeter small { font-family: var(--f-num); font-weight: 700; font-size: 15px; color: var(--ink-3); }
.rm-tabline { display: none; }
.rm-hline { font-family: var(--f-body); font-size: 17px; line-height: 1.3; color: var(--ink-2); }

/* the grid: a WHEN column and three bars, every row shared by all three */
.rm-grid { position: relative; display: grid; grid-template-columns: 104px repeat(3, 1fr); grid-template-rows: repeat(var(--rows), auto); gap: 0 18px; }
.rm-col, .rm-whens { grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; }
.rm-whens { grid-column: 1; }
.rm-whens span { padding: 22px 0 0; font-family: var(--f-label); font-weight: 700; font-size: 14px; letter-spacing: 0.18em; color: var(--ink-3); }
.rm-whens span.now { color: var(--holo); }

/* a cell: its segment of the bar on the left, its card on the right */
.rm-cell { position: relative; padding: 10px 0 10px 40px; min-height: 64px; }
/* THE CONDUIT: one continuous channel down each bar. Where the work is done
   its core is lit and light keeps flowing down through it; at the step in
   progress the light runs out halfway; ahead of it the channel is dark. */
.rm-wire { position: absolute; left: 8px; top: 0; bottom: 0; width: 10px; overflow: hidden;
  background: #070b12; box-shadow: inset 2px 0 0 color-mix(in srgb, var(--bc) 22%, #0a1019), inset -2px 0 0 color-mix(in srgb, var(--bc) 22%, #0a1019); }
.rm-core { position: absolute; left: 3px; right: 3px; top: 0; bottom: 0; background: var(--bc); transform-origin: top; transform: scaleY(0);
  transition: transform 800ms var(--ease-out); box-shadow: 0 0 8px var(--bc); }
.rm-cell.lit .rm-core { transform: none; }
.rm-cell.now .rm-core { bottom: 50%; }
.rm-cell.next .rm-core, .rm-cell.idea .rm-core { left: 4px; right: 4px; box-shadow: none; opacity: 0.35;
  background: repeating-linear-gradient(to bottom, var(--bc) 0 3px, transparent 3px 9px); }
/* the flow: bright packets travelling down the lit core */
.rm-flow { position: absolute; left: 2px; right: 2px; top: -100%; height: 100%; opacity: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 34px, rgba(255, 255, 255, 0.95) 34px 40px, transparent 40px 70px); }
.rm-cell.done.lit .rm-flow { opacity: 1; animation: rm-flow 1.6s linear infinite; }
.rm-cell.now.lit .rm-flow { opacity: 1; bottom: 50%; animation: rm-flow 1.1s linear infinite; }
@keyframes rm-flow { to { transform: translateY(100%); } }
.rm-cell.now .rm-wire::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 50%; background: linear-gradient(to bottom, color-mix(in srgb, var(--bc) 40%, transparent), transparent); }

/* THE SOCKET: a square pixel plate on the conduit */
.rm-node { position: absolute; left: -2px; top: 20px; width: 30px; height: 30px; z-index: 1; clip-path: var(--stair-sm); transform: scale(0);
  transition: transform 500ms var(--ease-spring) 250ms; background: color-mix(in srgb, var(--bc) 35%, #0a1019); }
.rm-node > i { position: absolute; inset: 3px; clip-path: var(--stair-sm); background: #070b12; }
.rm-cell.lit .rm-node { transform: none; }
.rm-cell.done .rm-node { background: var(--bc); }
.rm-cell.done .rm-node > i { background: var(--bc); }
.rm-cell.done .rm-node > i::after { content: ''; position: absolute; inset: 0; background: #070b12;
  -webkit-mask: url(/assets/icons/px/check.svg) center / contain no-repeat; mask: url(/assets/icons/px/check.svg) center / contain no-repeat; }
.rm-cell.now .rm-node { width: 36px; height: 36px; left: -5px; top: 17px; background: var(--bc); }
.rm-cell.now .rm-node > i { background: #fff; animation: rm-core 1.4s ease-in-out infinite; }
@keyframes rm-core { 50% { opacity: 0.55; } }
/* the step in progress sends square rings out, in whole pixels */
.rm-cell.now .rm-node::before, .rm-cell.now .rm-node::after { content: none; }
.rm-cell.now::after { content: ''; position: absolute; left: -5px; top: 17px; width: 36px; height: 36px; z-index: 0; pointer-events: none;
  box-shadow: 0 0 0 3px var(--bc); opacity: 0; animation: rm-ring 1.8s ease-out infinite; }
@keyframes rm-ring { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(2.2); opacity: 0; } }
.rm-cell.next .rm-node > i::after, .rm-cell.idea .rm-node > i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: color-mix(in srgb, var(--bc) 45%, transparent); }
.rm-cell.empty { min-height: 40px; }

.rm-card { --frame: color-mix(in srgb, var(--bc) 30%, #0a1019); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateX(16px);
  transition: opacity 500ms var(--ease-out) 200ms, transform 600ms var(--ease-out) 200ms; }
.rm-cell.lit .rm-card { opacity: 1; transform: none; }
.rm-card .rm-name { font-size: 22px; }
.rm-card .rm-line { font-size: 17px; }
.rm-cell.done .rm-card { --fill: color-mix(in srgb, var(--bc) 6%, rgba(8, 13, 22, 0.92)); }
/* the step in progress: fully lit, and a band of light keeps crossing it */
.rm-cell.now .rm-card { --frame: var(--bc); --fill: color-mix(in srgb, var(--bc) 14%, rgba(8, 13, 22, 0.94)); overflow: hidden; }
.rm-cell.now .rm-card::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none; transform: translateX(-140%) skewX(-14deg);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bc) 22%, transparent), transparent); animation: rm-sweep 3.2s var(--ease-out) infinite; }
@keyframes rm-sweep { to { transform: translateX(320%) skewX(-14deg); } }
.rm-cell.now .rm-name { font-size: 28px; color: #fff; }
/* plans: the shape is there, the details are still moving */
.rm-cell.next .rm-card { --frame: color-mix(in srgb, var(--bc) 22%, #0a1019); }
.rm-cell.idea .rm-card { --frame: color-mix(in srgb, var(--bc) 16%, #0a1019); }
.rm-cell.idea .rm-name, .rm-cell.idea .rm-line { color: var(--ink-3); }
.rm-cell.idea.lit .rm-card { animation: rm-drift 6s ease-in-out infinite; animation-delay: calc(var(--d, 0) * 1s); }
@keyframes rm-drift { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
.rm-cell.done .rm-st { color: color-mix(in srgb, var(--bc) 70%, var(--ink-3)); }
.rm-cell.next .rm-st, .rm-cell.idea .rm-st { color: var(--ink-3); }
.rm-cell.next .rm-st .lt-pip, .rm-cell.idea .rm-st .lt-pip { background: rgba(255, 255, 255, 0.2); box-shadow: none; }

/* WE ARE HERE: a line across all three bars at the frontier */
.rm-here { grid-column: 1 / -1; position: relative; pointer-events: none; z-index: 3; align-self: start; height: 0; }
.rm-here::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--holo), color-mix(in srgb, var(--holo) 30%, transparent));
  -webkit-mask: repeating-linear-gradient(to right, #000 0 6px, transparent 6px 9px); mask: repeating-linear-gradient(to right, #000 0 6px, transparent 6px 9px);
  transform-origin: left; animation: rm-here 1600ms var(--ease-out) both; }
@keyframes rm-here { from { transform: scaleX(0); } to { transform: none; } }
.rm-here span { --frame: var(--holo); --fill: color-mix(in srgb, var(--holo) 18%, rgba(8, 13, 22, 0.96)); position: absolute; left: 0; top: -17px; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 7px; font-family: var(--f-label); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; color: var(--holo); white-space: nowrap; }
.rm-here .lt-pip { width: 8px; height: 8px; }
.rm-whens span.now { visibility: hidden; }

/* ------------------------------------------------------------- THE LOG --- */
.rm-log { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.rm-log .lt-card { --bw: 3px; padding: 20px 22px 22px; }
.rm-log .lt-card:not(.lt-lit) { opacity: 0; }
.rm-log .lt-stack { display: flex; flex-direction: column; gap: 10px; }
.rm-empty { grid-column: 1 / -1; max-width: 760px; }
.rm-empty .rm-st { --bc: var(--holo); }
.rm-meta { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--f-label); font-weight: 600; font-size: 14px; letter-spacing: 0.16em; color: var(--ink-3); }
.rm-meta .lt-tag { font-family: var(--f-label); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; padding: 5px 10px 6px; }
.rm-sample { font-style: normal; color: var(--sun); }
.rm-tldr { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rm-tldr li { position: relative; padding-left: 18px; font-family: var(--f-body); font-size: 19px; line-height: 1.3; color: var(--ink); }
.rm-tldr li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; background: var(--lamp); transform: rotate(45deg); }
.rm-test { margin: 0; font-family: var(--f-body); font-size: 18px; color: var(--ink-2); }
.rm-test b { font-family: var(--f-label); font-weight: 700; font-size: 13px; letter-spacing: 0.18em; color: var(--sun); margin-right: 10px; }
.rm-notes summary { list-style: none; align-self: flex-start; width: max-content; }
.rm-notes summary::-webkit-details-marker { display: none; }
.rm-notes ul { margin: 10px 0 0; padding-left: 20px; font-family: var(--f-body); font-size: 17px; line-height: 1.35; color: var(--ink-2); }
.rm-notes[open] ul { animation: rise 360ms var(--ease-out) both; }
.rm-fixes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rm-fixes li { position: relative; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.rm-fixes li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; background: var(--lamp); transform: rotate(45deg); }
.rm-issue { font-family: var(--f-body); font-size: 19px; line-height: 1.3; color: var(--ink); }
.rm-fix { font-family: var(--f-body); font-size: 17px; line-height: 1.3; color: var(--ink-2); }
.rm-notes .rm-fixes { margin-top: 10px; padding-left: 0; }

/* ------------------------------------------------------------- THE END --- */
.rm-end { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px; padding-bottom: 6vh; }
.rm-big { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 4.4vw + 16px, 100px); line-height: 0.92; text-transform: uppercase; color: var(--ink); }
.rm-big em { font-style: normal; color: var(--holo); }
.rm-epi { margin: 0; max-width: 48ch; font-family: var(--f-body); font-size: clamp(21px, 0.6vw + 16px, 26px); line-height: 1.35; color: var(--ink-2); }
.rm-epi em { font-style: normal; color: var(--sun); }
.rm-cta { --bw: 3px; width: min(720px, 100%); padding: 32px 36px 30px; text-align: left; }
.rm-cta:not(.lt-lit) { opacity: 0; }
.rm-cta .lt-stack { display: flex; flex-direction: column; gap: 14px; }
.rm-cta .rm-name { font-size: 34px; }
#rmSignup { display: flex; gap: 16px; align-items: flex-end; margin: 6px 0 0; }
#rmSignup .sf-field { flex: 1 1 auto; }
#rmSignup input { width: 100%; background: transparent; border: 0; outline: none; padding: 6px 2px 10px; font-family: var(--f-body); font-size: 26px; color: var(--ink); caret-color: var(--sun);
  box-shadow: 0 3px 0 0 rgba(255, 255, 255, 0.16); }
#rmSignup input:focus { box-shadow: 0 3px 0 0 var(--sun), 0 14px 28px -14px var(--sun); }
.rm-cta .formnote { margin: 0; min-height: 1.3em; font-family: var(--f-label); font-weight: 600; font-size: 15px; letter-spacing: 0.14em; color: var(--ink-3); }
.rm-cta .formnote.ok { color: var(--ok); } .rm-cta .formnote.bad { color: var(--bad); }
.rm-sign { margin: 0; font-family: var(--f-label); font-weight: 700; font-size: 18px; letter-spacing: 0.3em; color: var(--ink-3); }
.rm-end > :not(.rm-cta) { opacity: 0; }
.rm-end.seen > :not(.rm-cta) { animation: rise 700ms var(--ease-out) both; }
.rm-end.seen > :nth-child(2) { animation-delay: 300ms; } .rm-end.seen > :nth-child(4) { animation-delay: 900ms; }

/* ------------------------------------------------------------- PHONES ---- */
@media (max-width: 900px) {
  .rm-page { padding: 0 16px; gap: 10vh; }
  .rm-top { padding-top: 120px; }
  .rm-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; } .rm-stats b { font-size: 32px !important; }
  .rm-stats li { padding: 16px; }
  .rm-stats span { font-size: 14px; }
  /* the three bar heads become tabs; one bar is shown at a time */
  .rm-heads { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
  .rm-heads::before { display: none; }
  .rm-head { cursor: pointer; padding: 12px 10px 12px; gap: 8px; min-height: 44px; }
  .rm-head .rm-hline { display: none; }
  .rm-hname { font-size: 19px; gap: 8px; } .rm-ic { width: 18px; height: 18px; }
  .rm-hmeter { grid-template-columns: 1fr auto; } .rm-hmeter small { display: none; } .rm-hmeter b { font-size: 18px; }
  .rm-head:not(.on) { --frame: color-mix(in srgb, var(--bc) 22%, #0a1019); opacity: 0.75; }
  .rm-head.on { --frame: var(--bc); }
  .rm-tabline { display: block; margin: 0 0 20px; font-family: var(--f-body); font-size: 17px; line-height: 1.3; color: var(--ink-2); }
  .rm-grid { grid-template-columns: 58px 1fr; gap: 0 10px; }
  .rm-col { grid-column: 2 !important; }
  #rmBoard[data-show="go"] .rm-col:not([data-bar="go"]), #rmBoard[data-show="sd"] .rm-col:not([data-bar="sd"]), #rmBoard[data-show="li"] .rm-col:not([data-bar="li"]) { display: none; }
  .rm-whens span { font-size: 13px; letter-spacing: 0.08em; }
  .rm-card .rm-name { font-size: 20px; } .rm-cell.now .rm-name { font-size: 24px; }
  .rm-log { grid-template-columns: 1fr; }
  .rm-cta { padding: 24px 20px; }
  #rmSignup { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .rm-core, .rm-card, .rm-node { transition: none !important; transform: none !important; opacity: 1 !important; }
  .rm-flow, .rm-cell.now::after, .rm-cell.now .rm-node > i { animation: none !important; }
  .rm-cell.now .rm-card::after, .rm-cell.idea .rm-card, .rm-here::before { animation: none !important; }
  .rm-top > *, .rm-end > *, .rm-page .sf-h2 .ch { opacity: 1 !important; animation: none !important; }
}
body.routemode .legnow { display: none !important; }
/* the cards' pointer lights are wider than a phone; clip them to the page so nothing can pan sideways */
body.ui2 #roadmap { overflow-x: clip; }
@media (max-width: 900px) {
  .rm-st { font-size: 14px; } .rm-st em { font-size: 13px; }
  .rm-cta .lt-label { font-size: 14px; }
}
@media (max-width: 900px) {
  .rm-st em { font-size: 14px; }
  .rm-hname { font-size: 17px; letter-spacing: 0.01em; white-space: nowrap; }
  .rm-head .rm-ic { display: none; }
  .rm-head { padding: 12px 8px; align-items: stretch; }
  .rm-stats b { font-size: 38px; white-space: nowrap; }
}
@media (max-width: 380px) { .rm-hname { font-size: 15px; } }
@media (max-width: 900px) { .rm-hname { font-family: var(--f-label); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; } }
@media (max-width: 380px) { .rm-hname { font-size: 13.5px; letter-spacing: 0.03em; } }
@media (max-width: 900px) { .rm-stats li { padding: 14px 10px; } .rm-stats b { font-size: 27px !important; } }

/* the conduit and its sockets are drawn as pixel liquid (js/roadmap.js startConduits) */
.rm-col { position: relative; }
.rm-liquid { position: absolute; left: -6px; top: 0; z-index: 2; pointer-events: none; image-rendering: pixelated; }
.rm-wire, .rm-node { display: none !important; }
.rm-cell.now::after { left: -3px; top: 17px; }
@media (max-width: 380px) { .rm-hname { font-size: 14px !important; white-space: normal; line-height: 1.05; } }
