/* Roadmap page: top bar, road map, content card, arrows, diagram. */

body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ---------- Top bar ---------- */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px 28px;
  background: var(--paper);
  border-bottom: 4px solid var(--bni-red);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }

.brand-logo img { height: 34px; width: auto; }

.brand-sub {
  padding-left: 12px;
  border-left: 2px solid var(--line);
  font: italic 800 13px/1.1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-2);
}

.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-title .series { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.topbar-title strong { font: 800 18px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress { display: grid; gap: 6px; justify-items: end; min-width: 220px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.progress-track { width: 220px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--bni-red); border-radius: inherit; transition: width .6s var(--ease); }

/* ---------- Road map ---------- */
.map {
  position: relative;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
  border-bottom: 1px solid var(--line);
}

.map-viewport { position: relative; height: 240px; overflow: hidden; }
.map-svg { position: absolute; left: 0; top: 0; max-width: none; will-change: transform; overflow: visible; }

.hill-far { fill: var(--hill-far); }
.hill-near { fill: var(--hill-near); }
.tree { fill: var(--tree); }

.road-shoulder { fill: none; stroke: var(--road-shoulder); stroke-width: 34; stroke-linecap: round; }
.road { fill: none; stroke: var(--road); stroke-width: 28; stroke-linecap: round; }
.road-trail { fill: none; stroke: var(--bni-red); stroke-width: 28; stroke-linecap: round; opacity: .9; }
.road-line { fill: none; stroke: var(--road-line); stroke-width: 2.5; stroke-dasharray: 12 12; opacity: .85; }

.milestone { cursor: pointer; outline: none; }
.milestone-post { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 3 3; }
.milestone-dot { fill: var(--paper); stroke: var(--ink-2); stroke-width: 3; transition: fill .3s, stroke .3s, r .3s; }
.milestone-num { text-anchor: middle; font: 800 13px var(--font-display); fill: var(--ink); pointer-events: none; }
.milestone-icon { text-anchor: middle; font-size: 22px; }
.milestone-label {
  text-anchor: middle;
  font: 800 13px var(--font-display);
  fill: var(--ink-2);
  paint-order: stroke;
  stroke: var(--sky-bottom);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.milestone.is-done .milestone-dot { fill: var(--bni-red); stroke: var(--paper); }
.milestone.is-done .milestone-num { fill: #fff; }
.milestone.is-here .milestone-dot { fill: var(--paper); stroke: var(--bni-red); stroke-width: 4; r: 19; }
.milestone.is-here .milestone-label { fill: var(--bni-red); font-size: 15px; }
.milestone:hover .milestone-dot,
.milestone:focus-visible .milestone-dot { stroke: var(--bni-red); }
.milestone:focus-visible .milestone-label { text-decoration: underline; }

.car { pointer-events: none; }
.pin { fill: var(--bni-red); stroke: #fff; stroke-width: 3; }
.pin-shadow { fill: rgba(0, 0, 0, .3); }
.car-body { transform-origin: 0 0; }
.car.is-moving .car-body { animation: bob .32s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-4px) rotate(-3deg); } }

/* ---------- Stage: arrows + card ---------- */
.stage {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 20px;
  padding: 28px 28px 20px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.map { grid-row: 2; }
.stage { grid-row: 3; }

.nav-arrow {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 0;
  background: var(--bni-red);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -8px rgba(207, 32, 48, .6);
  transition: transform .2s var(--ease), background .2s, opacity .2s;
}
.nav-arrow svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.nav-arrow:hover:not(:disabled) { background: var(--bni-red-deep); transform: scale(1.07); }
.nav-arrow:active:not(:disabled) { transform: scale(.95); }
.nav-arrow:disabled { opacity: .25; cursor: default; box-shadow: none; }

.card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  min-height: 420px;
  overflow: hidden;
}
.card::after {
  /* the red swoosh from the deck's slide corner */
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 220px;
  height: 140px;
  background: var(--bni-red);
  border-radius: 100% 0 0 0;
  transform: rotate(-12deg);
  opacity: .9;
  pointer-events: none;
}

.card.is-leaving { opacity: 0; transform: translateX(var(--leave, -24px)); transition: opacity .16s, transform .16s; }
.card[data-dir="back"].is-leaving { --leave: 24px; }
.card.is-entering { animation: enter .45s var(--ease) both; }
.card[data-dir="back"].is-entering { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(32px); } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-32px); } }

.card-layout { position: relative; z-index: 1; display: grid; gap: 36px; align-items: center; }
.card-layout.has-diagram,
.card-layout.is-hero:has(.hero-figure) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }

.card-text { display: grid; gap: 14px; max-width: 62ch; color: var(--ink-2); font-size: 17px; }

.kicker {
  font: italic 800 13px/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--bni-red);
}
.card-title { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.card-subtitle { font: italic 800 clamp(22px, 2.6vw, 32px)/1.2 var(--font-display); color: var(--ink); }

.is-hero .card-title { font-style: italic; font-weight: 900; }
.card:has(.is-hero) { background: var(--paper) url("../img/road-bg.jpg") center / cover no-repeat; }
.card:has(.is-hero)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--paper) 35%, color-mix(in srgb, var(--paper) 55%, transparent));
}
.card:has(.is-hero) .card-title { color: var(--bni-red); }

.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.bullets li {
  position: relative;
  padding: 10px 14px 10px 40px;
  background: var(--bni-red-soft);
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink);
  animation: pop .45s var(--ease) both;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--bni-red);
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.prompt {
  padding: 14px 18px;
  border-left: 4px solid var(--bni-red);
  background: var(--canvas);
  border-radius: 0 10px 10px 0;
  font-weight: 600;
  color: var(--ink);
}

.questions ol { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: q; display: grid; gap: 8px; }
.questions li {
  counter-increment: q;
  display: none;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 600;
}
.questions li::before { content: counter(q); font: italic 900 20px var(--font-display); color: var(--bni-red); }
.questions li.is-shown { display: flex; animation: pop .4s var(--ease) both; }

.loop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.loop-step {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bni-red);
  color: #fff;
  font: italic 800 15px var(--font-display);
  animation: pop .4s var(--ease) both;
}
.loop-arrow { font-size: 22px; color: var(--ink-3); }
.loop-back { color: var(--bni-red); font-weight: 700; }

.hero-figure { margin: 0; display: grid; gap: 22px; justify-items: start; }
.hero-logo img { width: min(300px, 70%); height: auto; }
.hero-tagline img { width: min(340px, 85%); height: auto; }

.hero-facts { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-facts li { padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }

.signoff { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--line); }
.signoff-logo img { height: 52px; width: auto; }
.signoff-tagline img { height: 46px; width: auto; }

.my-commit { padding: 14px 18px; border-radius: 12px; background: var(--win-soft); color: var(--ink); border: 1px solid var(--win); }
.my-commit p { margin-top: 4px; }

/* ---------- Commit form ---------- */
.commit { display: grid; gap: 14px; }
.commit fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.commit legend { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.choice {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.choice input { accent-color: var(--bni-red); width: 18px; height: 18px; }
.choice:has(input:checked) { border-color: var(--bni-red); background: var(--bni-red-soft); }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field textarea, .field input {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}
.field textarea:focus, .field input:focus { border-color: var(--bni-red); outline: none; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.commit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.commit-status { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.commit-status.is-ok { color: var(--win); }
.commit-status.is-error { color: var(--bni-red); }

.btn { border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; cursor: pointer; transition: background .2s, transform .2s; }
.btn-primary { background: var(--bni-red); color: #fff; }
.btn-primary:hover { background: var(--bni-red-deep); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--bni-red); border: 2px solid var(--bni-red); }
.btn-ghost:hover { background: var(--bni-red-soft); }

/* ---------- Diagram ---------- */
.card-figure { margin: 0; }
.diagram { width: 100%; height: auto; overflow: visible; }
.diagram ellipse { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.5; }
.node { animation: pop .45s var(--ease) both; transform-box: fill-box; transform-origin: center; }
.node-label { text-anchor: middle; dominant-baseline: middle; font: 800 15px var(--font-display); fill: var(--ink); }
.node-struck { text-anchor: middle; dominant-baseline: middle; font: 600 11px var(--font-display); fill: var(--ink-3); }
.strike { stroke: var(--bni-red); stroke-width: 1.6; }
.node-dark ellipse { fill: var(--ink); stroke: var(--ink); }
.node-dark .node-label { fill: var(--paper); }
.node-hot ellipse { fill: var(--bni-red); stroke: var(--bni-red); animation: throb 1.1s ease-in-out infinite; }
.node-hot .node-label { fill: #fff; }
.node-muted ellipse { fill: var(--ink-3); stroke: var(--ink-3); }
.node-muted .node-label { fill: var(--paper); }
.node-win ellipse { stroke: var(--win); stroke-width: 2.5; fill: var(--win-soft); }
.node-win .node-label { fill: var(--win); }
@keyframes throb { 50% { filter: drop-shadow(0 0 10px var(--bni-red)); } }

.edge { stroke-width: 2; stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw .6s var(--ease) forwards; }
.edge-hot { stroke: var(--bni-red); }
.edge-muted { stroke: var(--ink-3); }
.edge-win { stroke: var(--win); stroke-width: 2.5; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.arrowhead-hot { fill: var(--bni-red); }
.arrowhead-muted { fill: var(--ink-3); }
.arrowhead-win { fill: var(--win); }
.arrowhead-ink { fill: var(--ink); }
.cycle-token { fill: var(--win); }

.note { text-anchor: middle; font: 800 15px var(--font-display); animation: pop .4s var(--ease) both; }
.note-hot { fill: var(--bni-red); }
.note-muted { fill: var(--ink-3); font-weight: 600; }

/* ---------- Footer: official logo + tagline on a BNI red band ---------- */
.footer {
  grid-row: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  padding: 18px 28px;
  background: #CF2030;
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
}
.footer-brand { display: flex; align-items: center; gap: 20px; }
.footer-logo { height: 30px; width: auto; }
.footer-tagline { height: 16px; width: auto; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: flex-end; }
.footer kbd { color: var(--ink); }
kbd { font: 600 12px var(--font-body); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--canvas); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .card-layout.has-diagram,
  .card-layout.is-hero:has(.hero-figure) { grid-template-columns: 1fr; }
  .card-figure { order: -1; max-width: 520px; width: 100%; justify-self: center; }
  .topbar-title { display: none; }
  .topbar { grid-template-columns: auto 1fr; }
}

@media (max-width: 680px) {
  .topbar { padding: 10px 16px; gap: 12px; }
  .brand-sub { display: none; }
  .progress { min-width: 0; }
  .progress-track { width: 140px; }
  .map-viewport { height: 180px; }
  .stage { grid-template-columns: 1fr 1fr; padding: 16px; gap: 14px; }
  .card { grid-column: 1 / -1; grid-row: 1; padding: 26px 20px 60px; min-height: 0; }
  .nav-prev { grid-row: 2; justify-self: start; }
  .nav-next { grid-row: 2; justify-self: end; }
  .nav-arrow { width: 58px; height: 58px; }
  .card-text { font-size: 16px; }
  .hero-logo img { width: 150px; }
  .hero-tagline img { width: 230px; }
  .signoff-logo img { height: 40px; }
  .signoff-tagline img { height: 36px; }
  .footer { padding: 16px; }
  .footer-brand { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-tagline { height: auto; width: 100%; max-width: 300px; }
  .footer-meta { justify-content: flex-start; }
  .hint { display: none; }
}
