.experience-list {
  --experience-duration: 280ms;
  display: flow-root;
  position: relative;
  isolation: isolate;
  width: 80%;
  max-width: 80%;
  margin: 32px auto 40px;
  padding: 0;
}

.experience-list .experience-card {
  position: relative;
  z-index: var(--experience-layer);
  box-sizing: border-box;
  container-type: inline-size;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--second-background-color, #f4f2ed);
  color: var(--default-text-color, #373d3f);
  box-shadow: 0 -3px 12px rgb(0 0 0 / 9%), 0 8px 24px rgb(0 0 0 / 7%);
  transition: margin-bottom var(--experience-duration) ease;
}

.experience-card:not(:last-child) {
  margin-bottom: min(0px, calc(var(--experience-peek, 0px) - var(--experience-height, 0px)));
}

/* Opening an earlier card pushes the later cards below its description. */
.experience-card[data-expanded="true"]:not(:last-child) {
  margin-bottom: 8px;
}

.experience-card .experience-card__media {
  position: relative;
  width: 50%;
  height: auto;
  overflow: hidden;
  border: 0;
  background: var(--third-background-color, #e8e5dc);
}

.experience-card__media .image-caption {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

.experience-card__media figcaption {
  display: none;
}

.experience-card .experience-card__image {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  /* Redefine adds an !important margin while its lazy image is loading. */
  margin: 0 !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  transition: none;
  cursor: inherit;
}

.experience-card__placeholder {
  display: flex;
  width: 100%;
  height: auto;
  aspect-ratio: 85.6 / 53.98;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--third-text-color, #756f65);
  font-size: clamp(18px, 3vw, 44px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.experience-card .experience-card__body {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 50%;
  height: 100%;
  padding: clamp(3px, 1.42cqw, 8px);
  pointer-events: none;
}

.experience-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, clamp(20px, 11.35cqw, 64px));
  flex: 0 0 auto;
  gap: clamp(2px, 0.71cqw, 4px);
}

.experience-card__identity {
  min-width: 0;
}

.experience-card .experience-card__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--first-text-color, #24221e);
  font-size: clamp(9px, 2.6cqw, 17px);
  font-weight: 600;
  line-height: 1.15;
}

.experience-card__at {
  color: var(--third-text-color, #777);
  font-weight: 400;
}

.experience-card .experience-card__title a {
  color: inherit;
  text-decoration: none;
}

.experience-card .experience-card__advisors {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--third-text-color, #756f65);
  font-size: clamp(6px, 1.77cqw, 10px);
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.experience-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: var(--third-text-color, #756f65);
  font-size: clamp(5px, 1.6cqw, 9px);
  line-height: 1.2;
  text-align: right;
  overflow-wrap: anywhere;
}

.experience-card .experience-card__description {
  position: relative;
  z-index: 2;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  margin: 4px 0 0;
  color: var(--default-text-color, #514e48);
  font-size: clamp(7px, 2.13cqw, 12px);
  line-height: 1.35;
  white-space: pre-line;
  scrollbar-width: thin;
  pointer-events: auto;
}

.experience-card__body a {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.experience-card .experience-card__toggle {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  box-shadow: none;
  cursor: pointer;
}

.experience-card:has(.experience-card__toggle:focus-visible) {
  outline: 2px solid var(--primary-color, #a31f34);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .experience-list {
    --experience-duration: 0ms;
  }
}
