* {
    box-sizing: border-box;
  }
  :root{
    --site-font: "Epilogue", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }
  
  body {
    margin: 0;
    font-family: var(--site-font);
    color: black;
    background-color: white;
  }

  body.darkMode {
    background-color: black;
    color: white;
  }
  body.darkMode * {
    background-color: black;
    color: white;
  }
  body.darkMode a[aria-current='page'] {
    background-color: black;
    color: white;
  }

  button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: larger;
    }
    button:focus {
        outline: none;
    }
  nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.1rem;
    gap: 2rem;
    /* border-bottom: solid 1px #aaa; */
    background-color:rgb(255, 255,255);
  }
  
  nav a {
    display: inline-block;
    /* min-width: 100%; */
    padding: 0.5rem;
    border-radius: 0.2rem;
    border: rgba(255,255,255,0) solid 1px;
    text-align: center;
    text-decoration: none;
    color:rgb(0,0,0);
    /* font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; */
    font-family: 'Epilogue', sans-serif;
    font-style: normal;
    font-size: 28px;
  }
  
  nav a[aria-current='page'] {
    color: rgb(0,0,0);
    background-color: rgba(255,255,255,0);
  }

  
  h1 {
    font-family: var(--wp--preset--font-family--epilogue);
    /* font-weight: bold; */
    font-size: 28px;
    color: #444;
    display: flex;
    justify-content: flex-start;
    width: 100%;
  }
  
  .headerClass {
    /* background-image: url(./images/image1.png); */
    /* background-size: cover;  */
    /* padding-top: 50px; */
    color: #fff;
    text-align: center;
    padding: 1em;
    height: auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: #fff;
    font-family: 'Epilogue', sans-serif;
  }

  .leoFace {
    width: clamp(80px, 22vw, 140px);
    border-radius: 9999px;
    display: block;
    margin: 0.5rem auto !important; /* keep it centered on narrow screens */
    text-align: center;
    position: absolute;        /* large-screen position (overridden on small screens by the later rule) */
    left: 5%;
    top: 5%;
    font-family: var(--site-font);
    font-size: clamp(26px, 8vw, 42px); /* larger minimum and more responsive scaling on small screens */
    color: inherit;
    transition: transform 200ms ease, font-size 200ms ease;
    background: transparent !important;
  }

  /* Ensure a bigger, non-overlapping face on very narrow phones */
  @media (max-width: 420px) {
    .leoFace {
      position: relative;
      left: 0;
      top: 0;
      transform: none;
      width: clamp(90px, 32vw, 120px);
      font-size: 32px; /* comfortable tap/read size on small screens */
      margin: 0.5rem auto !important;
    }
  }
  .nameTitle {
    display: flex;
    flex-wrap: wrap;
    align-items: left;
    justify-content: left;
    padding: 0.5rem;
    gap: 0.5rem;
    border-bottom: solid 1px #aaa;
    background-color: rgba(0,0,0,0);
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
  }
  .backgroundPic {
    width: 100%;
    background-image: url(./images/image1.png);
    background-size: cover;
    width: 100%;
    color:white;
    text-align: center;
    padding: 2em;
    height: 20vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #eee;
  }
  .collapsible {
    background-color: #eee;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    }
    .active, .collapsible:hover {
        background-color: #ccc;
    }
    .content {
      font-family: var(--site-font);
      font-size: 24px;
      padding-top: 4%;
      padding-left: 30%;
      width: 95%;    
      line-height: 170%;
    }
    .projects {
        /* display: flex; */
        width: 100%;
    }
    .card {
        font-weight: 400;
        border: 0;
        -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
        box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
        position: relative;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-direction: column;
        flex-direction: column;
        min-width: 0;
        word-wrap: break-word;
        background-color: #fff;
        background-clip: border-box;
        border: 1px solid rgba(0, 0, 0, .125);
        border-radius: .25rem;
    }
    .hoverable {
        -webkit-box-shadow: none;
        box-shadow: none;
        -webkit-transition: all 0.55s ease-in-out;
        transition: all 0.55s ease-in-out;
        transition-behavior: normal;
        transition-duration: 0.55s;
        transition-timing-function: ease-in-out;
        transition-delay: 0s;
        transition-property: all;
        
    }
    .gridFig{
        width: 20%
    }
    .cardBody {
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        min-height: 1px;
        padding: 1.25rem;
    }
    /* ---------- Responsive defaults ---------- CHATGPT */

    /* Helps avoid accidental horizontal scrolling on mobile */
    html, body {
      width: 100%;
      overflow-x: hidden;
    }

    /* Friendlier default text sizing */
    body {
      font-size: 16px;
      line-height: 1.5;
    }

    /* Optional: a consistent page container (use in your HTML if you want) */
    /* .container { width: min(100% - 2rem, 1100px); margin: 0 auto; } */


    /* ---------- NAV ---------- */

    nav {
      /* allow wrapping on small screens */
      flex-wrap: wrap;          /* override nowrap */
      justify-content: center;  /* nicer on phone */
      gap: 0.75rem;
      padding: 0.5rem 1rem;
    }

    nav a {
      /* scale down on phones, scale up on laptops */
      font-size: clamp(16px, 3.5vw, 22px);
      padding: 0.6rem 0.8rem;
    }

    /* On larger screens, push nav to the right like you had */
    @media (min-width: 768px) {
      nav {
        justify-content: flex-end;
        gap: 1.5rem;
      }
    }


    /* ---------- HEADER / HERO ---------- */

    .headerClass {
      /* height: 10vh can get too small on phones. Let content define height */
      height: auto;
      padding: 1rem;
      gap: 0.75rem;
    }

    /* Make the face not overlap content on small screens */

    .photo {
      border-radius: 9999px;
      display: block;
      margin-left: auto;               /* push the photo to the right edge of its container */
      align-self: center;              /* if parent is flex, center vertically */
      width: clamp(80px, 28vw, 260px); /* responsive sizing */
      max-width: 40%;
      object-fit: cover;
      /* slide-in animation from the right */
      transform: translateX(30%);
      opacity: 0;
      transition: transform 600ms ease-out, opacity 600ms ease-out;
      animation: slideInFromRight 600ms ease-out 1 forwards;
    }

    @keyframes slideInFromRight {
      from {
        transform: translateX(30%);
        opacity: 0;
      }
      to {
        transform: translateX(0);
        opacity: 1;
      }
    }

    /* On very small screens keep it inline with content */
    @media (max-width: 600px) {
      .photo {
        margin-left: 0;
        width: clamp(56px, 22vw, 120px);
        transform: translateX(0);
        opacity: 1;
        animation: none;
      }
    }

    .nameTitle {
      font-size: clamp(18px, 4vw, 24px);
    }

    /* On larger screens, you can re-enable the absolute positioning if you like */

      .headerClass {
        padding: 2em;
      }
    }


    /* ---------- BACKGROUND PIC SECTION ---------- */

    .backgroundPic {
      height: auto;          /* 20vh can be awkward on very short screens */
      min-height: 180px;
      padding: 1.25rem;
      background-position: center;
    }


    /* ---------- MAIN CONTENT ---------- */

    /* This is the biggest fix: remove the 30% left padding */
    .content {
      font-size: clamp(16px, 3.8vw, 20px);
      padding: 1rem;          /* mobile-friendly */
      width: 100%;
      max-width: 75ch;        /* comfortable reading width on laptop */
      margin: 0 auto;         /* center it */
      line-height: 1.7;
    }

    /* On larger screens, add a bit more spacing but keep it centered */
    @media (min-width: 768px) {
      .content {
        padding: 2rem 1.5rem;
      }
    }


    /* ---------- CARDS / IMAGES ---------- */

    .gridFig {
      width: min(120px, 30vw); /* was 20% (can get tiny/huge depending on context) */
    }

    .card {
      /* cards will shrink nicely on phone if you give them breathing room */
      margin: 0.75rem 0;
    }


    /* ---------- Collapsible tap targets ---------- */

    .collapsible {
      padding: 14px 16px;
      font-size: clamp(14px, 3.5vw, 16px);
    }

        /* Layout */
    .research-section .section-inner{
      display: grid;
      font-family: var(--site-font);
      grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); /* image bigger than text */
      gap: 2rem;
      align-items: start;
    }

    /* Make the figure/image fill the left column */
    .research-section .section-figure{
      margin: 0;            /* remove default figure margins */
      width: 100%;
    }

    .research-section .section-figure img{
      display: block;
      width: 100%;
      height: auto;
      max-width: 100%;      /* never overflow its container */
    }

    /* Mobile: stack and keep within page */
    @media (max-width: 768px){
      .research-section .section-inner{
        grid-template-columns: 1fr;
      }

      .research-section .section-figure{
        order: -1;          /* optional: put image above text */
      }
    }
    