body {
    margin: 0;
    flex-direction: column;
    font-family: 'General Sans', Arial, sans-serif;
}

.publications {
    padding: 90px 150px 150px 150px; /* top clears nav; sides/bottom keep alignment */
}

.publications h2 {
    background-color: #000; /* Black background */
    color: #fff; /* White text */
    padding: 200px 0px 80px 0px; /* Padding inside the box */
    margin-top: -100px;
    margin-bottom: 60px;
    width: 100vw; /* Full viewport width */
    box-sizing: border-box;
    position: relative;
    left: 50%; 
    transform: translateX(-50%); /* Aligns the background to viewport */
    font-size: 26px;
    font-weight: 500;
    text-indent: 150px;
}

.publications h2::after {
    content: ""; /* No text, just a line */
    display: block;
    width: calc(100% - 300px); /* 150px inset from left and right */
    height: 0.5px;
    background-color: #fff;
    margin: 5px 0 0 150px; /* same left offset as h2 text-indent */
}

.papers {
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: slide-up 0.8s ease-out forwards;
  }
  
  .papers:nth-child(n + 2) {
    animation-delay: calc(0.2s + ((var(--n, 1) - 1) * 0.2s));
    --n: calc(var(--n, 1) + 1);
}

.papers h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.papers p {
    margin: 4px 0; /* Space between paragraphs */
    font-size: 14px;
    color: #676767;
}

.papers p:last-child {
    color: #1d1d1f;
    font-size: 12px;
    background: #f5f5f7;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.papers a {
    color: rgba(0, 57, 114, 1); 
    text-decoration: none;
}

.papers a:hover {
    text-decoration: underline;
}

@keyframes slide-up {
    0% {
      opacity: 0;
      transform: translateY(20px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

@media (max-width: 768px) {
    .publications {
        padding: 60px 20px 40px 20px;
    }

    .publications h2 {
        font-size: 20px;
        text-indent: 20px;
        padding: 24px 0 32px 0;
        margin-bottom: 40px;
    }

    .publications h2::after {
        margin-left: 20px;
        width: calc(100% - 40px); /* 20px inset from left and right */
    }

    .papers h3 {
        font-size: 16px;
    }

    .papers p {
        font-size: 13px;
    }

    .papers p:last-child {
        font-size: 11px;
    }
}