:root {
  --left-width: 140px;
  --center-max: 750px;
  --bg: #ffffff;
  --code-bg: #ffffe0;
  --pane-bg: var(--bg);
  --footer-bg: #f2f2f2;
  --page-bg: var(--bg);
  --text: #1d2327;
  --muted: #5c666e;
  --line: #d9dcdf;
  --h1: #777777;
  --accent: #1f5f8b;
  --highlight: #ffc;
  --linkx: #dd0000;
  --link: var(--accent);           
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181b;
    --footer-bg: #1c2125;
    --text: #e8eaec;
    --muted: #9aa4ab;
    --h1 666666;
    --line: #2f373d;
    --accent: #7fb7de;
    --highlight: #620;
    --link: var(--accent);
    --linkx: #ff4030;
  }
}

* { box-sizing: border-box; }

html {
    font-size: 14.4px;
}

body {
  margin: 0px;
  padding: 0px;
  background: var(--page-bg);
  color: var(--text);
  font-family: Quicksand, sans-serif;
  font-optical-sizing: auto;
  font-size: 1.0rem;
  font-weight: 520;
  font-style: normal;
  line-height: 1.5;
}

a {
    font-weight: 530;
}

header, h1, h2, h3, .pane-left {
    font-family: Quicksand;
    font-weight: 550;
}

.pane-left {
  background: var(--pane-bg);
  border-right: 0px solid var(--line);
  padding: 1.5rem 1rem;
  position: sticky;
  top: -50px;
  height: min-content;
}

.pane-center {
    background: var(--bg);
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    grid-template-columns: 100%;
    min-height: 100vh;
    min-height: 100svh;                          
    padding-top: 1.5rem;
    padding-right: clamp(1rem, -1rem + 8vw, 2rem);
    padding-bottom: 1.5rem;
    padding-left: clamp(1rem, -1rem + 7vw, 2rem);
    border-left: .5px solid var(--line);
    border-right: .5px solid var(--line);
    max-width: var(--center-max);
    min-width: 0;
    margin: 0;
}

.leftgutter {
    background: var(--pane-bg);
}

.rightgutter {
    background: var(--bg);
}

.pane-left-image {
  display: block;
  width: 150px;
  height: auto;
  max-width: 150px;
  margin: -1.5rem -1rem 1rem;
}

.pane-left-empty {
    padding-top: 50px;
}

.pane-left ul { list-style: none; margin: 0; padding: 0; }
.pane-left li {
  display: block;
  padding: 0.4rem 0.5rem;
}
.pane-left a{
  color: var(--text);
  text-decoration: none;
}

.pane-left li ul {
    margin-top: -0.5rem;
}

.pane-left li li {
    padding: .1rem 0rem .1rem 2.5rem;
    text-indent: -1.7rem;
    margin-right: -.75rem;
    font-size: .8rem;
}

.pane-left a:hover {
    background: var(--bg); font-weight: 700;
}

.pane-left a:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}


.pane-center h1 {
    margin-top: clamp(1.5rem, 3vw, 2rem);
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: clamp(1rem, 1rem + 1vw, 1.4rem);
    font-weight: 300;
    font-style: normal;
    color: var(--h1);
}

h1.people {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    color: var(--h1p);
}    

.pane-center h2 {
    margin-top: clamp(1.5rem, 1.5rem + 1vw, 2.3rem);
    font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem);
    margin-bottom: .5rem;
    font-weight: 700;
    font-style: normal;
}

.pane-center h1+h2 {
    margin-top: clamp(1.0rem, 1.0rem + 1vw, 1.5rem);
}

.pane-center h3 {
    font-size: clamp(1.1rem, 1rem + .5vw, 1.2rem);
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.25rem;
}

.pane-center h2+h3 {
    margin-top: 1rem;
}

.pane-center ul {
    margin: .5rem 0rem .5rem 0rem;
    padding: 0 1.75rem 0 1.5rem;
}

.pane-center li {
    margin: .5rem 0rem .5rem 0rem;
}

.menu-button, .menu-float, .menu-close, .scrim {
    display: none;
}


@media (min-width: 720px) {
  .layout { display: flex; }
 
  .pane-left {
    flex: 0 0 var(--left-width);
  }
 
  .pane-center {
    flex: 0 1 var(--center-max);
    margin: 0;
  }

  .leftgutter {
      flex: 0 0 max(0px, calc((100vw - var(--center-max) - 2 * var(--left-width)) / 2));
  }

  .rightgutter {
      flex: auto;
  }   
}
 

@media (max-width: 719px) {

  .pane-left {
    position: fixed;
    top: 0;
    height: revert;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: var(--side-min);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
  }

  h1.people {
      font-size: clamp(1.4rem, 5vw, 2.5rem);
  }      

  .menu-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 25px;
    height: 40px;
    padding: 0px;
    background: var(--bg);
    border: 0px solid var(--line);
    margin-top:-1rem;
    margin-bottom: 0rem;
    cursor: pointer;
  }

  .menu-button span {
    display: block;
    height: 3px;
    background: var(--muted);
    border-radius: 2px;
  }
  
  .menu-close {
      display: block;
      background: var(--pane-bg);
      border: 0px solid var(--line);
      font-size: 1.5rem;
      font-weight: 300;
      color: var(--muted);
  }
  
  .menu-open .pane-left {
    transform: translateX(0);
    visibility: visible;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: block;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .menu-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }

}

@media (prefers-reduced-motion: reduce) {
  .pane-left, .scrim { transition: none; }
}

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 2rem 1rem 2rem;
  background-image: url("../images/banner.png");
  background-size: cover;
  background-position: center;  
}

.page-header-name {
    margin: 0;
    margin-top: 4px;
    font-size: 2.3rem;
    font-weight: 330;
    line-height: 1.0;
    color: white;
    text-shadow: -1px 0px 5px black, 1px 0px 5px black,
                 0px -1px 5px black, 0px 1px 5px black;    
}

.page-header-details {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding-left: 1rem;
  font-size: 1.2rem;
  border-left: 2px solid var(--line); /* the vertical bar */
  line-height: 1.2;
  color: #e2e2e2;
  text-shadow: -1px 0px 5px black, 1px 0px 5px black,
               0px -1px 5px black, 0px 1px 5px black;  
}
 

@media (max-width: 599px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding-left: clamp(.5rem, 4vw, 2rem);
    padding-right: clamp(.5rem, 4vw, 2rem);
        
    gap: 0.25rem;
  }
  .page-header-name { white-space: nowrap; }
  .page-header-details {
    flex-direction: row;
    gap: 0.25em;
    padding-left: 0.1rem;
    border-left: 0;
  }
  .page-header-details span:first-child::after { content: ","; }
}

main {
    padding-right: clamp(0rem, -4rem + 10vw, 3rem);
    margin-bottom: 2rem;
}

main a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 0.5px solid currentColor;
    padding-bottom: 0.07em;
    transition: border-bottom-width 0.15s ease;
}

main a:hover {
  border-bottom-width: 1.5px;
}

img.cntl {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  margin-top: 1.5rem;
  margin-bottom: -1.0rem;
}

.pnt {
    display: block;
    margin-top: 3rem;
    margin-bottom: -1rem;
}

.pnt img {
  width: 100%;
  max-width: 250px;
  height: auto;
}

.pnt span {
    margin-left: 1rem;
    font-weight: 600;
    font-style: italic;
    font-size: 1.0rem;
}

@media (max-width: 560px) {
    .pnt span {
        display: block;
        margin-left: 0rem;
    }
}

p {
    margin: 0px 0px 0.6rem 0px;
}

footer {
    background: var(--footer-bg);
    margin: 0 -2rem -1.5rem -2rem;
    border-top: 1px solid var(--line);
    border-top: 1px solid var(--line);
    font-style: italic;
    padding: .05rem 1.5rem .1rem 1.5rem;
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 499px) {
    div.footer .update {
        display: block;
    }
}

p.person img {
    display: inline;
    float: left;
    margin: .3em 1em .1em 0em;
}

p.person {
    margin-top: 10pt;
    font-weight: bold;
}

p.person a {
    font-weight: bold;
}

p.contact {
    font-style: italic;
}

div.clear { 
    clear: both;
    width: 100%;
    height: 1px;
    margin: 0px 0 10px 0;
}

.person a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 0px solid currentColor;
    padding-bottom: 0.07em;
}

p.paper {
    margin: .7rem 1rem .4rem 1rem;
}

p.pubs-fn, p.pubs-nb {
    margin: .2rem 1rem .2rem 1rem;
    font-size: .9rem;
}

.pubs-ab {
    margin: -.3rem 1rem .2rem 1rem;
    font-size: .9rem;
}

@media (max-width: 499px) {
    html {
        font-size: 13.2px;
    }
    p.paper {
        margin: .9rem .5rem .1rem .5rem;
    }

    p.pubs-fn, p.pubs-nb {
        margin: .2rem .5rem .2rem .5rem;
        font-size: .9rem;
    }

    .pubs-ab {
        margin: 0 0 0 .5rem;
        font-size: .9rem;
    }
}

.pubs-ab summary {
    cursor: pointer;
    color: var(--accent);
    font-family: Quicksand;
    font-weight: 400;
}


.papers div[id] {
    scroll-margin-top: 4em;
}

.papers div[id]:target {
    background: var(--highlight);
}

.papernav {
    border-top: 0.5px solid currentColor;
    background: var(--nav-bg);
    border-bottom: 0.5px solid currentColor;
    font-family: Quicksand;
    font-weight: 500;
    padding: .1rem 1rem .2rem 1rem;
    margin-top: 1.5rem;
}

.papernav a {
    color: var(--text);
    border-bottom: 0px;
}

.papernav a:hover {
    color: var(--link);
    border-bottom: 0px;
}

.papers div {
    border-top: 0px solid currentColor;
    margin-top: .7rem;
    margin-bottom: 1rem;
}

.papers h3 {
    border-top: 0px solid currentColor;
    margin-top: 2rem;
    margin-bottom: .25rem;
}


.papers h2+div, .papers h3+div {
    margin-top: .2rem;
}

.papers h2+h3 {
    margin-top: 1rem;
}

.cv h3 {
    margin-bottom: .2rem;
}

.cv p {
    padding-left: 2.5rem;
    margin: 0 0 0 0;
    text-indent: -1.5rem;
}

.cv {
    margin-bottom: 1rem;
}

.intro {
    font-style: italic;
}

code {
    font-family: "Atkinson Hyperlegible Mono", monospace;
    font-size: 1.05rem;
    font-weight: 460;
    font-style: normal;
    line-height: 1.35;
    padding: .15rem .5rem .15rem .5rem;
    background: var(--code-bg);
    border-bottom: 1px solid hsl(from var(--code-bg) h calc(s - 30) calc(l - 30));
    white-space: nowrap; 
}

.cv img {
    margin-top: 2rem;
    margin-bottom: -1rem;
}


/* Floating menu button: appears on mobile when scrolling up */
@media (max-width: 719px) {
  .menu-float {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 5;                 /* below the scrim (10) and the pane (20) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transform: translateY(-150%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
  }

  .menu-float.show {
    transform: none;
    visibility: visible;
  }

  .menu-float span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--muted);
    border-radius: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-float { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.funding {
    text-align: center;
    text-wrap: balance;
    word-spacing: 1rem;
    margin-top: 2em;
    background: white;
}

.funding img {
    height: 40px;
    width: auto;
    margin-block: 0.3rem;
}

.funding a {
    border-bottom: 0px;
}

.funding a:hover {
    border-bottom: 0px;
}

@media (prefers-color-scheme: dark) {
  .pnt img {
    filter: invert(1);
    background: #ccc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
  }
}
