@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Poppins:ital,wght@0,200;0,300;0,400;1,200;1,300&display=swap');

:root {
  --color-section-1: #cfa9a9;
  --color-section-2: #a9c2cf;
  --color-section-3: #c2cfa9;
  --color-section-4: #cfcaa9;
  --color-bg: #1a1a1a;
  --color-line: rgba(255, 255, 255, 0.15);
  --color-muted: #4f4f4f;
  --color-dim: #8a8a8a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.experience-body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 50px;
  padding: 80px 20px 80px 20px;
  background-color: var(--color-bg);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
}

.experience-body h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.experience-container {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 60px;
  width: min(100%, 2100px);
}

/* ---------- Sidebar nav ---------- */

.map {
  position: sticky;
  top: 80px;
  align-self: flex-start;
  width: 220px;
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
}

.map > div {
  position: relative;
  padding: 22px 0 22px 20px;
  border-top: 1px solid var(--color-line);
  cursor: pointer;
  transition: padding 0.4s ease, opacity 0.4s ease;
  opacity: 0.55;
}

.map > div:last-child {
  border-bottom: 1px solid var(--color-line);
}

.map > div::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background-color: currentColor;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s ease;
}

.map .s-1 { color: var(--color-section-1); }
.map .s-2 { color: var(--color-section-2); }
.map .s-3 { color: var(--color-section-3); }
.map .s-4 { color: var(--color-section-4); }

.map > div:hover,
.map > div.active {
  opacity: 1;
  padding-left: 28px;
}

.map > div:hover::before,
.map > div.active::before {
  transform: scaleY(1);
}

.map > div p:nth-child(1) {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
}

.map > div p:nth-child(2) {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 300;
  color: var(--color-dim);
}


.sections {
  flex: 1;
  min-width: 0;
}

.sections > div {
  width: 100%;
  margin: 0 0 120px 0;
}

.sections > div:first-child .header {
  padding-top: 0;
}

.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 40px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-line);
}

.header-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header .company {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.header .role {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-dim);
}

.header .period {
  font-size: 13px;
  font-weight: 300;
  color: var(--color-dim);
  white-space: nowrap;
}

.copy {
  width: 100%;
  padding: 0;
}

.copy h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.4;
  color: var(--color-muted);
}

.copy h3:first-child {
  color: #fff;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tags span {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-dim);
}

.section-1 .header .company { color: var(--color-section-1); }
.section-2 .header .company { color: var(--color-section-2); }
.section-3 .header .company { color: var(--color-section-3); }
.section-4 .header .company { color: var(--color-section-4); }

.section-1 .tags span { border-color: var(--color-section-1); color: var(--color-section-1); }
.section-2 .tags span { border-color: var(--color-section-2); color: var(--color-section-2); }
.section-3 .tags span { border-color: var(--color-section-3); color: var(--color-section-3); }
.section-4 .tags span { border-color: var(--color-section-4); color: var(--color-section-4); }

.whitespace {
  width: 100%;
  height: 40px;
}

@media (max-width: 900px) {
  .experience-body {
    padding: 60px 16px 60px 16px;
    gap: 32px;
  }

  .experience-container {
    flex-direction: column;
    gap: 40px;
  }

  .map {
    position: relative;
    top: 0;
    width: 100%;
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .map > div {
    flex: 1 1 45%;
    border-top: 1px solid var(--color-line);
    /* The JS sets an inline height based on the matching section's
       desktop-flow height, which balloons once sections stack full-width
       on mobile. Force it back to natural sizing here. */
    height: auto !important;
  }

  .header .company {
    font-size: 18px;
  }

  .sections > div {
    margin-bottom: 80px;
  }
}

@media (max-width: 640px) {
  .experience-body h2 {
    font-size: 24px;
  }

  .map {
    flex-direction: column;
  }

  .map > div {
    flex: 1 1 auto;
    padding: 18px 0 18px 16px;
  }

  .map > div:hover,
  .map > div.active {
    padding-left: 22px;
  }

  .map > div p:nth-child(1) {
    font-size: 12px;
  }

  .map > div p:nth-child(2) {
    font-size: 11px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .header .company {
    font-size: 17px;
  }

  .header .period {
    white-space: normal;
  }

  .copy h3 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .sections > div {
    margin-bottom: 60px;
  }
}