@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/source_code_pro-latin_ext.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/source_code_pro-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/quicksand-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


html {
  --dark-mode-toggle-width: 2rem;
  --hamburger-width: 28px;
  --color-page-bg: #ffffff;
  --color-text: #222730;
  /* white for text/shadows on dark backgrounds (header nav, funding logo) */
  --color-on-dark: #ffffff;
  /* header level0 (top) background */
  --color-header-level0-bg: #3c5782;
  /* header level1 (secondary) background */
  --color-header-level1-bg: #A6D0ED;
  /* header level0 nav link text */
  --color-header-level0-link: #d9dbe0;
  /* header level0 active nav item text */
  --color-header-level0-active: #eee;
  /* site title text (h1 in header) */
  --color-header-title: #d02030;
  /* nav item underline / menu separator */
  --color-menu-border: #888;
  --color-link: #3b5683;
  --color-link-hover: #819aca;
  /* button bg: light blue in light mode */
  --color-btn-bg: #819aca;
  --color-btn-bg-hover: #6ba3d9;

  --color-footer-bg: #eee;
  --color-footer-text: #222730;

  /* shared border for code blocks, abstracts, etc. */
  --color-box-border: #ccc;
  /* code / pre background */
  --color-code-bg: #f4f4f8;
  /* box / card shadow */
  --color-shadow: rgba(0.5,0.5,0.5,0.3);
  box-sizing: border-box;

  /* avoid horizontal jumping when scrollbar is needed after page switch: */
  width: 100vw;
  overflow-x: hidden;
  /* avoid long words from messing up the layout */
    overflow-wrap: break-word;
  /**/
}

html[data-theme="dark"] {
  --color-page-bg: #1a1f27;
  --color-text: #d9dbe0;
  --color-on-dark: #ffffff;
  --color-header-level0-bg: #3c5782;
  --color-header-level1-bg: #a6d0ed;
  --color-header-level0-link: #d9dbe0;
  --color-header-level0-active: #ccc;
  --color-header-title: #ff4050;
  --color-menu-border: #666;
  --color-link: #819aca;
  --color-link-hover: #a6d0ed;
  /* button bg: dark blue in dark mode */
  --color-btn-bg: #3b5683;
  --color-btn-bg-hover: #4d6fa0;
  --color-footer-bg: #222730;
  --color-footer-text: #d9dbe0;
  --color-box-border: #444;
  --color-code-bg: #2a3040;
  --color-shadow: rgba(0,0,0,0.6);
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.5;
    background: var(--color-page-bg);
    color: var(--color-text);
    padding: 0 0;
    margin: 0 0;

    position: relative;
    min-height: 100vh; /* to move footer to bottom */
    /* scrollbar-gutter: stable both-edges;*/
    display: flex;
    flex-direction: column;
    transition: background 200ms ease, color 200ms ease;
}

header, footer, main {
    display: block;
    width: 100%;
    margin: 0 0;
    padding: 1em 1em;
}

header {
    padding-right: 2em;
}

header.level1 {
    padding: 1.0em 1em;
}

header, footer{
    flex: 0 0 auto;
}
.content {
    max-width: 60rem;
    margin: auto;
}

header .content {
    max-width: 40rem;
}
main {
    flex: 1 0 auto;
    /*padding: 2rem;*/
    padding-bottom: 2rem;
    font-size: 1.2rem;
}


header {
    box-shadow: 0px .15rem .15rem var(--color-shadow);
}
header.level0 {
    background: var(--color-header-level0-bg);
    z-index: 3;
}
header.level1 {
    background: var(--color-header-level1-bg);
    z-index: 2;
}
header h1 a {
    color: var(--color-on-dark);
}
header a { text-decoration: none; }
.active .menuitem { font-weight: bold; }


header.level0 a       { color: var(--color-header-level0-link); }
header.level0 a:hover { color: var(--color-on-dark); }
/* Keep underline visible but brighter on hover; ease out when un-hovering. */
header.level0 .menuitem { border-bottom: 1px solid var(--color-menu-border); transition: border-color 500ms ease; }
header.level0 .menuitem:hover { border-bottom-color: var(--color-on-dark); transition: none; }
header.level1 a       { color: var(--color-text); display:table;}
header.level1 a:hover { color: var(--color-link); }
header.level0 nav { font-size: 1.8rem; }
header.level1 nav { font-size: 1.3rem; }

.level0 .active .menuitem { color: var(--color-header-level0-active); }
.level1 .active .menuitem { color: var(--color-text); display: table; }



header h1 {
    color: var(--color-header-title);
    margin: 0;
    font-weight: normal;
    font-size: 42px;
}

header nav {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
}
header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
}

header nav ul li {
 /* display: inline; */
    /*margin: 0 40px 0 0;*/
    margin: 0 0 0 0;
    flex: 1 0;
    height: 1.5em;
}

.menuitem {
    border-bottom: 1px solid var(--color-menu-border);
    padding-bottom: 0.3rem;
    margin: auto;
}


a {
    color: var(--color-link);
}

a:hover {
    color: var(--color-link-hover);
}


footer {
    box-shadow: 0px -.15rem .2rem var(--color-shadow);
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    bottom: 0;
    font-size: .8rem;
}

.aspect {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
}

.logos {
    width: 100%;
    margin: 0rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    column-gap: 2rem;
}

div.left_spacer {
    width: 30rem;
    flex: 1 1 auto;
}
div.algohex_logo_container {
    flex: 1 1 auto;
}
div.funding_logo_container {
    width: 30rem;
    flex: 1 1 auto;
}
div.algohex_logo_size {
    width: 30rem;
    max-width: 100%;
    margin: auto;
}
div.funding_logo_size {
    margin-left: auto;
    padding: 0px;
     /*
     box-shadow: inset 0 0 10px var(--color-text);
      */
    box-shadow: 0 0 2px var(--color-on-dark);
    background-color: var(--color-on-dark);
    position:relative;
    width: 18rem;
    max-width: 100%;
}

html[data-theme="dark"] div.funding_logo_size {
    background-color: var(--color-code-bg);
}
.algohex_logo_aspect {
    padding-bottom: calc(20.570223 / 95.184509 * 100%); /* svg size */
}
.funding_logo_aspect {
    padding-bottom: calc( 118 / 406.5 * 100%); /* svg size */
}
img.fixedaspect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

footer #funding_text {
    margin-bottom: .5rem;
    width: 100%;
    max-width: 25rem;
    flex: 1 0 auto;
}

.shadow {
    box-shadow: .15rem .15rem .15rem var(--color-shadow);
}

pre.bibtex {
    overflow: hidden;
    margin: 0.1em;
    white-space: pre-wrap;
    border: 1px solid var(--color-box-border);
    background: var(--color-code-bg);
    padding: .5em;
    font-family: 'Source Code Pro', monospace;
    font-size: .9em;

    transition: 200ms ease;
}
div.abstract {
    transition: 200ms ease;
}

.abstract {
    border: 1px solid var(--color-box-border);
    padding: .5em;
}

/* ── Publication details toggle (no-JS, sibling trick like hamburger) ── */

/* Hide the native <summary> marker */
.pub-details > summary {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-block;
    cursor: pointer;
}
.pub-details > summary::-webkit-details-marker {
    display: none;
}
/* Links inside <summary> must not eat the click — let it reach the <summary> so <details> toggles */
.pub-details > summary a {
    pointer-events: none;
}

/* Copy BibTeX button — proper button on individual pub page */
.copy-bibtex-btn {
    background: var(--color-btn-bg);
    color: var(--color-bg);
    border: none;
    border-radius: 0.25em;
    padding: 0.2em 0.6em;
    font-size: 0.7em;
    cursor: pointer;
}
.copy-bibtex-btn:hover {
    background: var(--color-btn-bg-hover);
}
/* In the publication list, style it as inline text instead */
.publication-info .copy-bibtex-btn {
    background: none;
    color: var(--color-link);
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-decoration: none;
}

/* Abstract / BibTeX hidden by default inside publication list items,
   revealed when their own <details> is open. Scoped to .publication-info so
   the individual publication page always shows them. */
.publication-info .abstract,
.publication-info .bibtex {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 .5em;
    transition: max-height 200ms ease-out,
                opacity 200ms ease-out,
                padding 200ms ease-out;
}

.publication-files:has(.pub-details-abstract[open]) ~ .abstract {
    max-height: 10000px;
    opacity: 1;
    padding: .5em;
    transition: max-height 200ms ease-out,
                opacity 200ms ease-out,
                padding 200ms ease-out;
}

.publication-files:has(.pub-details-bibtex[open]) ~ .bibtex {
    max-height: 3000px;
    opacity: 1;
    padding: .5em;
    transition: max-height 200ms ease-out,
                opacity 200ms ease-out,
                padding 200ms ease-out;
}
.abstract > p {
    margin: 0;
}



ul.publication-list,
ul.team,
ul.news
{
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

ul.team > li,
ul.publication-list > li,
ul.news > li
{
    display: inline-block; 
    list-style: none;
    margin-left: 0;
    margin-top: 1rem;
    margin: .5rem;
    padding-left: 0em;
    padding-right: 1em;
}

ul.team li {
    min-height: 18rem;
}
ul.publication-list > li {
    min-height: 8rem;
    display: flex;
    flex-direction: row;
}

ul.publication-files {
    padding: 0em;
}

ul.publication-files >li
{
    list-style: none;
    display: inline-block; 
    padding-right: 1em;
}

.profile {
    display: flex;
    flex-direction: row;
}

.team li:first-of-type {
    margin-top: 0;
}

div.mugshot {
    width: 15rem;
}
div.mugshot img {
    display: block;
    max-width: 90%;
    height: auto;
}
.person-info {
    /*
    margin-top: 1em;
    */
}

.person-info a {
    text-decoration: none;
}

figure {
    margin: 1rem;
    max-width: 100%;
}
figure img {
    max-width: 100%;
    height: auto;
}
figure figcaption {
    font-style: italic;
}
figure.left  { float: left; }
figure.right { float: right; }




div.publication-teaser {
    flex: 1 1;
    max-width: 100%;
    padding-top: .4rem;
}

.publication-info {
    flex: 2 2;
    display: flex;
    flex-direction: column;
}

h1 a { text-decoration: none }
h2 a { text-decoration: none }
h3 a { text-decoration: none }

h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }

.publication-list h3,
.person-info h3,
.news h3
{
    margin-top: 0px;
    margin-bottom: 0px;
}

.person-info h2, .person-info h3
{
    margin-top: 0px;
    margin-bottom: 0px;
}


div.publication-teaser img {
    display: block;
    max-width: 90%;
    height: auto;
}
.teaser img {
    max-width: 100%;
    height: auto;
}
img.selected-figure {
    max-width: 100%;
    height: auto;
}

.publication-venue {
    font-style: italic;
}

img.icon {
    height: 1rem;
}
a::before {
    display: inline-block;
    height: 1.2em;
    vertical-align: text-bottom;
    background-repeat: no-repeat;
    background-size: 1.2em;
    background-position: left center;
}
a[href^="http"]::before {
    content: "";
    background-image: url('/static/icons/link.svg');
    width: 1.2em;
    margin-right: 0.2em;
}
a[href^="tel:"]::before {
    content: "";
    background-image: url('/static/icons/phone-call.svg');
    width: 1.2em;
    margin-right: 0.2em;
}
a[href^="mailto:"]::before {
    content: "";
    background-image: url('/static/icons/envelope.svg');
    width: 1.2em;
    margin-right: 0.2em;
}
a[href$='.zip']::before, a[href$='.tar.gz']::before, a[href$='.tar.bz2']::before, a[href$='.tar.zst']::before {
    content: "";
    background-image: url('/static/icons/package.svg');
    width: 1.2em;
    margin-right: 0.2em;
}
a[href$='.ppt']::before, a[href$='.key']::before {
    content: "";
    background-image: url('/static/icons/slides.svg');
    width: 1.2em;
    margin-right: 0.2em;
}
a.bibtex-link::before, a.abstract-link::before {
    content: "";
    background-image: url('/static/icons/file-text.svg');
    width: 1.2em;
    margin-right: 0.2em;
}
a[href$='.pdf']::before {
    content: "";
    background-image: url('/static/icons/file-pdf.svg');
    width: 1.2em;
    margin-right: 0.2em;
}
a.a-project-page::before {
    content: "";
    background-image: url('/static/icons/info.svg');
    width: 1.2em;
    margin-right: 0.2em;
}

a {
    padding-left: 0;
}

.blog-post {
    padding: .2rem .5rem .1rem .5rem;
    width: 100%;
    justify-content: space-between;
}


span.pub_date {
    font-style: italic;
}
span.pub_date::before {
    content: "";
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.2em;
    vertical-align: text-bottom;
    background-image: url('/static/icons/date.svg');
    background-repeat: no-repeat;
    background-size: 1.2em;
    background-position: left center;
}

.content div.meta {
    margin-bottom: 1em;
}

@media screen and (max-width: 55rem) {
  .logos {
    flex-direction: column;
  }
  div.algohex_logo_size {
      margin: auto;
  }
  div.algohex_logo_container {
      width: calc(100% - var(--hamburger-width));
      margin-right: 3rem;
  }
  div.funding_logo_container {
      width: calc(100% - var(--hamburger-width));
      margin-left: auto;
      margin-right: 3rem;
  }
}

@media screen and (max-width: 40rem) {
  .profile     { flex-direction: column; }
  ul.publication-list li { flex-direction: column; }

   .active .menuitem         { display: block !important;}
   header a                  { display: block !important;}
}

/* ── Hamburger menu (details + grid animation) ── */

/* Hamburger icon */
.hamburger {
    display: none;
    position: absolute;
    top: 1.2em;
    right: 0.8em;
    width: var(--hamburger-width);
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--color-on-dark);
    border-radius: 2px;
    transition: transform 200ms ease, opacity 200ms ease;
}

/* Hide <summary> marker */
.hamburger::-webkit-details-marker {
    display: none;
}

/* Show hamburger on mobile */
@media screen and (max-width: 40rem) {
    .hamburger {
        display: flex;
    }

    /* Animate nav open/close — sibling trick for reliable transitions */
    .nav-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 200ms ease-out;
    }

    details[open] + .nav-content {
        max-height: 500px;
        transition: max-height 200ms ease-out;
    }

    header nav ul {
        flex-direction: column;
    }

    /* Animate hamburger into X */
    header details[open] > .hamburger span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }
    header details[open] > .hamburger span:nth-child(2) {
        opacity: 0;
    }
    header details[open] > .hamburger span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }
}

/* Dark mode toggle */
.dark-mode-toggle {
    position: absolute;
    top: 0.5em;
    left: 0.5em;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    z-index: 10;
    transition: transform 200ms ease;
    color: var(--color-text);
}

@media screen and (max-width: 40rem) {
    header.level0 {
        padding-top: 0.5em;
        position: relative;
    }
    .dark-mode-toggle {
        top: 2.6em;
        right: 0.8em;
        left: auto;
    }
}


.dark-mode-toggle:hover {
    transform: scale(1.2);
}
.dark-mode-toggle .icon-sun,
.dark-mode-toggle .icon-moon {
    display: block;
}
/* Show moon in light mode, sun in dark mode (the icon represents the action) */
.dark-mode-toggle .icon-sun {
    display: none;
}
.dark-mode-toggle .icon-moon {
    color: var(--color-on-dark);
}
html[data-theme="dark"] .dark-mode-toggle .icon-moon {
    display: none;
}
html[data-theme="dark"] .dark-mode-toggle .icon-sun {
    display: block;
    color: var(--color-on-dark);
}

html[data-theme="dark"] a::before,
html[data-theme="dark"] span.pub_date::before {
    filter: invert(1);
}

/* Move Lektor edit link down */
#lektor-edit-link {
    margin-top: 3em !important;
}




