/* Page-specific — route.html */

/* —— On-page TOC: shortcuts to Now / Recognition / Chapters —— */
.route-toc {
  margin-top: 2rem;
  max-width: var(--measure);
}
.route-toc-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(var(--ink) / 0.38);
}
.route-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgb(var(--ink) / 0.1);
}
.route-toc-list > li {
  border-bottom: 1px solid rgb(var(--ink) / 0.08);
}
a.route-toc-item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.65rem 0.85rem;
  padding: 0.85rem 0.15rem 0.85rem 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
a.route-toc-item:hover {
  background: rgb(var(--ink) / 0.03);
}
a.route-toc-item:hover .route-toc-key {
  color: rgb(var(--accent));
}
a.route-toc-item:hover .route-toc-jump {
  color: rgb(var(--accent) / 0.85);
  transform: translateY(1px);
}
a.route-toc-item:focus-visible {
  outline: 2px solid rgb(var(--accent) / 0.5);
  outline-offset: 2px;
}
.route-toc-num {
  font-size: 0.6875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: rgb(var(--ink) / 0.32);
  padding-top: 0.15rem;
}
.route-toc-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.45rem;
  min-width: 0;
}
.route-toc-key {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgb(var(--ink) / 0.9);
  transition: color 0.12s ease;
}
.route-toc-sep {
  font-size: 0.875rem;
  color: rgb(var(--ink) / 0.28);
}
.route-toc-val {
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgb(var(--ink) / 0.48);
}
.route-toc-jump {
  font-size: 0.75rem;
  color: rgb(var(--ink) / 0.28);
  transition: color 0.12s ease, transform 0.12s ease;
  padding-right: 0.15rem;
}
@media (prefers-reduced-motion: reduce) {
  a.route-toc-item:hover .route-toc-jump { transform: none; }
}

/* —— Path diagram: Now → Recognition → Chapters (long route) —— */
.path-diagram {
  max-width: var(--measure);
}
.path-leg {
  padding-bottom: 2.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgb(var(--ink) / 0.08);
}
.path-leg--chapters {
  border-bottom: 0;
  margin-bottom: 0;
}
.path-leg-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem 1.1rem;
  margin-bottom: 1.15rem;
}
.path-leg-num {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: rgb(var(--ink) / 0.32);
  padding-top: 0.35rem;
  line-height: 1;
}
.path-leg-titles {
  min-width: 0;
}
.path-leg-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(var(--accent) / 0.85);
}
.path-leg-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: rgb(var(--ink) / 0.92);
}
@media (min-width: 640px) {
  .path-leg-title { font-size: 1.5rem; }
}
.path-leg-meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgb(var(--ink) / 0.42);
}
.path-leg-brief {
  margin: -0.35rem 0 1.35rem;
  max-width: 28rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgb(var(--ink) / 0.5);
}

/* Continuous spine */
.path-spine {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.path-spine::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 1px;
  background: rgb(var(--ink) / 0.12);
}
.path-spine--past::before {
  background: rgb(var(--ink) / 0.09);
}
.path-node {
  position: relative;
  display: grid;
  grid-template-columns: 0.7rem minmax(0, 1fr);
  gap: 0 1.15rem;
  padding-bottom: 1.75rem;
}
.path-node--last,
.path-node--last-open {
  padding-bottom: 0.35rem;
}
.path-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: rgb(var(--accent));
  box-shadow: 0 0 0 3px rgb(var(--canvas));
}
.path-node--live .path-dot {
  background: rgb(var(--accent));
}
.path-dot--past {
  background: rgb(var(--ink) / 0.28);
}
.path-node-body { min-width: 0; }
.path-node-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}
.path-node-role {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: rgb(var(--ink) / 0.92);
}
.path-node-date {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--ink) / 0.38);
  white-space: nowrap;
  flex-shrink: 0;
}
.path-node-org {
  margin: 0.2rem 0 0;
  font-size: 0.9375rem;
  color: rgb(var(--accent));
  line-height: 1.35;
}
.path-node-copy {
  margin: 0.55rem 0 0;
  max-width: 28rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgb(var(--ink) / 0.62);
}

/* Recognition marks as a stop on the path — each tile links to the institution */
.path-marks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.path-mark-copy {
  min-width: 0;
}
.path-mark-org {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgb(var(--ink) / 0.92);
}
.path-mark-award {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgb(var(--ink) / 0.45);
}
a.path-mark:hover .path-mark-org {
  color: rgb(var(--accent));
}
a.path-mark:focus-visible {
  outline: 2px solid rgb(var(--accent) / 0.5);
  outline-offset: 2px;
}
@media (min-width: 640px) {
  .path-marks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}
@media (min-width: 900px) {
  .path-marks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.logo-frame--trophy {
  height: 3.5rem;
  align-items: center;
}
.logo-frame--trophy .logo-img {
  height: 3.35rem;
  max-width: 3.35rem;
  width: auto;
  object-fit: contain;
}
.path-leg--recognition .path-marks {
  position: relative;
  padding-left: 1.85rem;
}
.path-leg--recognition .path-marks::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgb(var(--ink) / 0.14),
    rgb(var(--ink) / 0.06)
  );
}
.path-leg--recognition .path-marks::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.22rem;
  border-radius: 999px;
  background: rgb(var(--ink) / 0.22);
  box-shadow: 0 0 0 3px rgb(var(--canvas));
}

.logo-tile {
      display: flex; flex-direction: column; align-items: flex-start; gap: 0.85rem;
      padding: 1.2rem 1.25rem;
      border: 1px solid rgb(var(--ink) / 0.1);
      border-radius: 0.75rem;
      background: rgb(var(--ink) / 0.02);
      transition: border-color 0.15s, background 0.15s;
      text-decoration: none; color: inherit; height: 100%;
    }
    .logo-tile:hover { border-color: rgb(var(--accent) / 0.45); background: rgb(var(--accent) / 0.04); }
    .logo-tile.row {
      flex-direction: row;
      align-items: center;
      gap: 1.15rem 1.5rem;
    }
    .logo-tile.row .logo-frame {
      width: auto;
      height: auto;
      flex-shrink: 0;
    }
    .logo-tile.row .logo-img {
      height: 2rem;
      max-width: 9.5rem;
    }
    /* CV entry list — scannable rows (education & certifications) */
    .cv-list {
      list-style: none;
      margin: 0;
      padding: 0;
      border-top: 1px solid rgb(var(--ink) / 0.1);
    }
    .cv-entry {
      display: grid;
      grid-template-columns: 6.5rem minmax(0, 1fr);
      gap: 1rem 1.25rem;
      align-items: start;
      padding: 1.15rem 0;
      border-bottom: 1px solid rgb(var(--ink) / 0.1);
      text-decoration: none;
      color: inherit;
      transition: background 0.15s;
    }
    a.cv-entry:hover { background: rgb(var(--ink) / 0.03); }
    a.cv-entry:hover .cv-entry-org { color: rgb(var(--accent)); }
    .cv-entry-logo {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      min-height: 2.25rem;
      padding-top: 0.15rem;
    }
    .cv-entry-logo img {
      display: block;
      height: 1.85rem;
      width: auto;
      max-width: 6.25rem;
      object-fit: contain;
      object-position: left center;
    }
    .cv-entry-head {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: space-between;
      gap: 0.25rem 1rem;
    }
    .cv-entry-org {
      font-size: 0.9375rem;
      font-weight: 500;
      letter-spacing: -0.01em;
      color: rgb(var(--ink) / 0.9);
      transition: color 0.15s;
      line-height: 1.35;
    }
    .cv-entry-date {
      font-size: 0.75rem;
      font-variant-numeric: tabular-nums;
      color: rgb(var(--ink) / 0.38);
      white-space: nowrap;
      flex-shrink: 0;
    }
    .cv-entry-title {
      margin-top: 0.3rem;
      font-size: 0.8125rem;
      line-height: 1.45;
      color: rgb(var(--ink) / 0.55);
    }
    .cv-entry-note {
      margin-top: 0.4rem;
      font-size: 0.75rem;
      line-height: 1.45;
      color: rgb(var(--ink) / 0.42);
    }
    .cv-entry-note-strong {
      margin-top: 0.35rem;
      font-size: 0.75rem;
      line-height: 1.45;
      color: rgb(var(--ink) / 0.58);
    }
    .cv-entry-note strong {
      font-weight: 500;
      color: rgb(var(--ink) / 0.7);
    }
    .cv-entry-stack {
      margin: 0.55rem 0 0;
      padding: 0;
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 0.55rem;
    }
    .cv-entry-stack li {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: space-between;
      gap: 0.25rem 0.75rem;
      padding-left: 0.65rem;
      border-left: 1.5px solid rgb(var(--ink) / 0.12);
    }
    .cv-entry-stack .cv-entry-title { margin-top: 0; }
    @media (max-width: 480px) {
      .cv-entry {
        grid-template-columns: 1fr;
        gap: 0.65rem;
      }
      .cv-entry-logo { min-height: 0; padding-top: 0; }
    }
    .logo-frame {
      display: flex; align-items: center; justify-content: flex-start;
      height: 2.75rem; width: 100%;
    }
    .logo-frame--webby {
      height: 3.1rem;
    }
    .logo-frame--webby .logo-img {
      height: 2.85rem;
      max-width: 10.5rem;
    }
    .logo-img {
      display: block; height: 2.35rem; width: auto; max-width: 9.5rem;
      object-fit: contain; object-position: left center;
    }
    .logo-frame.edu-logo { height: 3rem; }
    .logo-frame.edu-logo .logo-img { height: 2.5rem; max-width: 11rem; }
    /* UCM typographic logotype — wide wordmark */
    .logo-frame.edu-logo.ucm-mark {
      height: auto;
      min-height: 2.75rem;
      align-items: center;
      background: transparent;
      padding: 0;
    }
    .logo-frame.edu-logo.ucm-mark .logo-img {
      height: 2.35rem;
      width: auto;
      max-width: 11rem;
    }
    /* Black / monochrome marks: invert on dark canvas */
    .logo-img.ink { filter: none; }
    .dark .logo-img.ink { filter: invert(1) brightness(1.08); }
    /* Color marks that need a light plate in dark mode */
    .logo-img.color { filter: none; }
    .dark .logo-frame.plate {
      background: #f4f3ef;
      border-radius: 0.4rem;
      padding: 0.35rem 0.55rem;
      height: auto; min-height: 2.75rem;
      width: auto; max-width: 100%;
    }
    .dark .logo-frame.plate .logo-img { height: 1.85rem; }
    /* Dual theme swaps (logo tiles + cv list entries) */
    .logo-img.only-dark,
    .cv-entry-logo img.only-dark { display: none; }
    .dark .logo-img.only-light,
    .dark .cv-entry-logo img.only-light { display: none; }
    .dark .logo-img.only-dark,
    .dark .cv-entry-logo img.only-dark { display: block; }
    /* White marks on both themes — dark chip in light mode for contrast */
    .logo-frame.white-mark {
      background: #111113;
      border-radius: 0.4rem;
      padding: 0.4rem 0.55rem;
      height: auto;
      min-height: 2.75rem;
      width: auto;
    }
    .dark .logo-frame.white-mark {
      background: transparent;
      padding: 0;
      min-height: 2.75rem;
    }
