/* ==========================================================================
   Experience: job timeline, newest first
   ========================================================================== */

.experience {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4.5vw, 56px);
  padding: var(--section-y) var(--gutter);
}

.timeline {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--color-line);
}

/* The transition repeats the scroll-reveal timing (motion.css) and adds the
   hover background, because `transition` replaces rather than merges. */
.job {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 28px 0;
  border-top: 1px solid var(--color-line);
  transition: opacity 600ms var(--ease) var(--reveal-delay, 0ms), transform 700ms var(--ease) var(--reveal-delay, 0ms), background-color 200ms;
}

.job__dates {
  flex: 0 0 200px;
  padding-top: 8px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Highlight the dates of the current role */
.job--current .job__dates {
  color: var(--color-ink);
}

.job__org,
.job__role {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job__org  { flex: 1 1 240px; }
.job__role { flex: 2 1 360px; }

.job__company {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: var(--weight-display);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  transition: transform 200ms var(--ease);
}

.job__location {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.job__title {
  font-size: var(--text-base);
  font-weight: 400;
}

.job__summary {
  color: var(--color-muted);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html:not(.motion-off):not(.is-keyboard) .job:hover { background: var(--color-mist); }
  html:not(.motion-off):not(.is-keyboard) .job:hover .job__company { transform: translateX(6px); }
}

/* ---- Heading row: title on the left, availability card on the right ---- */
.experience__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 48px;
}

/* ---- Availability card ---- */
.availability {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 380px;
  padding: 22px 26px;
  border: 1.5px solid var(--color-ink);
  border-radius: var(--radius-box);
}

.availability__status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* A softly pulsing dot: "available now" */
.availability__dot {
  position: relative;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3f8f5a;
}

.availability__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: availability-pulse 2.4s ease-out infinite;
}

@keyframes availability-pulse {
  from { opacity: .6; transform: scale(1); }
  to   { opacity: 0;  transform: scale(3); }
}

.availability__text {
  margin: 0;
  font-size: var(--text-lead);
  font-weight: 400;
  line-height: 1.45;
}

.availability__text strong {
  font-weight: 500;
}

.availability__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.availability__link span {
  transition: transform 300ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .availability__link:hover span { transform: translate(3px, -3px); }
}

html.motion-off .availability__dot::after { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .availability__dot::after { animation: none; }
}
