/* The drug discovery timeline. Everything is prefixed tl- so it cannot touch another page.
   A spine down the middle, cards alternating either side on a wide screen, one column on a phone.
   The spine fills in as you scroll, so the page itself shows how far through the story you are. */

.tl-hero { padding-bottom: 26px; }
.tl-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.tl-pills li { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; background: #eef4fb; color: #1b3763; border: 1px solid #dbe5f3; }
.tl-pills li svg { width: 15px; height: 15px; }

.tl-section { background: linear-gradient(180deg, #fbfcfe, #f6f8fc); }
.tl { position: relative; padding: 8px 0 10px; }
.tl-list { list-style: none; margin: 0; padding: 0; }

/* Each chapter of the story has its own colour, so where you are in three thousand years is visible
   before you read a word: warm earth for the ancient world, gold for the scholars who made it a
   method, indigo as chemistry takes over, crimson for the magic bullet, blue for designed drugs,
   violet for everything after the small molecule. */
.tl-era-ancient   { --era: #C2410C; --era-soft: #fdf1e7; --era-ink: #7c2d12; }
.tl-era-golden    { --era: #B45309; --era-soft: #fdf6e3; --era-ink: #78350f; }
.tl-era-chemistry { --era: #4338CA; --era-soft: #eef0fd; --era-ink: #312e81; }
.tl-era-bullet    { --era: #BE123C; --era-soft: #fdf0f3; --era-ink: #881337; }
.tl-era-rational  { --era: #1747CA; --era-soft: #eaf1fe; --era-ink: #0b1b3f; }
.tl-era-modern    { --era: #7C3AED; --era-soft: #f4efff; --era-ink: #4c1d95; }

/* the spine, and the part of it you have already read */
.tl-spine { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%);
  background: #dce7f5; border-radius: 3px; overflow: hidden; }
.tl-spine i { display: block; width: 100%; height: 0;
  background: linear-gradient(180deg, #C2410C, #B45309 18%, #4338CA 38%, #BE123C 56%, #1747CA 76%, #7C3AED); }

/* era headings sit across the spine and break the story into chapters */
.tl-era { position: relative; display: flex; justify-content: center; margin: 34px 0 18px; }
.tl-era-inner { max-width: 640px; text-align: center; background: #f6f8fc; padding: 10px 22px; }
.tl-era-inner::before { content: ""; display: block; width: 46px; height: 5px; border-radius: 3px;
  margin: 0 auto 10px; background: var(--era, #1747ca); }
.tl-era h2 { margin: 0 0 4px; font-size: clamp(1.15rem, 2.4vw, 1.5rem); letter-spacing: -.01em; color: var(--era-ink, #0b1b3f); }
.tl-era p { margin: 0; font-size: .92rem; line-height: 1.55; color: #56627a; }

/* one moment */
.tl-item { position: relative; width: 50%; padding: 0 38px 22px 0; }
.tl-item.tl-right { margin-left: 50%; padding: 0 0 22px 38px; }
.tl-dot { position: absolute; top: 26px; right: -8px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; border: 4px solid var(--era, #1747ca); box-shadow: 0 0 0 5px #f6f8fc; }
.tl-item.tl-right .tl-dot { right: auto; left: -7px; }

.tl-card { position: relative; background: #fff; border: 1px solid #dce7f5; border-radius: 20px;
  padding: 16px 18px 18px; box-shadow: 0 12px 30px rgba(11, 27, 63, .06); overflow: hidden; }
.tl-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--era, #1747ca); }
.tl-card-head { margin-bottom: 10px; }
.tl-when { margin: 0 0 2px; font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--era, #12776C); }
.tl-card-head { padding-top: 4px; }
.tl-card h3 { margin: 0 0 4px; font-size: 1.22rem; line-height: 1.25; letter-spacing: -.01em; color: #0b1b3f; }
.tl-who { display: flex; gap: 7px; align-items: flex-start; margin: 0; font-size: .85rem; color: #56627a; }
.tl-who svg { flex: none; width: 15px; height: 15px; margin-top: 3px; }

.tl-art { margin: 0 0 12px; padding: 0; border: 1px solid var(--era-soft, #e8eef8); border-radius: 14px;
  overflow: hidden; background: var(--era-soft, #f7fafc); }
.tl-art img { display: block; width: 100%; height: auto; }
.tl-art figcaption { padding: 2px 10px 6px; font-size: .7rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #9aa6b8; text-align: right; }
.tl-emblem { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 0 12px;
  border-radius: 16px; background: var(--era-soft, #eef4fb); color: var(--era, #1747ca); }
.tl-emblem svg { width: 26px; height: 26px; }

.tl-body { margin: 0 0 10px; font-size: .94rem; line-height: 1.62; color: #44505f; }
.tl-lesson { display: flex; gap: 9px; align-items: flex-start; margin: 0; padding: 10px 12px;
  border-left: 3px solid var(--era, #D98A16); border-radius: 0 10px 10px 0; background: var(--era-soft, #fffaf0);
  font-size: .9rem; line-height: 1.55; color: var(--era-ink, #0b1b3f); }
.tl-lesson svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--era, #D98A16); }

/* they rise into place as you reach them, and stay put if the reader asked for less motion */
[data-tl-item], [data-tl-era] { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
[data-tl-item].tl-in, [data-tl-era].tl-in { opacity: 1; transform: none; }

.tl-foot { display: flex; gap: 9px; align-items: flex-start; margin: 26px 0 0; padding: 12px 15px;
  border: 1px solid #dce7f5; border-radius: 14px; background: #fff; color: #56627a; font-size: .9rem; }
.tl-foot svg { flex: none; width: 17px; height: 17px; margin-top: 2px; color: #12776C; }

.tl-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.tl-next-card { display: flex; align-items: center; gap: 12px; padding: 15px 17px; background: #fff;
  border: 1px solid #dce7f5; border-radius: 18px; text-decoration: none; color: #0b1b3f;
  box-shadow: 0 10px 26px rgba(11, 27, 63, .05); transition: transform .16s ease, border-color .16s ease; }
.tl-next-card:hover { transform: translateY(-3px); border-color: #b9c6dc; }
.tl-next-card > svg:first-child { flex: none; width: 24px; height: 24px; color: #12776C; }
.tl-next-card > svg:last-child { flex: none; width: 18px; height: 18px; margin-left: auto; color: #7b8699; }
.tl-next-card span { display: grid; gap: 2px; font-size: .88rem; color: #56627a; line-height: 1.45; }
.tl-next-card strong { font-size: 1rem; color: #0b1b3f; }

@media (max-width: 860px) {
  .tl-spine { left: 13px; }
  .tl-item, .tl-item.tl-right { width: 100%; margin-left: 0; padding: 0 0 20px 38px; }
  .tl-dot, .tl-item.tl-right .tl-dot { left: 6px; right: auto; }
  .tl-era { justify-content: flex-start; }
  .tl-era-inner { text-align: left; padding: 10px 0 10px 38px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-tl-item], [data-tl-era] { opacity: 1; transform: none; transition: none; }
  .tl-next-card { transition: none; }
}

/* a real photograph, when one is in place */
.tl-photo { background: #0b1b3f; border-color: #0b1b3f; }
.tl-photo img { aspect-ratio: 3 / 2; object-fit: cover; }
.tl-photo figcaption { color: #9fb6d8; text-align: left; font-size: .66rem; font-weight: 600;
  letter-spacing: 0; text-transform: none; padding: 5px 10px 7px; }
