/* =====================================================================
   courses.css — Roadmap pages (Courses hub + Arduino track detail pages)
   Restyled to the main HexaPi site (Poppins / Cairo, site theme vars).
   Every class is namespaced `rm-` and scoped under `.rm-page` so nothing
   here collides with the shared navbar/footer styles in styles.css.
   ===================================================================== */

.rm-page {
  /* palette mapped onto the main site theme */
  --rm-navy: var(--primary-color); /* #3c65a7 */
  --rm-navy-deep: #2a4a82;
  --rm-ink: var(--dark-bg); /* #1e3a5f */
  --rm-teal: #00979d; /* Arduino accent  */
  --rm-signal: #f0a020; /* amber signal    */
  --rm-paper: #f5f8fc;
  --rm-card: #ffffff;
  --rm-line: #d8e0ee;
  --rm-gray: #5b6b85;
  --rm-grid: #e7eefa;

  /* fluid vertical rhythm — generous on desktop, tighter on phones */
  --rm-gap: clamp(2.75rem, 5vw, 4rem); /* ~44px → 64px */
  --rm-gap-tight: clamp(2rem, 3.5vw, 3rem); /* ~32px → 48px */

  background: var(--rm-paper);
  color: var(--rm-ink);
  line-height: 1.6;
  padding-bottom: var(--rm-gap);
}

/* page background behind the roadmap (light, not the dark site hero) */
body.rm-body {
  background: var(--rm-paper);
}

/* highlight the active "Courses" link in the shared navbar */
.nav-courses-link {
  color: var(--accent-light) !important;
  font-weight: 600;
}

.rm-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

.rm-page h1,
.rm-page h2,
.rm-page h3,
.rm-page h4 {
  color: var(--rm-ink);
  line-height: 1.15;
}

/* Top padding drives the rhythm; bottom spacing comes from the next
   section's top. Major sections get the full gap; `.rm-tight` pulls
   closely-related sub-sections (figures, follow-on blocks) in closer. */
.rm-section {
  padding: var(--rm-gap) 0 0;
}
.rm-section.rm-tight {
  padding-top: var(--rm-gap-tight);
}

.rm-sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.rm-sec-no {
  font-size: 13px;
  color: var(--rm-teal);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.rm-sec-head h2 {
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.01em;
}
.rm-sec-head .rm-rule {
  flex: 1;
  height: 1px;
  background: var(--rm-line);
}

/* ---------- hero ---------- */
.rm-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, var(--rm-paper) 100%);
  border-bottom: 1px solid var(--rm-line);
}
.rm-hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--rm-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--rm-grid) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 60% 15%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 85% 75% at 60% 15%, #000, transparent 75%);
  opacity: 0.7;
}
.rm-hero .rm-wrap {
  position: relative;
  padding: 124px 28px 52px; /* top clears the fixed navbar (~82px) */
}
.rm-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rm-navy);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rm-eyebrow::before {
  content: '';
  width: 26px;
  height: 2px;
  background: var(--rm-navy);
}
.rm-page h1 {
  font-weight: 800;
  font-size: 52px;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.rm-page h1 .rm-accent {
  color: var(--rm-navy);
}
.rm-lede {
  font-size: 18px;
  color: var(--rm-gray);
  max-width: 64ch;
  margin-top: 20px;
}
.rm-age-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  margin-inline-end: 8px;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--rm-line);
  padding: 8px 14px;
  border-radius: 99px;
  color: var(--rm-ink);
}
.rm-age-pill b {
  color: var(--rm-teal);
}

/* ---------- progression rail (hub) ---------- */
.rm-prog {
  display: flex;
  margin-top: 40px;
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 16px;
  padding: 24px 22px;
  position: relative;
  overflow: hidden;
}
.rm-prog .rm-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 0 10px;
}
.rm-prog .rm-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  z-index: 2;
}
.rm-prog .rm-s1 .rm-dot {
  background: var(--rm-navy);
}
.rm-prog .rm-s2 .rm-dot {
  background: var(--rm-teal);
}
.rm-prog .rm-s3 .rm-dot {
  background: var(--rm-signal);
}
.rm-prog .rm-step h4 {
  font-weight: 600;
  font-size: 15px;
  margin-top: 11px;
}
.rm-prog .rm-step p {
  font-size: 11px;
  color: var(--rm-gray);
  margin-top: 4px;
}
.rm-prog .rm-conn {
  position: absolute;
  top: 43px;
  left: 16.7%;
  right: 16.7%;
  height: 2px;
  background: linear-gradient(90deg, var(--rm-navy), var(--rm-teal), var(--rm-signal));
  z-index: 1;
}

/* ---------- path cards (hub) ---------- */
.rm-paths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.rm-path {
  display: flex;
  flex-direction: column;
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  border-radius: 18px;
  overflow: hidden;
  transition: 0.16s;
  text-decoration: none;
  color: inherit;
}
.rm-path:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(22, 35, 63, 0.5);
  border-color: var(--rm-navy);
}
.rm-path .rm-top {
  padding: 5px;
  width: 100%;
}
.rm-p1 .rm-top {
  background: var(--rm-navy);
}
.rm-p2 .rm-top {
  background: var(--rm-teal);
}
.rm-p3 .rm-top {
  background: var(--rm-signal);
}
.rm-path .rm-body {
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.rm-path .rm-lvl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rm-gray);
}
.rm-path h3 {
  font-weight: 700;
  font-size: 23px;
  margin: 7px 0 3px;
}
.rm-path .rm-plat {
  font-size: 12px;
  color: var(--rm-navy);
  margin-bottom: 13px;
}
.rm-p3 .rm-plat {
  color: #0a6b6f;
}
.rm-path .rm-desc {
  font-size: 14px;
  color: var(--rm-gray);
  min-height: 62px;
}
.rm-path .rm-facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  padding: 15px 0;
  border-top: 1px solid var(--rm-line);
  border-bottom: 1px solid var(--rm-line);
}
.rm-path .rm-fr {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  gap: 12px;
}
.rm-path .rm-fr span {
  font-size: 11px;
  color: var(--rm-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rm-path .rm-fr b {
  font-weight: 600;
  color: var(--rm-ink);
}
.rm-path .rm-cred {
  font-size: 12.5px;
  color: var(--rm-gray);
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.rm-path .rm-star {
  color: var(--rm-signal);
}
.rm-path .rm-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  color: #fff;
  transition: 0.15s;
}
.rm-p1 .rm-cta {
  background: var(--rm-navy);
}
.rm-p2 .rm-cta {
  background: var(--rm-teal);
}
.rm-p3 .rm-cta {
  background: var(--rm-ink);
}
.rm-path:hover .rm-cta {
  filter: brightness(1.08);
}
.rm-path .rm-arr {
  transition: 0.15s;
}
.rm-path:hover .rm-arr {
  transform: translateX(3px);
}

/* ---------- track cards (courses listing) ---------- */
.rm-tracks {
  display: grid;
  gap: 18px;
}
.rm-tcard {
  --tc-bar: var(--rm-navy);
  --tc-ink: var(--rm-navy);

  position: relative;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: 0.18s;
}
.rm-tcard::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--tc-bar);
}
a.rm-tcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px -24px rgba(22, 35, 63, 0.5);
  border-color: var(--tc-ink);
}
.rm-tc-main {
  padding: 28px 30px;
}
.rm-tc-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tc-ink);
}
.rm-tc-badge.rm-soon {
  color: var(--rm-gray);
}
.rm-tcard h3 {
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -0.01em;
  margin: 11px 0 4px;
}
.rm-tc-plat {
  font-size: 13px;
  font-weight: 600;
  color: var(--tc-ink);
}
.rm-tc-desc {
  font-size: 14.5px;
  color: var(--rm-gray);
  margin-top: 12px;
  max-width: 54ch;
}
.rm-tc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.rm-tc-tags span {
  font-size: 11.5px;
  background: var(--rm-paper);
  border: 1px solid var(--rm-line);
  color: var(--rm-navy-deep);
  padding: 5px 10px;
  border-radius: 7px;
}
.rm-tc-side {
  padding: 26px 28px;
  background: var(--rm-paper);
  border-inline-start: 1px solid var(--rm-line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.rm-tc-facts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rm-tc-facts .rm-fr {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.rm-tc-facts .rm-fr span {
  font-size: 11px;
  color: var(--rm-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rm-tc-facts .rm-fr b {
  font-weight: 600;
  color: var(--rm-ink);
}
.rm-tc-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  color: #fff;
  background: var(--tc-ink);
  transition: 0.15s;
}
a.rm-tcard:hover .rm-tc-cta {
  filter: brightness(1.08);
}
.rm-tc-cta .rm-arr {
  transition: 0.15s;
}
a.rm-tcard:hover .rm-tc-cta .rm-arr {
  transform: translateX(3px);
}
.rm-tc-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  color: var(--rm-gray);
  background: var(--rm-card);
  border: 1px dashed var(--rm-line);
}

/* per-track accents (bar = bright, ink = readable on white) */
.rm-tc-arduino::before {
  background: linear-gradient(180deg, var(--rm-navy), var(--rm-teal), var(--rm-signal));
}
.rm-tc-python {
  --tc-bar: var(--rm-teal);
  --tc-ink: #0a6b6f;
}
.rm-tc-block {
  --tc-bar: var(--rm-signal);
  --tc-ink: #9a6700;
}
.rm-tc-lego {
  --tc-bar: #d1495b;
  --tc-ink: #b0374a;
}

body[dir='rtl'] a.rm-tcard:hover .rm-tc-cta .rm-arr {
  transform: translateX(-3px);
}

/* ---------- comparison table (hub) ---------- */
.rm-cmp {
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 16px;
  overflow: hidden;
}
.rm-cmp table {
  width: 100%;
  border-collapse: collapse;
}
.rm-cmp th,
.rm-cmp td {
  padding: 14px 18px;
  text-align: start;
  font-size: 13.5px;
  border-bottom: 1px solid var(--rm-line);
}
.rm-cmp thead th {
  background: var(--rm-paper);
  font-weight: 600;
  color: var(--rm-ink);
  font-size: 14px;
}
.rm-cmp tbody th {
  font-size: 11px;
  font-weight: 600;
  color: var(--rm-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rm-cmp tbody td {
  color: var(--rm-ink);
}
.rm-cmp tbody tr:last-child th,
.rm-cmp tbody tr:last-child td {
  border-bottom: none;
}
.rm-col-j {
  color: var(--rm-navy);
  font-weight: 600;
}
.rm-col-p {
  color: var(--rm-teal);
  font-weight: 600;
}
.rm-col-i {
  color: #9a6700;
  font-weight: 600;
}

/* ---------- info note ---------- */
.rm-info {
  background: #fff;
  border: 1px solid var(--rm-line);
  border-inline-start: 4px solid var(--rm-signal);
  border-radius: 12px;
  padding: 18px 22px;
  margin-top: 22px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.rm-info .rm-i {
  color: var(--rm-signal);
  font-size: 17px;
}
.rm-info p {
  font-size: 13.5px;
  color: var(--rm-gray);
}
.rm-note {
  font-size: 11px;
  color: var(--rm-gray);
  text-align: center;
  padding: 18px 28px 40px;
  line-height: 1.7;
}

/* ---------- hero stats (detail) ---------- */
.rm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 38px;
}
.rm-stat {
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 14px;
  padding: 18px 16px;
  position: relative;
}
.rm-stat::before {
  content: '';
  position: absolute;
  inset-inline-start: 16px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rm-teal);
  box-shadow: 0 0 0 3px rgba(0, 151, 157, 0.15);
}
.rm-stat .rm-num {
  font-weight: 800;
  font-size: 30px;
  color: var(--rm-ink);
  margin-top: 14px;
  line-height: 1;
}
.rm-stat .rm-lab {
  font-size: 11px;
  color: var(--rm-gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 7px;
}
.rm-stat .rm-ft {
  display: inline-block;
  margin-top: 9px;
  font-size: 10px;
  font-weight: 600;
  color: #7a4d00;
  background: rgba(240, 160, 32, 0.16);
  border: 1px solid rgba(240, 160, 32, 0.45);
  padding: 3px 7px;
  border-radius: 5px;
  line-height: 1.3;
}

/* ---------- step-up banner (detail) ---------- */
.rm-stepup {
  background: #fff;
  border: 1px solid var(--rm-line);
  border-inline-start: 4px solid var(--rm-signal);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 34px;
}
.rm-stepup.rm-teal-edge {
  border-inline-start-color: var(--rm-teal);
}
.rm-stepup .rm-tier {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--rm-gray);
}
.rm-stepup .rm-t {
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--rm-line);
  background: var(--rm-paper);
}
.rm-stepup .rm-t.rm-on {
  background: var(--rm-navy);
  color: #fff;
  border-color: var(--rm-navy);
}
.rm-stepup .rm-arrow {
  color: var(--rm-signal);
  font-weight: 700;
}
.rm-stepup.rm-teal-edge .rm-arrow {
  color: var(--rm-teal);
}
.rm-stepup p {
  font-size: 14px;
  color: var(--rm-gray);
  margin-inline-start: auto;
  max-width: 42ch;
}
.rm-badge-pro {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #7a4d00;
  background: rgba(240, 160, 32, 0.18);
  border: 1px solid rgba(240, 160, 32, 0.5);
  padding: 3px 9px;
  border-radius: 6px;
}
.rm-badge-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #0a6b6f;
  background: rgba(0, 151, 157, 0.12);
  border: 1px solid rgba(0, 151, 157, 0.45);
  padding: 3px 9px;
  border-radius: 6px;
}

/* ---------- vision cards ---------- */
.rm-vcards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.rm-vcard {
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  border-radius: 16px;
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
}
.rm-vcard .rm-ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  font-size: 20px;
}
.rm-vcard h3 {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 8px;
}
.rm-vcard p {
  font-size: 14.5px;
  color: var(--rm-gray);
}
.rm-vcard .rm-tab {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 4px;
}
.rm-v1 .rm-tab {
  background: var(--rm-navy);
}
.rm-v1 .rm-ico {
  background: rgba(60, 101, 167, 0.12);
  color: var(--rm-navy);
}
.rm-v2 .rm-tab {
  background: var(--rm-teal);
}
.rm-v2 .rm-ico {
  background: rgba(0, 151, 157, 0.12);
  color: var(--rm-teal);
}
.rm-v3 .rm-tab {
  background: var(--rm-signal);
}
.rm-v3 .rm-ico {
  background: rgba(240, 160, 32, 0.14);
  color: var(--rm-signal);
}

/* ---------- skill pillars ---------- */
.rm-skills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.rm-skills.rm-six {
  grid-template-columns: repeat(6, 1fr);
}
.rm-skill {
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 13px;
  padding: 18px 12px;
  text-align: center;
}
.rm-skill .rm-dot {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(60, 101, 167, 0.1);
  color: var(--rm-navy);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  font-weight: 600;
}
.rm-skill h4 {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.2;
}
.rm-skill p {
  font-size: 11.5px;
  color: var(--rm-gray);
  margin-top: 5px;
}

/* ---------- timeline ---------- */
.rm-timeline {
  position: relative;
  margin-top: 8px;
}
.rm-timeline::before {
  content: '';
  position: absolute;
  inset-inline-start: 21px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--rm-navy), var(--rm-teal));
}
.rm-node {
  position: relative;
  padding-block: 0 24px;
  padding-inline-start: 64px;
}
.rm-node:last-child {
  padding-bottom: 0;
}
.rm-node .rm-pad {
  position: absolute;
  inset-inline-start: 10px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--rm-navy);
  display: grid;
  place-items: center;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: var(--rm-navy);
}
.rm-node .rm-pad::after {
  content: '';
  position: absolute;
  inset-inline-start: -7px;
  width: 7px;
  height: 2px;
  background: var(--rm-navy);
}
.rm-node.rm-proj .rm-pad,
.rm-node.rm-cap .rm-pad {
  border-color: var(--rm-teal);
  color: var(--rm-teal);
}
.rm-node.rm-proj .rm-pad::after,
.rm-node.rm-cap .rm-pad::after {
  background: var(--rm-teal);
}
.rm-lcard {
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  border-radius: 14px;
  padding: 16px 20px;
  transition: 0.15s;
}
.rm-lcard:hover {
  border-color: var(--rm-navy);
  box-shadow: 0 6px 22px -12px rgba(60, 101, 167, 0.4);
}
.rm-lhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.rm-lhead h3 {
  font-weight: 600;
  font-size: 16.5px;
}
.rm-lhead .rm-meta {
  font-size: 11px;
  color: var(--rm-gray);
  white-space: nowrap;
  display: flex;
  gap: 12px;
}
.rm-lhead .rm-meta b {
  color: var(--rm-teal);
  font-weight: 600;
}
.rm-lcard p {
  font-size: 13.5px;
  color: var(--rm-gray);
  margin-top: 7px;
}
.rm-lcard code {
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  background: var(--rm-paper);
  padding: 1px 5px;
  border-radius: 4px;
}
.rm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}
.rm-chip {
  font-size: 10.5px;
  background: var(--rm-paper);
  border: 1px solid var(--rm-line);
  color: var(--rm-navy-deep);
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: 0.01em;
}
.rm-node.rm-proj .rm-lcard,
.rm-node.rm-cap .rm-lcard {
  background: linear-gradient(180deg, #fff, #f3fbfb);
  border-color: rgba(0, 151, 157, 0.4);
}
.rm-node.rm-proj .rm-chip,
.rm-node.rm-cap .rm-chip {
  color: var(--rm-teal);
  border-color: rgba(0, 151, 157, 0.3);
}
.rm-stage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rm-gray);
  margin-block: 0 14px;
  margin-inline-start: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.rm-stage-label::before {
  content: '';
  width: 9px;
  height: 9px;
  border: 2px solid var(--rm-signal);
  border-radius: 2px;
}

/* ---------- certificate block ---------- */
.rm-cert {
  background: linear-gradient(135deg, var(--rm-ink), var(--rm-navy-deep));
  border-radius: 20px;
  padding: 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.rm-cert-grid-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}
.rm-cert-inner {
  position: relative;
}
.rm-cert-inner.rm-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 36px;
  align-items: center;
}
.rm-cert .rm-seal {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rm-signal);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}
.rm-cert .rm-seal::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rm-signal);
  box-shadow: 0 0 0 4px rgba(240, 160, 32, 0.25);
}
.rm-cert h2 {
  color: #fff;
  font-weight: 800;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.rm-cert p {
  color: #c2cfe6;
  font-size: 15px;
  margin-top: 14px;
  max-width: 44ch;
}
.rm-cert .rm-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}
.rm-cert .rm-topics span {
  font-size: 11px;
  color: #dbe6f7;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 9px;
  border-radius: 6px;
}
.rm-exam {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 22px;
}
.rm-exam .rm-erow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}
.rm-exam .rm-erow:last-child {
  border-bottom: none;
}
.rm-exam .rm-erow span {
  color: #aebfdb;
  font-size: 12px;
}
.rm-exam .rm-erow b {
  font-weight: 600;
}

/* ---------- Enroll / WhatsApp CTA ---------- */
.rm-enroll {
  background: linear-gradient(135deg, var(--rm-ink), var(--rm-navy-deep));
  border-radius: 20px;
  padding: 44px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.rm-enroll-inner {
  position: relative;
  max-width: 56ch;
  margin: 0 auto;
}
.rm-enroll h2 {
  color: #fff;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.rm-enroll p {
  color: #c2cfe6;
  font-size: 15px;
  margin: 14px auto 0;
}
.rm-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 28px;
  background: #25d366;
  color: #04331a;
  font-weight: 700;
  font-size: 16px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.32);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.rm-wa-btn i {
  font-size: 21px;
}
.rm-wa-btn:hover {
  background: #1ebe5b;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.42);
}

@media (max-width: 600px) {
  .rm-enroll {
    padding: 34px 22px;
  }
  .rm-enroll h2 {
    font-size: 23px;
  }
}

/* ---------- IoT earn grid ---------- */
.rm-earn {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.rm-earn .rm-e {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 20px;
}
.rm-earn .rm-et {
  font-size: 11px;
  font-weight: 600;
  color: var(--rm-signal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rm-earn .rm-e h4 {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  margin: 9px 0 7px;
}
.rm-earn .rm-e p {
  font-size: 13px;
  color: #c2cfe6;
  line-height: 1.5;
}
.rm-honest {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 22px;
  background: rgba(240, 160, 32, 0.1);
  border: 1px solid rgba(240, 160, 32, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
}
.rm-honest .rm-i {
  color: var(--rm-signal);
  font-size: 16px;
  line-height: 1.3;
}
.rm-honest p {
  font-size: 12.5px;
  color: #dbe6f7;
  line-height: 1.55;
}

/* ---------- term flow ---------- */
.rm-term {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.rm-phase {
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 14px;
  padding: 20px 18px;
}
.rm-phase .rm-ph-no {
  font-size: 11px;
  font-weight: 600;
  color: var(--rm-teal);
  letter-spacing: 0.08em;
}
.rm-phase h4 {
  font-weight: 600;
  font-size: 16px;
  margin: 8px 0 4px;
}
.rm-phase .rm-wk {
  font-size: 12px;
  color: var(--rm-navy);
  font-weight: 500;
}
.rm-phase p {
  font-size: 13px;
  color: var(--rm-gray);
  margin-top: 8px;
}
.rm-phase .rm-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--rm-paper);
  margin-top: 14px;
  overflow: hidden;
}
.rm-phase .rm-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rm-navy), var(--rm-teal));
}

/* ---------- level filter ---------- */
/* inline filter that sits at the end of the section heading row */
.rm-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.rm-filter label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rm-gray);
}
.rm-select {
  font: inherit;
  font-size: 13.5px;
  color: var(--rm-ink);
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  min-width: 190px;
  transition: border-color 0.15s;
}
.rm-select:hover,
.rm-select:focus {
  border-color: var(--rm-navy);
  outline: none;
}
.rm-track[hidden],
#rmEmpty[hidden] {
  display: none !important;
}

/* ---------- framed figures (roadmap photos / reels) ---------- */
.rm-figure {
  margin: 0 auto;
  max-width: 760px;
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 36px -22px rgba(22, 35, 63, 0.5);
}
.rm-figure img,
.rm-figure video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--rm-paper);
}
.rm-figure.rm-portrait img,
.rm-figure.rm-portrait video {
  aspect-ratio: 9 / 16;
}
.rm-figure figcaption {
  padding: 13px 18px;
  font-size: 13px;
  color: var(--rm-gray);
  border-top: 1px solid var(--rm-line);
  display: flex;
  align-items: center;
  gap: 9px;
}
.rm-figure figcaption::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rm-teal);
  flex: none;
}

/* two framed figures side by side */
.rm-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
.rm-figures .rm-figure {
  max-width: none;
}
/* a pair of portrait photos: side by side on desktop, kept phone-sized */
.rm-figures.rm-pair {
  max-width: 620px;
  margin-inline: auto;
}

/* kit / product shot — shown whole (never cropped) on a light panel */
.rm-figure.rm-shot {
  max-width: 420px;
}
.rm-figure.rm-shot img {
  aspect-ratio: 400 / 484;
  object-fit: contain;
  padding: 20px 20px 8px;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #fff 30%, var(--rm-paper) 100%);
}

@media (max-width: 720px) {
  .rm-figures {
    grid-template-columns: 1fr;
  }
  /* stacked on mobile — constrain so a tall portrait never dominates */
  .rm-figures.rm-pair {
    max-width: 340px;
  }
}

/* ---------- back-to-track link ---------- */
.rm-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rm-navy);
}
.rm-back:hover {
  text-decoration: underline;
}

/* =====================================================================
   RTL — direction is toggled in-page, so mirror what the standalone
   Arabic templates did via separate files.
   ===================================================================== */
body[dir='rtl'] .rm-prog .rm-conn {
  background: linear-gradient(270deg, var(--rm-navy), var(--rm-teal), var(--rm-signal));
}
body[dir='rtl'] .rm-path:hover .rm-arr {
  transform: translateX(-3px);
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 880px) {
  .rm-page h1 {
    font-size: 40px;
  }
  .rm-paths {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }
  .rm-prog {
    flex-direction: column;
    gap: 22px;
  }
  .rm-prog .rm-conn {
    display: none;
  }
  .rm-path .rm-desc {
    min-height: 0;
  }
  .rm-cmp {
    overflow-x: auto;
  }
  .rm-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .rm-vcards {
    grid-template-columns: 1fr;
  }
  .rm-skills,
  .rm-skills.rm-six {
    grid-template-columns: repeat(3, 1fr);
  }
  .rm-cert-inner.rm-split {
    grid-template-columns: 1fr;
  }
  .rm-earn {
    grid-template-columns: 1fr;
  }
  .rm-term {
    grid-template-columns: 1fr 1fr;
  }
  .rm-stepup {
    flex-wrap: wrap;
  }
  .rm-stepup p {
    margin-inline-start: 0;
  }
  .rm-lhead .rm-meta {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* keep stats and term phases as a compact 2×2 instead of a tall stack */
  .rm-stats,
  .rm-term {
    grid-template-columns: repeat(2, 1fr);
  }
  .rm-skills,
  .rm-skills.rm-six {
    grid-template-columns: repeat(2, 1fr);
  }
  .rm-hero .rm-wrap {
    padding-top: 108px;
  }
}

/* =====================================================================
   Print / Save-as-PDF (browser Ctrl+P) — keep the roadmap clean on paper.
   ===================================================================== */
@media print {
  .navbar,
  .footer,
  .page-footer {
    display: none !important;
  }
  body.rm-body {
    background: #fff;
  }
  .rm-hero .rm-wrap {
    padding-top: 28px;
  }
  .rm-hero-grid,
  .rm-cert-grid-bg {
    opacity: 0.4;
  }
  .rm-section {
    padding: 22px 0;
  }
  .rm-stat,
  .rm-vcard,
  .rm-lcard,
  .rm-skill,
  .rm-phase,
  .rm-exam,
  .rm-stepup,
  .rm-earn .rm-e {
    box-shadow: none;
  }
  .rm-lcard:hover {
    box-shadow: none;
    border-color: var(--rm-line);
  }
  .rm-node,
  .rm-vcard,
  .rm-lcard,
  .rm-phase,
  .rm-stat,
  .rm-skill,
  .rm-cert,
  .rm-stepup,
  .rm-path,
  .rm-cmp,
  .rm-prog {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .rm-sec-head,
  .rm-stage-label {
    break-after: avoid;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* =====================================================================
   Practice exams (arduino-junior detail page)
   ===================================================================== */
.rm-practice-lede {
  font-size: 15px;
  color: var(--rm-gray);
  max-width: 760px;
  margin: -8px 0 24px;
}
.rm-practice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.rm-pcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--rm-card);
  border: 1px solid var(--rm-line);
  border-radius: 16px;
  padding: 26px 24px 22px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--rm-ink);
  transition: 0.15s;
}
.rm-pcard::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 4px;
  background: var(--rm-teal);
}
.rm-pcard:nth-child(2)::before {
  background: var(--rm-signal);
}
.rm-pcard:nth-child(3)::before {
  background: var(--rm-navy);
}
.rm-pcard:nth-child(4)::before {
  background: var(--rm-ink);
}
.rm-pcard:hover {
  border-color: var(--rm-navy);
  box-shadow: 0 10px 26px rgba(42, 74, 130, 0.12);
  transform: translateY(-2px);
}
.rm-ptag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rm-teal);
}
.rm-pcard:nth-child(2) .rm-ptag {
  color: var(--rm-signal);
}
.rm-pcard:nth-child(3) .rm-ptag {
  color: var(--rm-navy);
}
.rm-pcard:nth-child(4) .rm-ptag {
  color: var(--rm-ink);
}
.rm-pcard h3 {
  font-weight: 700;
  font-size: 19px;
}
.rm-pcard p {
  font-size: 14.5px;
  color: var(--rm-gray);
}
.rm-pcard .rm-pcta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rm-navy);
}
.rm-pcard .rm-arr {
  transition: 0.15s;
}
.rm-pcard:hover .rm-arr {
  translate: 3px 0;
}
body[dir='rtl'] .rm-pcard:hover .rm-arr {
  translate: -3px 0;
}
.rm-practice-note {
  font-size: 13px;
  color: var(--rm-gray);
  margin-top: 14px;
}

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