/* journey.css — timeline, skills and credentials */

/* ---------------- Timeline ---------------- */
.tl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: var(--space-6);
  align-items: start;
}
.tl__heads {
  display: grid;
  margin-bottom: var(--space-3);
  font-size: var(--fs-footnote);
  font-weight: 600;
  color: var(--text-2);
}
.tl__head { display: inline-flex; align-items: center; gap: 6px; padding-left: 6px; }
.tl__head .icon { width: 15px; height: 15px; color: var(--accent); }
.tl__heads > .tl__head:first-child { justify-content: flex-end; padding-right: 10px; padding-left: 0; }

.tl__canvas { position: relative; }
.tl__spine {
  position: absolute; top: 0; bottom: 0;
  width: 2px; translate: -1px 0;
  border-radius: 2px;
  background: var(--line-strong);
  overflow: hidden;
}
.tl__spine-fill {
  position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: top center;
  transform: scaleY(0);
}
.tl__year {
  position: absolute;
  translate: -50% -50%;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}

.tl-entry {
  position: absolute;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 3px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-align: left;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
  color: var(--text);
}
.tl-entry[data-lane="study"] { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.tl-entry:hover { box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-md); }
@media (min-width: 1024px) { .tl-entry.is-selected { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-md); } }
.tl-entry > span { flex-shrink: 0; }
.tl-entry__dates { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-entry__title {
  font-size: var(--fs-footnote); font-weight: 650; line-height: 1.3; letter-spacing: -0.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tl-entry__org { font-size: var(--fs-caption); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-entry__extra {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-entry__extra .icon { width: 12px; height: 12px; flex: none; }
.tl-entry.no-extra .tl-entry__extra { display: none; }
.tl-entry.is-compact .tl-entry__org { display: none; }
.tl-entry.is-tiny .tl-entry__title { -webkit-line-clamp: 1; }
.tl-entry__now {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--positive) 22%, transparent);
}
.tl-entry:has(.tl-entry__now) .tl-entry__dates { padding-right: 14px; }

.tl__hint { display: none; margin-top: var(--space-3); font-size: var(--fs-caption); color: var(--text-3); text-align: center; }

/* Detail card that follows you down the timeline (wide screens) */
.tl-detail {
  position: sticky;
  top: calc(var(--bar-h) + var(--space-5));
  padding: var(--space-5) var(--space-5) var(--space-6);
}
.entry-detail { display: flex; flex-direction: column; gap: var(--space-2); }
.entry-detail__lane { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
.entry-detail__lane .icon { width: 15px; height: 15px; }
.entry-detail__now {
  margin-left: var(--space-2);
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 10px; letter-spacing: 0.08em;
  color: var(--positive);
  background: color-mix(in srgb, var(--positive) 14%, transparent);
}
.entry-detail__title { font-size: var(--fs-headline); font-weight: 700; letter-spacing: var(--track-headline); line-height: 1.2; }
.entry-detail__org { font-weight: 500; color: var(--text); }
.entry-detail__dates { font-size: var(--fs-footnote); color: var(--text-2); font-variant-numeric: tabular-nums; }
.entry-detail__dates span { color: var(--text-3); }
.entry-detail__focus { font-size: var(--fs-footnote); font-weight: 600; color: var(--text); }
.entry-detail__text { margin-top: var(--space-2); color: var(--text-2); line-height: 1.65; }

/* A project, paper or award attached to an entry */
.highlight {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.highlight__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-ink);
}
.highlight__label .icon { width: 14px; height: 14px; }
.highlight__title { font-size: var(--fs-callout); font-weight: 650; line-height: 1.35; letter-spacing: -0.005em; }
.highlight__text { font-size: var(--fs-footnote); color: var(--text-2); line-height: 1.6; }
.highlight__pub { font-size: var(--fs-footnote); color: var(--text); font-style: italic; line-height: 1.5; }
.highlight__link { align-self: flex-start; margin-top: var(--space-1); }
.sheet .entry-detail { padding: var(--space-6) clamp(var(--space-5), 4vw, var(--space-7)) var(--space-6); }
.sheet .entry-detail__lane, .sheet .entry-detail__title { padding-right: 48px; }   /* room for the close button */

@media (max-width: 1023px) {
  .tl-layout { grid-template-columns: 1fr; }
  .tl-detail { display: none; }
  .tl__hint { display: block; }
}
@media (max-width: 559px) {
  .tl-entry { padding: 9px 10px; border-radius: 12px; }
  .tl__heads > .tl__head:first-child { padding-right: 6px; }
}

/* ---------------- Skills ---------------- */
.skills { display: grid; }
.skill-group {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: var(--space-2) var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line);
}
.skill-group:last-child { border-bottom: 1px solid var(--line); }
.skill-group__name { font-size: var(--fs-footnote); font-weight: 600; color: var(--text-2); padding-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px; padding: 0 13px;
  border-radius: var(--r-pill);
  font-size: var(--fs-footnote); font-weight: 500;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.chip:hover { box-shadow: 0 0 0 1px var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); box-shadow: none; }
.evidence { grid-column: 2; overflow: hidden; height: 0; }
.evidence__inner { padding-top: var(--space-2); }
.evidence__list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-footnote); color: var(--text-2); }
.evidence__list li { display: inline-flex; align-items: baseline; gap: 6px; }
.evidence__kind { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.evidence__lead { font-size: var(--fs-footnote); color: var(--text); font-weight: 600; margin-bottom: 4px; }
@media (max-width: 719px) {
  .skill-group { grid-template-columns: 1fr; }
  .skill-group__name { padding-top: 0; }
  .evidence { grid-column: 1; }
}

/* ---------------- Credentials ---------------- */
.tier + .tier { margin-top: var(--space-6); }
.tier__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-3); }
.tier__title { font-size: var(--fs-caption); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); }
.tier__count { font-size: var(--fs-caption); color: var(--text-3); font-variant-numeric: tabular-nums; }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--space-3); }
@media (max-width: 479px) { .cred-grid { grid-template-columns: 1fr 1fr; } }
.cred { display: flex; flex-direction: column; overflow: hidden; color: var(--text); }
.cred__media {                  /* the frame sets the shape ... */
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
}
.cred__media img {              /* ... and the picture fills it, centred (same in every browser) */
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  padding: var(--space-4);
  object-fit: contain;
  transition: transform 500ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .cred:hover .cred__media img { transform: scale(1.05); } }
.cred__body { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4) var(--space-4); }
.cred__name { font-size: var(--fs-footnote); font-weight: 600; line-height: 1.35; }
.cred__issuer { font-size: var(--fs-caption); color: var(--text-2); }
.cred__more { margin-top: 4px; font-size: var(--fs-caption); font-weight: 600; color: var(--accent-ink); }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--positive); flex: none;
  animation: live-pulse 2s ease-out 4;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--positive) 50%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; }
}
@media (prefers-reduced-motion: reduce) { .live__dot { animation: none; } }

/* Certificate viewer (inside the sheet): picture beside the details on wide
   screens, stacked on phones */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr); }
.viewer__media {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  background: var(--surface-2);
}
.viewer__media img { display: block; max-width: 100%; max-height: min(40vh, 420px); width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.viewer__body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5) clamp(var(--space-5), 4vw, var(--space-7)) var(--space-6); }
.viewer__issuer { font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); padding-right: 48px; }
.viewer__title { font-size: var(--fs-headline); font-weight: 700; letter-spacing: var(--track-headline); line-height: 1.2; padding-right: 48px; margin-top: calc(-1 * var(--space-2)); }
.viewer__summary { font-size: var(--fs-callout); color: var(--text-2); line-height: 1.6; }
.viewer__label { margin-top: var(--space-1); font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.viewer__covers { display: grid; gap: 6px; margin-top: calc(-1 * var(--space-1)); }
.viewer__covers li { position: relative; padding-left: 16px; font-size: var(--fs-footnote); line-height: 1.5; color: var(--text); }
.viewer__covers li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.viewer__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: var(--space-2);
  margin-top: var(--space-1);
}
.viewer__facts div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.viewer__facts dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.viewer__facts dd { margin-top: 2px; font-size: var(--fs-footnote); font-weight: 600; color: var(--text); line-height: 1.4; font-variant-numeric: tabular-nums; }
.viewer__note { color: var(--text-2); font-size: var(--fs-footnote); }
.viewer__links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.viewer__source {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: var(--space-1);
  font-size: var(--fs-caption); font-weight: 500; color: var(--text-3);
}
.viewer__source .icon { width: 12px; height: 12px; }
.viewer__source:hover { color: var(--accent); }
@media (min-width: 820px) {
  .viewer { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); min-height: 420px; }
  .viewer__media img { max-height: min(60vh, 560px); }
  .viewer__body { padding-top: var(--space-6); }
}
