/*
 * JuanFi Cloud > Learn > Branch Roaming (branch-roaming.html).
 * Loads after landing.css and reuses its tokens, blocks, steps and questions.
 * The diagram is an inline SVG step player; its colors come from the tokens below.
 */

.roam-page { --ok: #1f7a3f; --ok-soft: #e1f0e3; --err: #b3261e; --err-soft: #f8e1dc; --acc-soft: #fbe3d2; }
.roam-page .bar-nav { flex-wrap: nowrap; gap: 18px; }
.roam-page .bar-nav a { white-space: nowrap; }
.roam-hero-in { display: block; max-width: 900px; padding-block: 76px 84px; }
.roam-hero h1 { max-width: 13ch; }
.roam-hero .lede { max-width: 38em; }

/* ---------- Step player ---------- */
.roam-stage { border: 2px solid var(--ink); background: var(--white); box-shadow: 6px 6px 0 var(--ink); }
.roam-diagram { overflow-x: auto; border-bottom: 2px solid var(--ink); background: var(--paper); }
.roam-diagram svg { display: block; width: 100%; min-width: 640px; height: auto; }
.roam-caption { display: grid; gap: 6px; align-content: start; min-height: 132px; padding: 20px 26px 8px; }
.roam-count { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.roam-caption h3 { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 2.8vw, 34px); line-height: 1.08; letter-spacing: -.6px; text-wrap: balance; }
.roam-caption p { max-width: 62em; color: var(--ink-2); font-size: 18px; }
.roam-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 26px 22px; }
.roam-controls.is-hidden { visibility: hidden; }
.roam-controls button { font: 600 15px var(--body); color: var(--ink); background: var(--white); border: 2px solid var(--ink); padding: 8px 16px; cursor: pointer; }
.roam-controls button:hover { background: var(--paper-2); }
.roam-controls button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.roam-controls .roam-play { background: var(--accent); box-shadow: 3px 3px 0 var(--ink); }
.roam-controls .roam-play:hover { background: var(--accent); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.roam-dots { display: flex; gap: 6px; }
.roam-controls .roam-dots button { width: 34px; height: 34px; padding: 0; border-radius: 50%; font: 600 13px var(--mono); font-variant-numeric: tabular-nums; }
.roam-controls .roam-dots button[aria-current="step"] { background: var(--ink); color: var(--white); }
.roam-hint { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.roam-hint kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--rule); border-bottom-width: 2px; padding: 0 5px; background: var(--paper); }

/* SVG parts */
.roam-diagram text { font-family: var(--body); }
.rd-ink { fill: var(--ink); } .rd-ink2 { fill: var(--ink-2); } .rd-ink3 { fill: var(--ink-3); }
.rd-acc { fill: var(--accent-deep); } .rd-err { fill: var(--err); } .rd-ok { fill: var(--ok); }
.rd-title { font-family: var(--display); font-weight: 800; font-size: 25px; letter-spacing: -.4px; }
.rd-mono { font-family: var(--mono); font-weight: 600; }
.rd-label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 1px; }
.rd-shadow { fill: var(--ink); }
.rd-card { fill: var(--white); stroke: var(--ink); stroke-width: 2; transition: fill .4s; }
.rd-card.is-err { fill: var(--err-soft); }
.rd-card.is-acc { fill: var(--acc-soft); }
.rd-card.is-ok { fill: var(--ok-soft); }
.rd-group { fill: none; stroke: var(--accent-deep); stroke-width: 2; stroke-dasharray: 10 8; }
.rd-cloud { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.rd-cloud-fill { fill: var(--white); }
.rd-router { fill: var(--ink); }
.rd-led { fill: #3ddc84; }
.rd-port { fill: var(--ink-3); }
.rd-rule { stroke: var(--rule); stroke-width: 1.5; }
.rd-strike { stroke: var(--err); stroke-width: 2.5; }
.rd-fade { transition: opacity .45s ease; }
.rd-off { opacity: 0; }
.rd-dim { opacity: .4; }
.rd-pill rect { stroke: var(--ink); stroke-width: 1.5; }
.rd-pill text { font-family: var(--mono); font-size: 13px; font-weight: 600; fill: var(--ink); }
.rd-pill-active rect { fill: var(--ok-soft); } .rd-pill-active text { fill: var(--ok); }
.rd-pill-idle rect { fill: var(--paper-2); }
.rd-pill-ready rect { fill: var(--acc-soft); } .rd-pill-ready text { fill: var(--accent-deep); }
.rd-pill-disabled rect { fill: var(--err-soft); } .rd-pill-disabled text { fill: var(--err); }
.rd-pill-removed rect { fill: var(--paper); } .rd-pill-removed text { fill: var(--ink-3); }
.rd-flow { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; animation: rd-flow .9s linear infinite; }
.rd-flow.is-acc { stroke: var(--accent); } .rd-flow.is-ok { stroke: var(--ok); } .rd-flow.is-err { stroke: var(--err); }
@keyframes rd-flow { to { stroke-dashoffset: -28; } }
.rd-phone { transition: transform 1.1s cubic-bezier(.5, 0, .25, 1); }
.rd-phone-body { fill: var(--ink); }
.rd-phone-screen { fill: var(--white); }

/* ---------- Setup steps (four across) ---------- */
.roam-steps { grid-template-columns: repeat(4, 1fr); }
.roam-steps .where { display: inline-block; margin-top: 14px; font-family: var(--mono); font-size: 13px; color: var(--ink); background: var(--paper-2); padding: 3px 8px; }
.roam-steps code, .faq code { font-family: var(--mono); font-size: .9em; background: var(--paper-2); padding: 1px 5px; }

@media (max-width: 1020px) {
  .roam-steps { grid-template-columns: repeat(2, 1fr); }
  .roam-steps li:nth-child(2) { border-right: 0; }
  .roam-steps li:nth-child(-n+2) { border-bottom: 2px solid var(--ink); }
}

@media (max-width: 720px) {
  .roam-hero-in { padding-block: 58px 66px; }
  .roam-caption { padding: 16px 16px 6px; min-height: 150px; }
  .roam-caption p { font-size: 16px; }
  .roam-controls { padding: 10px 16px 18px; }
  .roam-hint { display: none; }
  .roam-steps { grid-template-columns: 1fr; }
  .roam-steps li:nth-child(-n+2) { border-bottom: 2px solid var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  .rd-flow { animation: none; stroke-dasharray: 8 8; }
}
