/* ============================================================
   DUAL-COLUMN TIMELINE — legacy row-based layout
   (education left, work right, used for mobile fallback)
   ============================================================ */
.timeline-dual {
  position: relative;
  padding: 20px 0;
}
.timeline-dual::before {
  content: "";
  position: absolute;
  left: 28%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent), var(--secondary), var(--primary));
}
.tl-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 32px;
  position: relative;
}
.tl-edu-col {
  width: 26%;
  flex-shrink: 0;
  padding-right: 24px;
  text-align: right;
}
.tl-dot-col {
  width: 4%;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 18px;
  z-index: 2;
}
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-dark);
  box-shadow: 0 0 12px var(--primary-glow);
  flex-shrink: 0;
}
.tl-dot.edu-dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.tl-dot.current-dot {
  width: 18px;
  height: 18px;
  background: var(--secondary);
  box-shadow:
    0 0 16px var(--secondary-glow),
    0 0 30px var(--secondary-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 16px var(--secondary-glow);
  }
  50% {
    box-shadow:
      0 0 24px var(--secondary-glow),
      0 0 40px var(--secondary-glow);
  }
}
.tl-work-col {
  flex: 1;
  padding-left: 24px;
}

/* Education mini cards (left side) */
.edu-mini {
  padding: 16px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.04);
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
}
.edu-mini:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.edu-mini .edu-dates {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.edu-mini .edu-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.3;
}
.edu-mini .edu-school {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
}
.edu-mini .edu-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Work cards (right side) */
.work-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
}
.work-card:hover {
  border-color: var(--primary);
  box-shadow:
    0 0 30px var(--primary-glow),
    0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateX(4px);
}
.work-card.current {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.04);
}
.work-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.work-badge.current-badge {
  background: rgba(0, 255, 136, 0.15);
  color: var(--secondary);
}
.work-badge.work-type {
  background: rgba(0, 212, 255, 0.12);
  color: var(--primary);
}
.work-dates {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

/* Company progression within a work card */
.company-progression {
  margin-bottom: 16px;
}
.company-entry {
  padding: 4px 0;
}
.company-entry.current-company .company-role {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}
.company-entry.current-company .company-name {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 600;
}
.company-entry.current-company .company-location {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Previous roles: compact single-line style */
.company-prev-roles {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.company-prev-roles .prev-role-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 1px 0;
}
.company-prev-roles .prev-arrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.7rem;
  opacity: 0.6;
  flex-shrink: 0;
}
.company-prev-roles .prev-title {
  color: var(--text-secondary);
  font-weight: 500;
}
.company-prev-roles .prev-at {
  color: var(--text-muted);
}
.work-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 16px;
  line-height: 1.7;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.work-achievements {
  list-style: none;
}
.work-achievements li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.work-achievements li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--secondary);
  font-family: var(--font-mono);
  font-weight: bold;
}
.work-achievements .metric {
  color: var(--secondary);
  font-weight: 600;
}

/* Early-career unified toggle — sticky floating pill at viewport bottom */
.early-toggle-btn {
  position: sticky;
  top: calc(100vh - 68px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  padding: 10px 22px;
  width: fit-content;
  background: rgba(10, 10, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px dashed rgba(124, 58, 237, 0.4);
  border-radius: 99px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  transition:
    border-color 0.3s,
    color 0.3s,
    background 0.3s,
    box-shadow 0.3s;
}
.early-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 212, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.15);
}
.early-toggle-btn .caret {
  display: inline-block;
  transition: transform 0.2s;
}
.early-toggle-btn[aria-expanded="true"] .caret {
  transform: rotate(90deg);
}
.early-toggle-btn .label {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.early-toggle-btn .label-detail {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  margin-left: 0;
  transition:
    max-width 0.35s ease,
    opacity 0.25s ease,
    margin-left 0.35s ease;
}
.early-toggle-btn:hover .label-detail,
.early-toggle-btn:focus-visible .label-detail {
  max-width: 220px;
  opacity: 1;
  margin-left: 6px;
}
.early-toggle-btn[aria-expanded="true"] .label-detail,
.early-toggle-btn[aria-expanded="true"] .label-suffix {
  display: none;
}

/* Early sections hidden by default; .show-early reveals all three */
.timeline-dual .early-edu {
  display: none;
}
.timeline-dual .early-cert {
  display: none;
}
.timeline-dual .early-roles {
  display: none;
}
.timeline-dual.show-early .early-edu {
  display: block;
}
.timeline-dual.show-early .early-cert {
  display: block;
}
.timeline-dual.show-early .early-roles {
  display: block;
}

/* Hide grouped wrapper (incl. its parent label) when all its child cards are
   early and early-timeline is hidden. Desktop JS already hides these via inline
   style; this rule is the mobile-side equivalent (mobile JS short-circuits). */
.timeline-dual:not(.show-early) .entry-wrapper.grouped.cert:not(:has(.cert-card:not(.early-cert))) {
  display: none;
}
.timeline-dual:not(.show-early) .entry-wrapper.grouped.edu:not(:has(.edu-card:not(.early-edu))) {
  display: none;
}

/* ============================================================
   LEGACY TIMELINE (for print & early career)
   ============================================================ */
.timeline {
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent), var(--secondary), var(--primary));
}
.tl-card {
  position: relative;
  margin-left: 56px;
  margin-bottom: 36px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
}
.tl-card:hover {
  border-color: var(--primary);
  box-shadow:
    0 0 30px var(--primary-glow),
    0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateX(4px);
}
.tl-card::before {
  content: "";
  position: absolute;
  left: -44px;
  top: 32px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-dark);
  box-shadow: 0 0 12px var(--primary-glow);
}
.tl-card.edu::before {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.tl-card.edu:hover {
  border-color: var(--accent);
  box-shadow:
    0 0 30px var(--accent-glow),
    0 8px 32px rgba(0, 0, 0, 0.3);
}
.tl-card.current {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.04);
}
.tl-card.current::before {
  width: 18px;
  height: 18px;
  left: -46px;
  top: 30px;
  background: var(--secondary);
  box-shadow:
    0 0 16px var(--secondary-glow),
    0 0 30px var(--secondary-glow);
  animation: pulse 2s ease-in-out infinite;
}
.tl-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tl-badge.work {
  background: rgba(0, 212, 255, 0.12);
  color: var(--primary);
}
.tl-badge.education {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent);
}
.tl-badge.current-badge {
  background: rgba(0, 255, 136, 0.15);
  color: var(--secondary);
}
.tl-dates {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.tl-role {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.tl-card.current .tl-role {
  font-size: 1.4rem;
  color: #fff;
}
.tl-company {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 600;
}
.tl-card.current .tl-company {
  font-size: 1.1rem;
  color: var(--primary);
}
.tl-location {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.tl-previous {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.tl-previous strong {
  color: var(--text-secondary);
  font-weight: 500;
}
.tl-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 16px;
  line-height: 1.7;
}
.tl-achievements {
  list-style: none;
}
.tl-achievements li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.tl-achievements li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--secondary);
  font-family: var(--font-mono);
  font-weight: bold;
}
.tl-achievements .metric {
  color: var(--secondary);
  font-weight: 600;
}
.tl-institution {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.tl-edu-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   FLAT TIMELINE — per-role card structure
   (replaces company-progression on both web & print)
   ============================================================ */

/* Card header: org left (flex-grow), dates right */
.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.tl-header .tl-company {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}
.tl-header .tl-dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Sub-header row: role | sep | location */
.tl-subheader {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.88rem;
  margin-top: 2px;
}
.tl-subheader .tl-role {
  font-weight: 600;
  color: var(--text-secondary);
}
.tl-company {
  color: var(--text-secondary);
  font-weight: 600;
}
.tl-location {
  color: var(--text-muted);
}
.sep {
  color: var(--border-subtle);
}

/* Inline company logo */
.tl-logo {
  height: 14px;
  width: auto;
  vertical-align: middle;
  margin-right: 3px;
}

/* Clients line (current role) */
.tl-clients {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.tl-clients .client {
  font-weight: 700;
  color: var(--text-secondary);
}

/* CURRENT badge */
.tl-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1pt;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-current {
  background: rgba(0, 255, 136, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

/* Plain bullet override (non-coding roles) */
.tl-achievements.plain li::before {
  content: "•";
  font-family: inherit;
  color: rgba(255, 255, 255, 0.4);
  font-weight: normal;
}

/* Tier: current */
.tier-current {
  background: rgba(0, 255, 136, 0.03);
  border-left: 3px solid var(--secondary);
  border-radius: 0 8px 8px 0;
  padding: 14px 14px 14px 16px;
  margin: 4px -14px 8px -16px;
}

/* Tier: early-highlight — Huawei red company name */
.tier-early-highlight .tl-company {
  color: #cf0a2c;
  font-weight: 700;
}

/* ── Same-org entry wrappers ────────────────────────────────────────────── */

/* Mobile default: solo wrappers are transparent; grouped wrappers have accent left border */
.entry-wrapper.grouped {
  border-left: 2px solid rgba(124, 58, 237, 0.2);
  padding-left: 12px;
  margin-left: -14px;
}
.entry-wrapper.grouped.cert {
  border-left-color: rgba(245, 158, 11, 0.3);
}
.entry-wrapper.grouped.work {
  border-left-color: rgba(0, 119, 182, 0.25);
}

/* Parent label — mobile: flows above child cards naturally */
.entry-parent {
  margin-bottom: 8px;
  padding: 4px 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.entry-parent-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.85;
}
.entry-parent.cert .entry-parent-name {
  color: var(--cert, #f59e0b);
}
.entry-parent.edu .entry-parent-name {
  color: var(--accent);
}
.entry-parent.work .entry-parent-name {
  color: var(--primary);
}

/* Connector bracket — hidden on mobile (group border handles it) */
.entry-connector {
  display: none;
}

/* In-group child cards: accent left border ties them to the connector */
.work-col .tl-card.in-group {
  border-left: 2px solid rgba(0, 119, 182, 0.35);
}
.edu-col .edu-card.in-group {
  border-left: 2px solid rgba(124, 58, 237, 0.35);
}
.edu-col .cert-card.in-group {
  border-left: 2px solid rgba(245, 158, 11, 0.4);
}

/* Location line — edu and cert screen cards */
.edu-location,
.cert-location {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
  opacity: 0.8;
}

/* Per-role achievements toggle */
details.tl-achievements-toggle {
  margin-top: 6px;
}
details.tl-achievements-toggle > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  user-select: none;
  padding: 2px 0;
}
details.tl-achievements-toggle > summary::-webkit-details-marker {
  display: none;
}
details.tl-achievements-toggle > summary::before {
  content: "▶";
  font-size: 0.62rem;
  display: inline-block;
  transition: transform 0.15s ease;
}
details.tl-achievements-toggle[open] > summary::before {
  transform: rotate(90deg);
}
details.tl-achievements-toggle[open] > summary {
  color: var(--text-muted);
}
.tier-early details.tl-achievements-toggle > summary,
.tier-early-highlight details.tl-achievements-toggle > summary {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.68rem;
}

/* ============================================================
   TWO-COLUMN TIMELINE — web / screen-only
   ============================================================ */

/* Date-proportional gap utility (6px = 1 month) */
.tl-gap {
  height: calc(var(--months, 0) * 6px);
}

/* Two-column flex container */
.timeline-dual {
  position: relative;
  display: flex;
  align-items: flex-start;
}

/* Central time-axis gradient line */
.timeline-dual::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(25% + 12px);
  width: 2px;
  background: linear-gradient(180deg, var(--secondary), var(--primary), var(--accent), var(--primary));
  opacity: 0.5;
}

/* Education column — left 25%, right-aligned, absolute-positioned cards */
.edu-col {
  width: 25%;
  flex-shrink: 0;
  position: relative;
  padding-right: 22px;
  min-height: 200px;
}

/* Work column — remaining width */
.work-col {
  flex: 1;
  padding-left: 22px;
  min-width: 0;
}

/* Education cards — absolutely positioned by --anchor-months */
.edu-card {
  position: absolute;
  top: calc(var(--anchor-months, 0) * 6px);
  left: 0;
  right: 0;
  text-align: right;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.edu-card:hover {
  border-color: var(--accent);
  box-shadow:
    0 0 18px var(--accent-glow),
    0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Dot on the central axis (right side of edu card) */
.edu-card::after {
  content: "";
  position: absolute;
  right: var(--dot-right, -40px);
  top: calc(var(--dot-center-y, 21px) - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-dark);
  box-shadow: 0 0 8px var(--accent-glow);
}
.edu-dates {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.edu-role {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.35;
}
.edu-institution {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}
.edu-detail {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Certification cards — narrower (inset 15% from left), amber accent */
.cert-card {
  position: absolute;
  left: 15%;
  right: 0;
  text-align: right;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  padding: 9px 12px;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.cert-card:hover {
  border-color: var(--cert);
  box-shadow:
    0 0 12px var(--cert-glow),
    0 3px 10px rgba(0, 0, 0, 0.22);
}
.cert-card::after {
  content: "";
  position: absolute;
  right: var(--dot-right, -40px);
  top: calc(var(--dot-center-y, 16px) - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cert);
  border: 2px solid var(--bg-dark);
  box-shadow: 0 0 6px var(--cert-glow);
}
.cert-dates {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.4px;
}
.cert-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
}
.cert-platform {
  font-size: 0.72rem;
  color: var(--cert);
  font-weight: 600;
  margin-bottom: 1px;
}
.cert-detail {
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.cert-link {
  font-size: 0.66rem;
  color: var(--cert);
  opacity: 0.75;
  word-break: break-all;
}

/* Work column card overrides */
.work-col .tl-card {
  margin-left: 14px;
  margin-bottom: 0;
}

/* Axis dot override (left side, pointing at central axis) */
.work-col .tl-card::before {
  left: var(--dot-left, -28px);
  top: calc(var(--dot-center-y, 33px) - 5px);
  width: 10px;
  height: 10px;
  border-width: 2px;
}
.work-col .tl-card.tier-current::before {
  background: var(--secondary);
  box-shadow: 0 0 14px var(--secondary-glow);
  width: 14px;
  height: 14px;
  left: var(--dot-left, -30px);
  top: calc(var(--dot-center-y, 24px) - 7px);
}

/* tier-current has negative margin bleed — reset inside work column */
.work-col .tl-card.tier-current {
  margin: 0 0 0 14px;
}

/* Grouped wrapper negative margin — reset inside work column */
.work-col .entry-wrapper.grouped {
  margin-left: 0;
}

/* Cards inside a grouped wrapper don't need extra margin-left */
.work-col .entry-wrapper.grouped > .tl-card {
  margin-left: 0;
}

/* Move current badge out of header flow so dates is always first content */
.work-col .tl-card.tier-current .tl-badge.badge-current {
  position: absolute;
  top: 12px;
  right: 14px;
  margin: 0;
}

/* Vertical header layout (web / work column only) — company on top */
.work-col .tl-card .tl-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 2px;
}
.work-col .tl-card .tl-header .tl-badge {
  margin-bottom: 2px;
}
.work-col .tl-card .tl-header .tl-dates {
  white-space: normal;
}
.work-col .tl-card .tl-header .tl-company {
  font-size: 1.1rem;
  color: var(--primary);
}
.work-col .tl-card.tier-current .tl-header .tl-company {
  font-size: 1.3rem;
  color: #fff;
}

/* Vertical subheader layout: role stacked above location, sep hidden */
.work-col .tl-card .tl-subheader {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-bottom: 8px;
  margin-top: 0;
}
.work-col .tl-card .tl-subheader .sep {
  display: none;
}
.work-col .tl-card .tl-subheader .tl-role {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.work-col .tl-card.tier-current .tl-subheader .tl-role {
  font-size: 1.05rem;
  color: var(--primary);
}
.tier-early-highlight .tl-header .tl-company {
  color: #cf0a2c;
  font-weight: 700;
}

/* Clients: vertical list (web only) */
.work-col .tl-card .tl-clients {
  list-style: none;
  padding: 0;
  margin: 4px 0 10px;
  font-size: 0.82rem;
}
.work-col .tl-card .tl-clients li {
  position: relative;
  padding: 2px 0 2px 14px;
  color: var(--text-muted);
}
.work-col .tl-card .tl-clients li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 3px;
  color: var(--secondary);
  font-size: 0.72rem;
}
.work-col .tl-card .tl-clients .client {
  font-weight: 700;
  color: var(--text-secondary);
}
.work-col .tl-card .tl-clients .client-dates {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Work column hover: suppress translateX (shift up instead) */
.work-col .tl-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 24px var(--primary-glow),
    0 6px 24px rgba(0, 0, 0, 0.3);
}

/* Desktop (≥ 769px): all timeline cards absolutely positioned by JS */
@media (min-width: 769px) {
  .work-col {
    position: relative;
  }
  .work-col .tl-card {
    position: absolute;
    left: 26px;
    right: 0;
    margin: 0;
  }
  .work-col .tl-card.tier-current {
    margin: 0;
    left: 26px;
  }
  /* Wrappers: absolutely positioned in their column; top set by JS */
  .entry-wrapper {
    position: absolute;
    left: 0;
    right: 0;
  }

  /* Parent label: absolutely positioned at top of wrapper */
  .entry-wrapper.grouped > .entry-parent {
    position: absolute;
    top: 0;
    height: 38px;
    margin: 0;
    padding: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
  }
  .edu-col .entry-wrapper.grouped.cert > .entry-parent {
    left: 15%;
    right: 0;
    justify-content: flex-end;
    text-align: right;
  }
  .edu-col .entry-wrapper.grouped.edu > .entry-parent {
    left: 0;
    right: 0;
    justify-content: flex-end;
    text-align: right;
  }
  .work-col .entry-wrapper.grouped.work > .entry-parent {
    left: 26px;
    right: 0;
  }

  /* Connector bracket: vertical accent line inside wrapper */
  .entry-connector {
    display: block;
    position: absolute;
    width: 2px;
    top: 38px;
    height: 0; /* set by JS: lastIntraBottom - labelPad */
    border-radius: 1px;
  }
  .edu-col .entry-connector.cert {
    left: calc(15% - 2px);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.6), rgba(245, 158, 11, 0.15));
  }
  .edu-col .entry-connector.edu {
    left: -2px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.55), rgba(124, 58, 237, 0.12));
  }
  .work-col .entry-connector.work {
    left: 22px;
    background: linear-gradient(180deg, rgba(0, 119, 182, 0.55), rgba(0, 119, 182, 0.12));
  }

  /* .tl-gap filler divs replaced by JS-computed spacing */
  .tl-gap {
    display: none;
  }
}

/* Mobile (≤ 768px): single mixed chronological stream */
@media (max-width: 768px) {
  .timeline-dual {
    flex-direction: column;
    align-items: stretch;
  }
  .timeline-dual::before {
    left: 14px;
  }

  /* Flatten columns and early-roles wrapper so entry-wrappers become
     direct flex children of .timeline-dual and can be ordered by date. */
  .work-col,
  .edu-col,
  .early-roles {
    display: contents;
  }

  /* Each wrapper sorts itself chronologically; smaller --order = more recent.
     Use descendant combinator: display:contents collapses .work-col/.edu-col
     boxes for layout (wrappers become flex children of .timeline-dual), but
     selectors still see the original DOM tree, so `>` would not match. */
  .timeline-dual .entry-wrapper {
    order: var(--order, 0);
    width: 100%;
    padding-left: 28px;
    box-sizing: border-box;
    margin-bottom: 8px;
  }
  /* Override grouped wrapper's desktop bleed (margin-left:-14px, padding-left:12px) */
  .timeline-dual .entry-wrapper.grouped {
    margin-left: 0;
    padding-left: 28px;
  }

  /* Early-roles children: restore display:contents when expanded */
  .timeline-dual.show-early .early-roles {
    display: contents;
  }

  /* Gap divs lose their positional meaning when entries are interleaved —
     card margin-bottom provides adequate spacing. */
  .tl-gap {
    display: none;
  }

  /* position: relative (not static) so ::after dot anchors to the card, not section */
  .edu-card {
    position: relative;
    top: auto;
    text-align: left;
    margin-bottom: 16px;
  }
  .edu-card::after {
    right: auto;
    left: -22px;
  }
  .cert-card {
    position: relative;
    left: auto;
    top: auto;
    text-align: left;
    margin-bottom: 12px;
  }
  .cert-card::after {
    right: auto;
    left: -22px;
  }
  .work-col .tl-card,
  .work-col .entry-wrapper.grouped > .tl-card {
    margin-left: 0;
  }
  .work-col .tl-card::before {
    left: -22px;
  }
  .work-col .tl-card.tier-current {
    margin: 0;
  }
  .work-col .tl-card.tier-current::before {
    left: -24px;
  }
}
