:root {
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Cormorant", serif;
  color: #000;
  line-height: 1.5;
  box-sizing: border-box;
  font-size: 1.125rem;
}

h1 {
  margin-top: 0;
}

main {
  display: flex;
  flex-direction: column;
}

details:nth-of-type(1) summary {
  background-color: #e57373;
}
details:nth-of-type(2) summary {
  background-color: #f4a261;
}
details:nth-of-type(3) summary {
  background-color: #f4d35e;
}
details:nth-of-type(4) summary {
  background-color: #90be6d;
}
details:nth-of-type(5) summary {
  background-color: #43aa8b;
}
details:nth-of-type(6) summary {
  background-color: #4d8fd1;
}
details:nth-of-type(7) summary {
  background-color: #7971ea;
}
details:nth-of-type(8) summary {
  background-color: #9d5c9d;
}
details:nth-of-type(9) summary {
  background-color: #da627d;
}
details:nth-of-type(10) summary {
  background-color: #e6a57e;
}
details:nth-of-type(11) summary {
  background-color: #69c9ca;
}

details {
  width: 100%;
  border-bottom: 3px solid #000;
  overflow: hidden;
  transition-behavior: allow-discrete;

  summary {
    list-style: none;
    padding: 1rem;
    font-size: 2rem;
    width: 33.3%;
    transition: margin-left 0.5s;
    color: #fff;
    position: relative;
    z-index: 1;

    &:hover {
      cursor: pointer;
      margin-left: 2rem;
    }
  }

  > div {
    padding: 1rem 1rem 1rem calc(33.3% + 6rem);
    transform: translateY(100%);
    transition: transform 1s, background-color 1s;
  }
}

details[open] > div {
  transform: translateY(-5rem);

  @starting-style {
    transform: translateY(100%);
  }
}

details[open] summary {
  margin-left: 2rem;
}

details {
  summary:after {
    content: "";
    position: absolute;
    display: block;
    background-color: inherit;
    height: 300vh;
    width: 100%;
    left: 0;
    top: 100%;
  }
}

details::details-content {
  block-size: 0;
  transition: block-size 0.5s, content-visibility 0.5s;
  transition-behavior: allow-discrete;
}

details[open]::details-content {
  block-size: auto;
}
