:root {
  --title-underline-start: #1f1faf; 
  --title-underline-end:   #1f1faf;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #faf7f0
  }
  
 header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.3)), url('../static/image/banner6.png') center/cover no-repeat;
    color: rgb(255, 255, 255);
    text-align: center;
    font-size: 1.6rem;
    padding: 180px 20px;
    text-shadow: 0 2px 14px rgba(0,0,0,0.75);
  } 

  header h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.75), 0 3px 12px rgba(0,0,0,0.6); 
  }

  header p {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.95), 0 3px 12px rgba(0,0,0,0.8); 
  }


  nav {
    position: absolute;
    top: 20px;
    right: 30px;
  }
  
  nav a {
    color: rgb(255, 255, 255);
    margin-left: 15px;
    text-decoration: none;
    font-weight: bold;
    padding: 6px 10px;                 
    border-radius: 6px;                 /* rounded pill on hover */
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
  }

  nav a:hover {
    background-color: rgba(255,255,255,0.16); /* subtle frosted pill */
    text-decoration: none;
  }
  nav a:active {
    transform: translateY(1px); /* tiny press feedback */
  }
  nav a:focus-visible {
    outline: 2px solid #fff;    /* keyboard accessibility */
    outline-offset: 2px;
    border-radius: 6px;
  }
  
  section {
    padding: 40px 20px;
    max-width: 1000px;
    margin: auto;
  }
  
  .intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
  }
  
  .intro img {
    max-width: 100%;
    width: 500px;
    border-radius: 5px;
  }
  
  .intro .text {
    flex: 1;
    border: 2px solid #0077cc;
    padding: 15px;
    height: 250px;
    display: flex;
    align-items: center;
    border: none;
    border-radius: 8px;
    /* box-shadow: 0 6px 16px rgba(0,0,0,0.25); */
    box-shadow: 0 0 16px rgba(0,0,0,0.45);
  }
  
  .announcements {
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 28px;
  }

  .announcements h2 {
    position: relative;
    display: inline-block;     /* lets the underline size to the text */
    margin: 0 0 16px;
    font-weight: 700;
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    letter-spacing: 0.01em;
  }

  .announcements h2::after {
    content: "";
    display: block;
    width: 260px;               /* shorten/lengthen the bar here */
    height: 4px;               /* make the bar thicker/thinner */
    margin: 10px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #0077cc, #00aaff);
    opacity: 0.95;
  }

  
  .cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    justify-content: space-between;
  }
  
  .card {
    max-width: 300px;
    padding: 10px;
    max-width: 300px;
    border: none;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    text-align: left;
    flex: 1;
    min-width: 250px;
    max-width: 320px;
  }
  
  .card img {
    width: 100%;
    height: auto;
    border-radius: 5px;
  }
  
  .card a {
    display: block;
    width: fit-content; 
    margin: 8px auto 0;                 /* centered */
    padding: 0;                          /* no box */
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--title-underline-start); /* uses your accent color */
    font-weight: 700;
    text-decoration: none;

    /* animated underline on hover */
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size .2s ease, transform .1s ease, opacity .15s ease;
  }

    .card a:hover {
    transform: translateY(-1px);         /* the jump */
    background-size: 100% 2px;           /* underline grows left→right */
    opacity: 0.98;
  }

  .card a::after {                        /* keep the arrow */
    content: "→";
    margin-left: 6px;
    transition: transform .15s ease;
  }
  .card a:hover::after {
    transform: translateX(2px);
  }

  /* if you have multiple links in a card, keep a bit of space */
  .card a + a { margin-top: 8px; }



  .workflow-img {
    display: block;
    margin: 20px auto;
    max-width: 600px; /* You can adjust this to your liking */
    width: 90%;
    height: auto;
    border-radius: 5px;
  }
  
  footer {
    background: #F0ECE6;
    text-align: center;
    padding: 40px 20px;
    font-size: 0.9em;
  }

  .apply-section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: auto;
  }
  
  .apply-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
  }
  
  .apply-upload-box {
    flex: 1;
    min-width: 250px;
    border: 2px dashed #ccc;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    position: relative;
  }
  
  .upload-placeholder {
    font-size: 40px;
    color: #888;
    margin-bottom: 10px;
  }
  
  .apply-description {
    flex: 2;
    min-width: 300px;
  }
  
  .apply-description h2 {
    margin-top: 0;
  }

  .publication-page {
    max-width: 900px;
    margin: auto;
    padding: 40px 20px;
  }

  .publication-page h2 {
    font-size: 2em;
    margin-bottom: 20px;
  }

  .publications-list {
    list-style: decimal;
    padding-left: 20px;
    font-size: 0.98em;
    line-height: 1.6;
  }

  .publications-list li {
    margin-bottom: 16px;
  }

  .publications-list a {
    color: #0044cc;
    text-decoration: underline;
    word-break: break-word;
  }

  #searchInput {
    width: 100%;
    max-width: 600px;
    padding: 10px;
    margin: 20px auto;
    display: block;
    font-size: 1rem;
    border: 2px solid #0077cc;
    border-radius: 5px;
  }

  .highlight {
    background-color: yellow;
    font-weight: bold;
  }
  
  /* Members grid layout */
  .members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
    align-items: stretch;
  }

  /* Member card */
  .member {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .member:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
  }

  .member h3 {
    margin: 10px 0 6px;
    font-size: 1.2rem;
  }
  .member p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
  }

  .member img {
    width: 100%;
    height: 300px;        /* uniform header image height */
    object-fit: cover;    /* clean crop */
    border-radius: 8px;
  }

  .group-photo-section  {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 20px;
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.203);
  }
  .group-photo-section .group-photo {
    display: block;
    width: 100%;
    max-width: 680px;
    margin: 10px auto 0;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  }
  .group-photo-section p {
    margin-top: 8px;
    color: #555;
    font-size: 0.95rem;
  }

  .group-photo-section h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2rem); /* bump size */
    line-height: 1.15;
    letter-spacing: 0.01em;
    display: inline-block;                 /* lets the underline size to the text */
  }

  /* Research cards */
  .drug-discovery,
  .enzyme-simulation {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    padding: 18px 18px 20px;
    margin: 20px auto;
    max-width: 1000px;
  }

  /* Tidy inner spacing */
  .drug-discovery ol,
  .enzyme-simulation ol {
    margin-top: 12px;
    padding-left: 1.2rem;
  }

/* Make the research image fill the card nicely (only on this page) */
  .drug-discovery .workflow-img,
  .enzyme-simulation .workflow-img {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    margin-top: 10px;
  }

  .announcements h2,
  .publication-page h2,
  .group-photo-section h2,
  .research-header h2,
  .alumni-section h2 {
    position: relative;
    display: inline-block;        /* underline sizes to text width */
    margin: 0 0 16px;
    font-weight: 700;
    font-size: clamp(2rem, 3vw, 2.4rem);
    letter-spacing: 0.01em;
  }

/* The underline bar */
  .announcements h2::after,
  .publication-page h2::after,
  .group-photo-section h2::after,
  .research-header h2::after,
  .alumni-section h2::after {
    content: "";
    display: block;
    width: 200px;                  /* change length here */
    height: 4px;                  /* change thickness here */
    margin: 10px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--title-underline-start), var(--title-underline-end));
    opacity: 0.95;
  }

  .research-header { 
   text-align: center; 
  }

  .publication-page > h2 {
    display: block;        /* override the global inline-block */
    text-align: center;    /* center the text itself */
    margin: 0 auto 20px;   /* keep underline centered + spacing */
  }

  /* Software page layout */
  .software-page {
    max-width: 900px;           /* narrower for focus */
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;         /* center the big title only */
  }

  /* Title with site-wide underline style */
  .software-page h1 {
    margin: 0 0 14px;
    font-size: clamp(0.5rem, 2vw, 1.8rem);
    display: inline-block;      /* so the underline sizes to the text */
    line-height: 1.15;
    letter-spacing: 0.01em;
  }
  .software-page h1::after {
    content: "";
    display: block;
    width: 200px;               /* tweak underline length here */
    height: 4px;
    margin: 10px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--title-underline-start), var(--title-underline-end));
  }

  /* Card that holds the content; text inside is left-aligned */
  .software-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    padding: 20px 22px;
    margin: 20px auto 0;
    text-align: left;
  }

  /* Tidy typography inside the card */
  .software-card h2 {
    margin: 8px 0 10px;
    font-size: 1.25rem;
  }
  .software-card p {
    margin: 0 0 12px;
    line-height: 1.6;
  }

  /* Make the download link look like a primary button */
  .software-card a {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #0077cc, #00aaff);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform .1s ease, box-shadow .15s ease;
  }
  .software-card a:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  }

  .software-page h1::after { 
    content: none;  /* kills the pseudo-element */
  }

  .apply-description { 
    text-align: center; 
  }

  /* Apply page button */
  .apply-actions { margin-top: 12px; }

  .apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--title-underline-start), var(--title-underline-end));
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    transition: transform .1s ease, box-shadow .15s ease;
  }
  .apply-btn::after {
    content: "→";
    transition: transform .15s ease;
  }
  .apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  }
  .apply-btn:hover::after {
    transform: translateX(2px);
  }
  .apply-btn:focus-visible {
    outline: 3px solid rgba(0,0,0,0.3);
    outline-offset: 2px;
    border-radius: 10px;
  }

  nav a.active {
    background-color: rgba(255,255,255,0.22);
    border-radius: 6px;
  }
  nav a.active:hover {
    background-color: rgba(255,255,255,0.28);
  }

  /* Smooth scrolling to the target */
  html { scroll-behavior: smooth; }

  /* Make the hit area look nice */
  .publication-item { 
    padding: 0.4rem 0.6rem; 
    border-radius: 8px;
    scroll-margin-top: 140px;
  }

  /* Auto-highlight when the URL has #that-id */
  .publication-item:target {
    background: rgba(255,243,189,.7);
    box-shadow: 0 0 0 3px rgba(255,235,59,.5);
    animation: hiPulseOnce 1.2s ease-out 1;
  }
  @keyframes hiPulseOnce {
    0% { background: rgba(255,243,189,1); }
    100% { background: rgba(255,243,189,.7); }
  }

  /* Optional: arrow link style on Research page */
  .jump-link {
    font-size: 1.15rem;       /* was default; make it ~15% bigger */
    text-decoration: none;
    font-weight: 700;
    opacity: .85;
    margin-left: .4rem;        /* if your arrow is after the text */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6em;              /* small round “chip” */
    height: 1.6em;
    border: 1px solid currentColor;
    border-radius: 999px;
    line-height: 1;
  }

  .jump-link:hover { opacity: 1; transform: translateY(-1px); }

  .alumni-section {
    text-align: center;   /* centers the inline-block h2 */
    padding-top: 24px;
  }

  header { position: relative; }                /* creates a stacking context */
  nav { z-index: 5; }                           /* lifts the nav above bg/pseudos */

  /* 2) If you have any header overlays, don't let them eat hover events */
  header::before,
  header::after { pointer-events: none; }

  /* 3) Make the hover pill more visible (yours was very subtle) */
  nav a { transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease; }
  nav a:hover { background-color: rgba(255,255,255,0.32); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
  nav a:focus, nav a:focus-visible { background-color: rgba(255,255,255,0.32); }


  @media (max-width: 768px) {
    .intro {
      flex-direction: column;
    }
  
    .cards {
      flex-direction: column;
      align-items: center;
    }

    .apply-container {
      flex-direction: column;
    }
  
    .apply-upload-box {
      width: 100%;
      height: auto;
    }
  }
  
