/* FONTS */
/* https://fonts.googleapis.com/css2?family=Noto%20Serif:ital,wght@0,100..900;1,100..900&display=swap */

/* cyrillic-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-italic-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-italic-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-italic-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-italic-greek.woff2') format('woff2');
  unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-italic-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Noto Serif';
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-normal-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-normal-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-normal-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-normal-greek.woff2') format('woff2');
  unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-normal-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/noto-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* MAIN STYLESHEET DEFINITIONS */

:root {
    --green: #61bb46;
    --yellow: #fdb827;
    --orange: #f5821f;
    --red: #e03a3e;
    --purple: #963d97;
    --blue: #009ddc;
    --pastelgreen: #8fbb76;
    --pastelyellow: #fcc76a;
    --pastelorange: #f4a755;
    --pastelred: #e06c79;
    --pastelpurple: #8a5f9e;
    --pastelblue: #519fb0;
    --pastelgreen90: #e3eedd;
    --pastelyellow90: #feeccd;
    --pastelorange90: #fce6cf;
    --pastelred90: #f6d5d9;
    --pastelpurple90: #e8dfec;
    --pastelblue90: #dcecef;
    --mintgreen: #d5e8d4;
    --codegray: #f9f9f9;
    --link-unvisited: green;
    --link-visited: dimgray;
}

* {
    box-sizing: border-box;
}

button {
    border: unset;
    font-family: unset;
    font-size: unset;
}

figure {
    margin: unset;
}

mark {
    color: unset;
    background-color: unset;
}

body {
    /* iOS/macos, Android/Linux, Linux, Windows, rest */
    font-family: 'Noto Serif', serif;
    background-color: var(--mintgreen);
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 2em;
    padding: 2em 0.5em;
    margin: 0;
}

.rounded {
    padding: 2px 5px;
    border-radius: 5px;
}

.content > *:first-child {
    margin-top: 0;
}

.content > *:last-child {
    margin-bottom: 0;
}

.content > ul:last-of-type > li:last-of-type > p:last-child {
    margin-bottom: 0;
}

.content .touching-top {
    margin-top: 0;
}

.content .touching-bottom {
    margin-bottom: 0;
}

.center {
    text-align: center;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
}

/* use :is if this needs to override another property */
/* block elements naturally take up all the available width */
:where(h1, h2, h3, h4, h5, h6).article-header {
    border: 1px solid black;
    padding: 0.5em 1em;
}

/* Do not generally want to underline links */
a {
    text-decoration: none;
}

.writing a:link {
    color: var(--link-unvisited);
}

.writing a:visited {
    color: var(--link-visited);
}

/* Turn link underlining back on in prose contexts */
.writing a {
    text-decoration: underline;
}

/* Don't want to underline buttons */
.writing a.button-anchor {
    text-decoration: none;
}

.writing img.text-inline-image {
    vertical-align: middle;
}

/* ...or images */
.writing a:has(img.text-inline-image) {
    text-decoration: none;
}

.writing strong {
    font-weight: 600;
}

.writing code {
    font-size: 16px;
}

.writing pre {
    font-size: 16px;
    margin: 0;
}

.writing .code-example {
    display: flex;
    justify-content: center;
}

.writing .code-example > * {
    overflow-x: auto;
    background-color: var(--codegray);
    padding: 0.3em 0.5em;
    border: 1px solid gray;
    border-radius: 5px;
}

.writing ul > :not(li:last-child) {
    margin-bottom: 0.5em;
}

.writing ul {
    list-style-type: square;
}

#RSS {
    color: white;
    background-color: var(--pastelpurple);
    display: inline-block;
}

#RSS:hover {
    color: black;
    background: repeating-linear-gradient(
        -30deg,
        white,
        white 10px,
        var(--pastelpurple90) 10px,
        var(--pastelpurple90) 20px
    );
    /* From https://css-tricks.com/books/fundamental-css-tactics/striped-barberpole-animation/
     *
     * Why doesn't this work if we set 200% -> 100% here?
     * - See https://stackoverflow.com/questions/34930733/why-is-my-css-scrolling-animation-not-working-when-background-size-is-set-to-100
     * - Specifically, because background-position X% X% aligns the point X%
     *   across and X% down in the image with the point X% across and X% down
     *   the element's badding box. So if the width is the same as the padding
     *   box, then any background-position is automatically satisfied! Since eg
     *   3% is aligned with the same 3% point of the element's padding box.
     */
    background-size: 200% 100%;
    animation: barberpole 1.5s linear infinite;
}

/* Works by moving your perspective left over the linear gradient */
@keyframes barberpole {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 3% 0;
    }
}

main.writing {
    line-height: 1.7;
}

/* don't want to make buttons taller */
main.writing .button-anchor {
    line-height: normal;
}

header {
    display: flex;
    /* justify-content works on the main (primary) axis */
    justify-content: space-between;
    /* align-items works on the cross (secondary) axis */
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 32px;
}

header h1 a {
    color: black;
}

header nav ul {
    display: flex;
    column-gap: 1em;

    /* Remove all list styling */
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* causes li elements to get their dimensions from the elements they contain
 * (restores the situation to what would've been the case with <a> directly in
 * flex, since things in flex are treated as `display: block` by default)
 *
 * to be clear, <a> elements will be inline by default, the <li>'s will be
 * treated as blocks but the <a>'s won't give them the appropriate width/height
 * o/w
 *
 * block instead of inline-block because we want the full width to be taken up
 *
 * (inline blocks flow inline like `inline`, but can have their width manually
 * set (and dont take up the full width by default))
 */
header nav ul li a {
    display: block;
}

header .button-anchor {
    padding: 0.7em 0.9em;
    color: black;
    border: 1px black solid;
}

header :where(#about.active, #about:hover) {
    box-shadow: 0 -4px var(--pastelyellow) inset;
    background: repeating-linear-gradient(
        -30deg, /* angle of the line oriented with respect to 0 deg on the unit circle */
        white, /* start on <this color> */
        white 10px, /* by <this>px, fade to <this> color */
        var(--pastelyellow90) 10px, /* by <this>px, fade to <this> color */
        var(--pastelyellow90) 20px /* by <this>px, fade to <this> color and start over */
    );
}

header :where(#projects.active, #projects:hover) {
    box-shadow: 0 -4px var(--pastelred) inset;
    background: repeating-linear-gradient(
        -30deg,
        white,
        white 10px,
        var(--pastelred90) 10px,
        var(--pastelred90) 20px
    );
}

header :where(#publications.active, #publications:hover) {
    box-shadow: 0 -4px var(--pastelblue) inset;
    background: repeating-linear-gradient(
        -30deg,
        white,
        white 10px,
        var(--pastelblue90) 10px,
        var(--pastelblue90) 20px
    );
}

header :where(#blog.active, #blog:hover) {
    box-shadow: 0 -4px var(--pastelpurple) inset;
    background: repeating-linear-gradient(
        -30deg,
        white,
        white 10px,
        var(--pastelpurple90) 10px,
        var(--pastelpurple90) 20px
    );
}

.content {
    width: 54rem;
    max-width: 100%;
    border: 1px solid black;
    padding: 2em;
    background-color: white;
}

.border {
    border: 1px solid black;
}

main img.image {
    margin-left: 2em;
    float: right;
    width: 40%;
    height: auto;
}

main img.image-full {
    /* Need this because it's not floated, so it'll be an inline block (and
     * therefore have line height applied) otherwise
     */
    display: block;
    width: 100%;
    height: auto;
    margin-top: 1em;
    margin-bottom: 1em;
}

.content .side-by-side {
    display: flex;
    column-gap: 2em;
}

footer {
    display: flex;
    flex-direction: column;
    row-gap: 0.375em;
    width: 54rem;
    max-width: 100%;
    padding-left: 2em;
    padding-right: 2em;
    align-items: center;
    text-align: center;
}

footer p {
    margin: 0;
}

footer button {
    cursor: pointer;
    color: white;
    background-color: darkgreen;
    width: fit-content;
}

footer button:hover {
  color: black;
  background-image: 
    repeating-linear-gradient(
        -30deg,
        white,
        white 10px,
        transparent 10px,
        transparent 20px
    );
  background-size: 200% 100%;
  animation: rainbow-barberpole 3s linear infinite;
}

@keyframes rainbow-barberpole {
    0% {
        background-color: var(--pastelgreen90);
        background-position: 100% 0;
    }
    16.7% { background-color: var(--pastelyellow90); }
    33.3% { background-color: var(--pastelorange90); }
    50% { background-color: var(--pastelred90); }
    66.7% { background-color: var(--pastelpurple90); }
    83.3% { background-color: var(--pastelblue90); }
    100% {
        background-color: var(--pastelgreen90);
        background-position: 12% 0;
    }
}

footer ul.footer-thumbnails {
    /* Remove all list styling */
    list-style-type: none;
    margin: 0;
    padding: 0;

    display: flex;
    column-gap: 1em;
}

footer ul.footer-thumbnails > li {
    margin-bottom: 0;
}

/*
 * To find out correct width: open inspector, click on phone icon, and modify
 * the width until the layout breaks (or looks bad)
 */
@media screen and (max-width: 801px) {
    header {
        flex-direction: column;
        /* We need not set justify-content here because we haven't set an
         * explicit height, so the container will just be the size of its
         * contents, ie, the content will already be vertically centered
         * (vertical since that's the primary axis for a column layout)
         *
         * justify-content: center;
         */
        text-align: center;
        row-gap: 1em;
    }

    header nav {
        /* flex-basis will adjust height here, since flex-direction is column!
         * we want to set the width */
        width: 100%;
    }

    /* ul is the flex context for the nav bar */
    header nav ul li {
        /* nav items should grow equally to fit their container */
        /* flex-basis is set to 0 here */
        flex: 1;
    }
}

@media screen and (max-width: 501px) {
    header nav ul {
        flex-direction: column;
        row-gap: 0.5em;
    }

    header :where(#about.active, #about:hover) {
        box-shadow: 4px 0 var(--pastelyellow) inset;
    }

    header :where(#projects.active, #projects:hover) {
        box-shadow: 4px 0 var(--pastelred) inset;
    }

    header :where(#publications.active, #publications:hover) {
        box-shadow: 4px 0 var(--pastelblue) inset;
    }

    header :where(#blog.active, #blog:hover) {
        box-shadow: 4px 0 var(--pastelpurple) inset;
    }

    /* Laying out images near the bottom of the page will require another
     * class, this time with a margin-top: 1em.
     */
    main img.image {
        margin-top: 1em;
        margin-bottom: 1em;
        float: none;
        display: block;
        margin-left: 0;
        width: 100%;
    }

    .content .side-by-side {
        flex-direction: column;
        row-gap: 0.5em;
    }

    .writing ul {
        list-style: none;
        padding-left: 0;
    }

    .writing .section-header {
        text-align: center;
    }
}

/* SYNTAX HIGHLIGHTING */

.highlight .hll { background-color: lightblue; }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008000 } /* Keyword.Pseudo */
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #B00040 } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BA2121 } /* Literal.String */
.highlight .na { color: #7D9029 } /* Name.Attribute */
.highlight .nb { color: #008000 } /* Name.Builtin */
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0000FF } /* Name.Function */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #19177C } /* Name.Variable */
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #666666 } /* Literal.Number.Bin */
.highlight .mf { color: #666666 } /* Literal.Number.Float */
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sa { color: #BA2121 } /* Literal.String.Affix */
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0000FF } /* Name.Function.Magic */
.highlight .vc { color: #19177C } /* Name.Variable.Class */
.highlight .vg { color: #19177C } /* Name.Variable.Global */
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
.highlight .vm { color: #19177C } /* Name.Variable.Magic */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
