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

    html {
      color-scheme: light dark;
      font-size: 16px; 
    }

    body {
      font-family: 'Georgia', serif;
      background-color: #f3f0e8;
      color: #2a2a2a;
      padding: 2rem;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    header {
      text-align: center;
      margin-bottom: 0rem;
      background: url('rosa_rats.png') center bottom no-repeat; 
      background-size: 65%;
      padding-bottom: 40px;
      margin-bottom: -15px;
    }

    header h1 {
      font-size: 2.5rem;
      margin-bottom: 0.5rem;
    }

    header h2 {
      font-family: 'Helvetica Neue', sans-serif;
      font-size: 1rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: #444;
      font-weight:200;
    }

    .container {
      max-width: 945px;

      overflow: visible !important; /* prevent tooltips from getting clipped */
      width: 100%;
      background-image: url('smaller_rat.webp');
      background-size: 20%;
      background-color: rgba(255,255,255,0.9);
      background-blend-mode: lighten;
      border-radius: 8px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      gap: 2rem;
      margin-bottom: 25px;
      padding-top: 35px;

      text-shadow: 1px 1px 0 #fff;
    }

    .nobg { 
      background: none !important;
      border: none !important;
      box-shadow: none !important;
    }

    #plague {
      padding: 0 10px;
    }

    #plague > div { flex: 1; }

    #plague-gif-wrapper {
      max-width: 750px;
      padding: 10px 10px 0 5px;
      overflow: hidden;
      margin: 0 auto;

    }
    #plague-gif-wrapper video {
      width: 100%;
      border-radius: 8px;
      border: 2px solid #fefefe;
      cursor: grab;
    }

    #plague-gif-wrapper p {
      margin: 10px 0 0 0;
      font-size: 1rem;
      text-align: center;
    }
    
    #plague-gif {
      cursor: grab;

  -moz-user-drag: none;
    }

    #about {
      margin-top: 15px;
    }

 #mail_rat {
user-select: none; -webkit-user-drag: none;
    position: relative;
    top: 8px;
    right: 2px;
    }


#btn-contact {
  --g1: rgba(111, 209, 192, 0.2);
  --g2: rgba( 90, 184, 217, 0.2);
  --border: #4aa0b8;

  display: inline-block;
  padding: 0.2em 1.2em 0.8em 1.2em;
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--border) !important;

  background: linear-gradient(135deg, var(--g1), var(--g2));
  background-size: 200% 200%;
  background-position: 0% 50%;

  border: 2px solid var(--border);
  border-radius: 6px;
  transition: background-position 0.5s ease, transform 0.1s, filter 0.2s;
}

#btn-contact:hover {
  /* gradient slide + still subtle */
  background-position: 100% 50%;
  transform: translateY(-1px);
  filter: brightness(1.05);
}

#btn-contact:active {
  transform: translateY(2px);
  filter: brightness(0.9);
}

    section p {
      font-size: 1.2rem;
      line-height: 1.6;
      margin-bottom: 1rem;
    }

    /* profile */
    #profile { max-width: 980px; }
    .profile {
      display: grid;
      grid-template-columns: 1fr 2fr;
      gap: 2rem;
      padding: 0 2rem 2rem;
    }
    .sidebar {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .sidebar .photo {
      width: 100%;
      /*background: #ddd;*/
      border-radius: 4px;
      margin-bottom: 1rem;
      -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 40%, rgba(0,0,0,0.1) 100%);
      mask-image: radial-gradient(circle, rgba(0,0,0,1) 40%, rgba(0,0,0,0.1) 100%);
      -webkit-mask-size: cover;
      mask-size: cover;
      
    }

    .sidebar a {
      font-family: 'Helvetica Neue', sans-serif;
      font-size: 0.9rem;
      color: #2a2a2a;
      text-decoration: underline;
    }

    /* Citation styles */
    .citation {
      display: inline-block;
      position: relative;
      color: #0066cc;
      text-decoration: none;
      font-size: 0.9em;
      vertical-align: super;
      font-weight: bold;
      cursor: pointer;
      border-radius: 2px;
      padding: 0 2px;
      margin: 0 1px;
      transition: background-color 0.2s ease;
    }

    .citation:hover {
      background-color: rgba(0, 102, 204, 0.1);
    }

    /* Tooltip container */
    .tooltip {
      position: absolute;

      bottom: 100%;
      left: 50%;
      transform: translateX(-50%);
      background: #333;
      color: white;
      text-shadow: none !important;
      padding: 12px 16px;
      border-radius: 6px;
      font-size: 0.9rem;
      line-height: 1.4;
      max-width: 400px;
      width: max-content;
      z-index: 9000;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
      pointer-events: none;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      font-family: 'Helvetica Neue', sans-serif;
      font-weight: normal;
      text-align: left;
overflow: visible; 
    }

    .tooltip::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 6px solid transparent;
      border-top-color: #333;
    }

    .citation:hover .tooltip {
      opacity: 1;
      visibility: visible;
    }

    /* References section */
    #references {
      padding: 0 2rem;
      border-top: 1px solid #ddd;
      margin-top: 2rem;
    }

    #references h2 {
      font-size: 1.5rem;
      margin-bottom: 0rem;
      color: #2a2a2a;
      font-family: 'Helvetica Neue', sans-serif;
    }

    .reference-list {
      list-style: none;
      counter-reset: reference-counter;
    }

    .reference-item {
      counter-increment: reference-counter;
      margin-bottom: 1rem;
      font-size: 0.95rem;
      line-height: 1.5;
      padding-left: 2rem;
      position: relative;
    }

    .reference-item::before {
      content: counter(reference-counter);
      position: absolute;
      left: 0;
      top: 0;
      font-weight: bold;
      color: #0066cc;
    }

    .reference-item a {
      color: #0066cc;
      text-decoration: none;
    }

    .reference-item a:hover {
      text-decoration: underline;
    }

    @media (max-width: 768px) {
      #plague { flex-direction: column; }
      .profile { grid-template-columns: 1fr; }
      
      .tooltip {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: none;
        max-width: none;
        width: auto;
      }
      
      .tooltip::after {
        display: none;
      }
    }

/* hide tooltips on devices that can't hover such as touchscreens */
@media (hover: none) {
  .tooltip {
    display: none !important;
  }
}

footer {
  width: 100%;
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.9rem;
  margin-top: auto;
}

footer a {

  color: #2a2a2a;
  /*color: #f3f0e8;*/
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  html { background-color: #121212; }
  body {
    background-color: #121212;
    color: #e0e0e0;
  }

  header {
    background: url('rosa_rats_white.png') center bottom no-repeat; 
    background-size: 70%;
  }

  header h1,
  header h2 {
    color: #e0e0e0;
    text-shadow: none;
  }
  header h2 {
    color: #aaa;
  }

  .container {
    background-color: rgba(30, 30, 30, 0.95);
    background-blend-mode: darken;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    text-shadow: none;
  }
  
  a,
  footer a {
    color: #8ab4f8 !important;
  }

  section h2 {
    border-bottom-color: #333;
    color: #e0e0e0;
  }

  section p,
  #plague p {
    color: #ccc;
  }

  #plague-gif-wrapper video {
    border-color: #222;
  }

  .citation {
    color: #8ab4f8;
    overflow: visible; 
  }

  .citation:hover {
    background-color: rgba(138, 180, 248, 0.1);
  }

  .tooltip {
    background: #222;
    color: #e0e0e0;
    text-shadow: none !important;
  }

.container .citation .tooltip {
  text-shadow: none !important;
}

  .tooltip::after {
    border-top-color: #222;
  }

  #references {
    border-top-color: #333;
  }

  #references h2 {
    color: #e0e0e0;
  }

  .reference-item::before {
    color: #8ab4f8;
  }

  .reference-item a {
    color: #8ab4f8;
  }

  .sidebar {
  }
  .sidebar .photo {
    /*background: #444;
    border: 2px #222 solid; */
  }
}

 

@media (max-width: 765px) {
  footer { margin: 1rem 0; } 

  body { padding: 0; } 
  .container {
    padding: 1rem 0.2rem 1rem 0.2rem;
    margin-bottom: 15px;
  }

  .profile {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 1rem 1rem;
  }

  #profile {
    margin: -10px;
    padding: 0;
  } 

  .sidebar {
    padding: 0;
  }
  .sidebar .photo {
    margin: 1rem auto;
  }

  .sidebar .photo img {
    display: block;
    width: 50%;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
  }
}

    .floating-link {
      position: fixed;
      top: 2rem;
      right: 2rem;
      z-index: 1000;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 1rem;
      background: rgba(255, 255, 255, 0.95);
      border: 1px solid rgba(74, 160, 184, 0.3);
      border-radius: 25px;
      text-decoration: none;
      color: #4aa0b8;
      font-size: 0.9rem;
      font-weight: 500;
      font-family: 'Helvetica Neue', sans-serif;
      backdrop-filter: blur(10px);
      transition: all 0.3s ease;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      cursor: pointer;
    }

    .floating-link:hover {
      background: rgba(255, 255, 255, 1);
      border-color: #4aa0b8;
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      color: #4aa0b8 !important;
    }

    .floating-link img {
      width: 20px;
      height: 20px;
      user-select: none;
      -webkit-user-drag: none;
    }

    /* Dark mode styles */
    @media (prefers-color-scheme: dark) {
      .floating-link {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(138, 180, 248, 0.3);
        color: #8ab4f8;
      }

      .floating-link:hover {
        background: rgba(30, 30, 30, 1);
        border-color: #8ab4f8;
        color: #8ab4f8 !important;
      }
    }

    /* Mobile responsiveness */
    @media (max-width: 768px) {
      .floating-link {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
      }

      .floating-link span {
        display: none;
      }

      .floating-link img {
        width: 22px;
        height: 22px;
      }
    }

    /* Extra small screens */
    @media (max-width: 480px) {
      .floating-link {
        top: 0.5rem;
        right: 0.5rem;
      }
    }

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