/* Experience: start years beside a thin rail, darker through current roles. */
.experience {
  position: relative;
  z-index: 1;
  padding: 72px clamp(17px, 7vw, 64px) 84px;
  background: var(--surface);
}

/* The title: a different voice and a hand-drawn line under the last words */
.xp-road {
  position: relative;
  display: inline-block;
  color: var(--ink-fade);
  font-family: "Times New Roman", Times, serif;
  font-size: 1.22em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}
.xp-road svg {
  position: absolute;
  inset: auto -2% -.14em;
  width: 104%;
  height: .28em;
  overflow: visible;
  fill: none;
  stroke: var(--ink-fade);
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.xp-road path { stroke-dasharray: 1; vector-effect: non-scaling-stroke; }
.xp-road.is-waiting path { stroke-dashoffset: 1; }
.xp-road.is-drawing path { animation: xp-road-draw 1100ms 250ms cubic-bezier(.3, .7, .2, 1) both; }
@keyframes xp-road-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
[dir="rtl"] .xp-road { font-family: inherit; font-size: 1em; font-style: normal; font-weight: inherit; line-height: inherit; }
[dir="rtl"] .xp-road svg { transform: scaleX(-1); }

.xp-list { max-width: 620px; margin: 48px auto 0; }
.xp-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 4px 14px;
  padding-bottom: 32px;
}
.xp-row:last-child { padding-bottom: 0; }
.xp-row:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 36px;
  bottom: 0;
  inset-inline-start: 18.5px;
  width: 1px;
  background: var(--line);
}
.xp-row.is-current:not(:last-child)::before { background: #8f8d8a; }

.xp-year {
  grid-column: 2;
  width: fit-content;
  color: #9b9996;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.25;
}
.is-current .xp-year {
  background: linear-gradient(90deg, var(--ink) 30%, var(--ink-fade) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Placeholder mark: put an <img> inside .xp-logo to use a real logo */
.xp-logo {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.xp-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .92;
  filter: grayscale(1);
  transition: opacity 180ms ease, filter 180ms ease;
}

.xp-body { grid-column: 2; }
.xp-dates { display: flex; flex-wrap: wrap; gap: 0 8px; margin-bottom: 4px; }
.xp-date, .xp-duration { color: var(--ink-soft); font-size: .8125rem; line-height: 1.5; }
.is-current .xp-date { color: var(--ink); }
.xp-company { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.xp-company a { transition: color 160ms ease; }
.xp-role { display: block; margin-top: 1px; color: var(--ink-soft); font-size: .8125rem; line-height: 1.5; }
.xp-note { margin-top: 4px; color: var(--ink-soft); font-size: .875rem; line-height: 1.5; }

/* Two roles under one company */
.xp-steps { margin-top: 8px; }
.xp-step { position: relative; padding-inline-start: 18px; padding-bottom: 14px; }
.xp-step:last-child { padding-bottom: 0; }
.xp-step::before { content: ""; position: absolute; top: 6px; inset-inline-start: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.xp-step:last-child::before { background: var(--ink-fade); }
.xp-step:not(:last-child)::after { content: ""; position: absolute; top: 17px; bottom: -2px; inset-inline-start: 3px; width: 1px; background: var(--line); }
.xp-step:last-child .xp-date { color: var(--ink-soft); }
.xp-step .xp-role { margin-top: 0; color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .xp-company a:hover { color: var(--ink-fade); }
  .xp-row:hover .xp-logo img { opacity: 1; filter: none; }
}

.xp-row:focus-within .xp-logo img { opacity: 1; filter: none; }

@media (prefers-reduced-motion: reduce) {
  .xp-logo img { transition: none; }
}

@media (min-width: 900px) {
  .experience { padding: calc(var(--u) * 110) calc(var(--u) * 236) calc(var(--u) * 120); }
  .xp-list { max-width: calc(var(--u) * 720); margin-top: calc(var(--u) * 72); }
  .xp-row {
    grid-template-columns: calc(var(--u) * 110) calc(var(--u) * 40) minmax(0, 1fr);
    gap: calc(var(--u) * 22);
    padding-bottom: calc(var(--u) * 40);
  }
  .xp-row:not(:last-child)::before {
    top: calc(var(--u) * 40);
    inset-inline-start: calc(var(--u) * 152);
  }
  .xp-year { grid-column: 1; font-size: calc(var(--u) * 21); justify-self: end; }
  .xp-logo { grid-column: 2; grid-row: 1; width: calc(var(--u) * 40); height: calc(var(--u) * 40); font-size: calc(var(--u) * 12); }
  .xp-body { grid-column: 3; }
  .xp-dates { gap: 0 calc(var(--u) * 8); margin-bottom: calc(var(--u) * 4); }
  .xp-date, .xp-duration, .xp-role { font-size: calc(var(--u) * 13); }
  .xp-company { font-size: calc(var(--u) * 17); }
  .xp-role { margin-top: calc(var(--u) * 1); }
  .xp-note { margin-top: calc(var(--u) * 4); font-size: calc(var(--u) * 14); }
  .xp-steps { margin-top: calc(var(--u) * 8); }
  .xp-step { padding-inline-start: calc(var(--u) * 18); padding-bottom: calc(var(--u) * 16); }
  .xp-step:last-child { padding-bottom: 0; }
  .xp-step::before { top: calc(var(--u) * 6); width: calc(var(--u) * 7); height: calc(var(--u) * 7); }
  .xp-step:not(:last-child)::after { top: calc(var(--u) * 17); inset-inline-start: calc(var(--u) * 3); }
}
