/* WORK EXPERIENCE */

#work {
  scroll-margin-top: 35px;
}

.work-section {
  background-color: var(--offwhite);
  padding: 3.5rem 2rem 4.5rem;
}

.work-container {
  max-width: 1040px;
  margin: 0 auto;
}

.work-bio {
  color: var(--terracotta);
  text-align: center;
  font-size: 0.95rem;
  margin: -1.75rem auto 2.5rem;
}

.timeline-wrapper {
  position: relative;
}

.timeline-year {
  width: fit-content;
  margin: 0 auto 1.75rem;
  padding: 0.35rem 1.2rem;
  background: var(--burgundy);
  color: var(--bg);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  position: relative;
  z-index: 2;
}

/* Center Vertical Spine */
.timeline-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--ochre);
  transform: translateX(-50%);
}

/* Alternating Left / Right Rows */
.timeline-item {
  position: relative;
  width: 50%;
  display: flex;
  align-items: flex-start;
}

.timeline-left {
  align-self: flex-start;
  margin-right: auto;
  padding-right: 2.15rem;
  justify-content: flex-end;
}

.timeline-right {
  align-self: flex-end;
  margin-left: auto;
  padding-left: 2.15rem;
  justify-content: flex-start;
}

.timeline-dot {
  position: absolute;
  top: 1.45rem;
  width: 10px;
  height: 10px;
  background: var(--burgundy);
  border: 2px solid var(--offwhite);
  box-shadow: 0 0 0 1.5px var(--ochre);
  border-radius: 50%;
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-left .timeline-dot {
  right: -5px;
}

.timeline-right .timeline-dot {
  left: -5px;
}

.timeline-item:hover .timeline-dot,
.timeline-item.is-open .timeline-dot {
  transform: scale(1.3);
  box-shadow: 0 0 0 1.5px var(--burgundy);
}

/* Compact Interactive Card */
.timeline-card {
  position: relative;
  width: 100%;
  background: var(--card-bg, #F4EFE6);
  border: 1px solid var(--ochre);
  border-radius: 0.85rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover,
.timeline-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--burgundy);
  outline: none;
}

.timeline-card[aria-expanded="true"] {
  border-color: var(--burgundy);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--espresso) 10%, transparent);
  user-select: text;
}

/* Pointer Arrow */
.timeline-card::after {
  content: "";
  position: absolute;
  top: 1.35rem;
  width: 10px;
  height: 10px;
  background: var(--card-bg, #F4EFE6);
  border-top: 1px solid var(--ochre);
  border-right: 1px solid var(--ochre);
  transition: border-color 0.2s ease;
}

.timeline-left .timeline-card::after {
  right: -6px;
  transform: rotate(45deg);
}

.timeline-right .timeline-card::after {
  left: -6px;
  transform: rotate(-135deg);
}

.timeline-card:hover::after,
.timeline-card[aria-expanded="true"]::after {
  border-color: var(--burgundy);
}

.timeline-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.timeline-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.timeline-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--ochre);
  padding: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.timeline-card:hover .timeline-logo,
.timeline-card[aria-expanded="true"] .timeline-logo {
  border-color: var(--burgundy);
}

.timeline-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


.timeline-title-group {
  min-width: 0;
}

.timeline-role {
  margin: 0 0 0.15rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--espresso);
  line-height: 1.25;
}

.timeline-company {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--terracotta);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.timeline-date {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--burgundy);
  background: var(--accent-light);
  border: 1px solid var(--burgundy);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.timeline-toggle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--ochre);
  background: var(--bg);
  color: var(--espresso);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

.timeline-card[aria-expanded="true"] .timeline-toggle {
  transform: rotate(45deg);
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--bg);
}

.timeline-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.timeline-card[aria-expanded="true"] .timeline-details {
  grid-template-rows: 1fr;
}

.timeline-details-inner {
  overflow: hidden;
}

.timeline-bullets {
  margin: 0.85rem 0 0.85rem;
  padding-top: 0.75rem;
  padding-left: 1.1rem;
  border-top: 1px solid var(--ochre);
  color: var(--espresso);
  font-size: 0.86rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline-bullets li::marker {
  color: var(--burgundy);
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.timeline-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--terracotta);
  background: var(--bg);
  border: 1px solid var(--ochre);
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
}
