:root {

    /* Colors */
    --ash: #333333;
    --rikyu-grey: #8C867B;
    --aku: #BCB09C;
    --desert-glare: #E6D7BE;
    --twilight: #FF7952;

    --charcoal: #232323;

    /* Theme - Color Palette */
    /* ... */

    /* Theme - Fonts */
    --default-font: "Noto Sans", sans-serif;
    --header-font: "DMSans", sans-serif;
    --body-font: "Noto Sans", sans-serif;
    --mono-font: "IBM Plex Mono", sans-serif;

    /* Theme - Primary Styles */
    --fg-color:var(--ash);
    --bg-color:var(--aku);
    --shadow-color:var(--rikyu-grey);
    --highlight-color:var(--desert-glare);
    --accent-color:var(--twilight);

    /* Theme - Heading Styles */
    --h1-font-size:58px;
    --h1-font-weight:800;
    --h1-line-height:1.6;
    --h1-char-spacing:-0.03em;

    --h2-font-size:31px;
    --h2-font-weight:800;
    --h2-line-height:1.6;
    --h2-char-spacing:-0.03em;

    --h3-font-size:20px;
    --h3-font-weight:800;
    --h3-line-height:1.6;
    --h3-char-spacing:-0.03em;

    --header-padding:16px;

    /* Theme - Paragraph Styles */
    --paragraph-font-size: 20px;
    --paragraph-line-height: 32px;
    --paragraph-break:20px; /* line-height - space (6px both ways) */
    --paragraph-header-break: 28px;

    /* Theme - Math Text Styles */

    /* Theme - Code Text Styles */
    --code-fg:var(--aku);
    --code-bg:var(--ash);
    --code-padding:4px;
    --code-line-height:1;

    /* Theme - Selection (Highlight) Styles */
    --selection-fg:var(--ash);
    --selection-bg:var(--twilight);
    --selection-border:var(--twilight);

    /* Theme - Link Styles */
    --link-fg-default:var(--ash);
    --link-fg-hover:var(--rikyu-grey);

    /* Theme - Notes */
    --note-fg: var(--aku);
    --note-bg: var(--ash);
    --note-border: var(--aku);
}

*
{
    margin:0;
    padding:0;

    font-family:var(--default-font);
}

html, body
{
    height:100%;
}

body
{
    background-color: var(--bg-color);
    color: var(--fg-color);
}

/* Highlights */
::selection
{
    background-color:var(--selection-bg);
    color:var(--selection-fg);
    border:1px solid var(--selection-border);
}

::-moz-selection
{
    background-color:var(--selection-bg);
    color:var(--selection-fg);
    border:1px solid var(--selection-border);
}

/* Links */
a
{
    color: var(--link-fg-default);
    transition: 0.35s color;

    word-wrap:break-word;
}

a:hover
{
    color: var(--link-fg-hover);
    transition: 0.25s color;
}

/* Headings */
h1, h2, h3, h4
{
    font-family:var(--header-font);
    cursor:default;
}

h1
{
    font-size:var(--h1-font-size);
    font-weight:var(--h1-font-weight);
    line-height:var(--h1-line-height);
    letter-spacing:var(--h1-char-spacing);
}

h2
{
    font-size:var(--h2-font-size);
    font-weight:var(--h2-font-weight);
    line-height:var(--h2-line-height);
    letter-spacing:var(--h2-char-spacing);
}

h3
{
    font-size:var(--h3-font-size);
    font-weight:var(--h3-font-weight);
    line-height:var(--h3-line-height);
    letter-spacing:var(--h3-char-spacing);
}

/* Paragraphs */
p
{
    font-family:var(--body-font);
    font-size:var(--paragraph-font-size);
    font-weight:400;
    line-height:var(--paragraph-line-height);

    max-width:80ch;
    min-width:40ch;
}

p + p
{
    margin-top:var(--paragraph-break);
}

p + h1, p + h2, p + h3
{
    margin-top:var(--paragraph-header-break);
}

/* Lists */
ol, ul
{
    list-style-position:inside;
}

ol li, ul li
{
    font-size:var(--paragraph-font-size);
    line-height:var(--paragraph-line-height);

    padding-top:calc(0.6 * var(--paragraph-font-size));
    padding-bottom:calc(0.6 * var(--paragraph-font-size));
    padding-left:2ch;
    padding-right:2ch;
}

/* Icon */
img.icon
{
    display:inline-block;
    width:64px;
    height:64px;
}

/* Notes */
span.note
{
    cursor: help;
    position:relative;
    border-bottom:2px dotted var(--ash);
}

span.note span.popup, span.note span.hidden
{
    display:none;
}

span.note:hover span.popup
{
    display:block;
    position:absolute;

    top:100%;
    left:0%;

    color:var(--note-fg);
    background-color:var(--note-bg);

    font-size: 16px;
    line-height: 1.6;

    max-width: 80ch;
    min-width: 40ch;
    width:100%;

    border:1px solid var(--note-border);

    z-index:100;

    padding-left:2ch;
    padding-right:2ch;
    padding-top:1.4ch;
    padding-bottom:1.4ch;
}

/* Math */
span.math
{
    cursor:text;

    background-color:var(--code-bg);
    color:var(--code-fg);

    font-family:var(--mono-font);
    line-height:1.6;

    padding-top:-2px;
    padding-bottom:4px;
    padding-left:6px;
    padding-right:6px;

    white-space: nowrap;

    transition:color 0.35s;
}

span.math:hover
{
    transition:color 0.25s;
}

/* Code */
span.code
{
    cursor:text;

    background-color:var(--code-bg);
    color:var(--code-fg);

    border-radius:0px;

    font-family:var(--mono-font);
    line-height:var(--code-line-height);

    padding-left:var(--code-padding);
    padding-right:var(--code-padding);

    white-space: nowrap;

    transition:color 0.35s;
}

span.code:hover
{
    transition:color 0.25s;
}

div.code-block
{
    white-space: pre-line;

    background-color:var(--ash);
    color:var(--aku);

    padding-left:2ch;
    padding-bottom:20pt;
}

p + div.code-block, div.code-block + p
{
    margin-top:var(--paragraph-font-size);
}

/* Email */
span.email
{
    background-color:var(--code-bg);
    color:var(--code-fg);

    line-height:var(--code-line-height);

    padding-left:var(--code-padding);
    padding-right:var(--code-padding);

    white-space: nowrap;
}

/* Callout */
p.callout
{
    border-left:6px solid var(--ash);
    padding-left:2ch;
}

/* Social Media Icon */
img.social-icon
{
    aspect-ratio: 1/1;
    width:38px;
    height:38px;
}

/* Main */
.main
{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;

    width:100%;
    min-width:80ch;

    margin-top:1in;
    margin-bottom:0.5in;

    justify-content: center;
}

/* Article - Core */
.main .article
{
    max-width:80ch;
    width:100%;
}

.article section
{
    max-width:80ch;
    width:100%;
}

/* Article - Header */
.article > #header div.title
{
    display:block;

    font-size:var(--h1-font-size);
    font-weight:600;
    line-height:1.4;

    margin-bottom:16pt;
}

.article > #header div.author-info
{
    display:block;
    font-size:var(--paragraph-font-size);
    line-height:var(--paragraph-line-height);
}

.article > #header
{
}

/* Article - Metadata */
.article > #header #article-metadata
{
    font-size:var(--paragraph-font-size);
    line-height:var(--paragraph-line-height);
}

/* Article - Section Headings */ 
.article > section h1:first-child
{
    display:block;
    background-color:var(--fg-color);
    color:var(--bg-color);

    padding-top:5px;
    padding-bottom:3px;

    padding-left:var(--header-padding);
    padding-right:var(--header-padding);
}

.article > section h1:first-child + p
{
    margin-top: 17px;
}

.article > section h2:first-child
{
    display:block;
    background-color:var(--shadow-color);
    color:var(--fg-color);
    border:1px solid var(--fg-color);
    
    padding-top:4px;
    padding-bottom:2px;

    padding-left:var(--header-padding);
    padding-right:var(--header-padding);
}

.article > section h2:first-child + p
{
    margin-top: 15px;
}

.article section h3
{
    display:block;
    border:1px solid var(--fg-color);
    
    padding-top:1px;
    padding-bottom:2px;

    padding-left:var(--header-padding);
    padding-right:var(--header-padding);

    transition:background-color 0.35s;
}

.article > section h3 + p
{
    margin-top:10px;
}

.article section:hover > h3:first-child
{
    transition: background-color 0.25s;
}

/* Article - Paragraphs */
.article p
{
    cursor: default;
    transition: text-shadow 0.35s, color 0.35s;
}

.article section p:hover
{
    text-shadow:0 0 12px #E6D7BE1A;
    color:var(--charcoal);
    transition: text-shadow 0.25s, color 0.25s;
}

section + section, section + p, p + section
{
    margin-top:var(--paragraph-break);
}

/* Article - Figures */
.article div.figure
{
    font-size:var(--body-font);
    
    max-width:80ch;
    min-width:40ch;
    width:100%;
}

.article div.figure + p, .article p + div.figure
{
    margin-top:var(--paragraph-font-size);
}

.article div.figure img
{
    cursor:pointer;
    aspect-ratio: 16 / 9;
    object-fit: cover;

    width:100%;
    outline:1px dotted var(--fg-color);
}
.article div.figure span.caption
{
    display:block;
    font-size:16px;
}

div.figure img.patent-figure
{
    object-position: center 40%;
}

/* Header */
body > div.header
{
    position:fixed;
    top:0;

    display:flex;
    flex-direction:row;
    flex-wrap:wrap;

    width:100%;
    min-width:80ch;

    padding-top:16px;
    padding-bottom:16px;
    
    justify-content: center;

    background-color:var(--aku);

    z-index:1001;
}

div.header div.content
{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;

    width:100%;

    color:var(--aku);

    max-width:60vw;
    min-width:80ch;
    width:100%;

    justify-content: space-between;
    align-items: center;
}

div.header div.content span.menu
{
    font-size:var(--paragraph-font-size);
    line-height: var(--paragraph-line-height);
    color:var(--ash);
}

/* Footer */
div.footer
{
    position:static;
    
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    
    background-color:var(--ash);

    width:100%;
    min-width:80ch;

    padding-top:0.5in;
    padding-bottom:0.5in;

    justify-content: center;
}

div.footer div.content
{
    color:var(--aku);
    min-width:80ch;
    max-width:60vw;
    width:100%;
}

div.footer div.content span.row
{
    display:flex;
    justify-content: space-between;
    align-items: baseline;
}

div.footer .footer-icon
{
    aspect-ratio: 1/1;
    width:64px;
    height:64px;
}

div.footer div.content span.links
{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;

    width:100%;

    border-top:1px solid var(--rikyu-grey);
    
    padding-top:var(--paragraph-font-size);
    margin-top:var(--paragraph-font-size);

    align-items: center;
    justify-content: space-between;
}

div.footer div.content span.links a
{
    color:var(--rikyu-grey);
    text-decoration:none;
}

span.links a img.social-icon
{
    width:32px;
    height:32px;
}

div.footer div.content span.links a:hover
{
    color:var(--desert-glare);
}

div.footer div.content span.links a + a
{
    margin-left:2ch;
}

/* Specifics */
h1.code
{
    font-family:var(--mono-font);
}

/* Overlay Modal */
div.overlay
{
    position:fixed;
    top:0;
    left:0;

    display:flex;
    flex-direction:row;
    flex-wrap:wrap;

    justify-content: center;
    align-items:flex-start;

    width:100%;
    height:100%;

    background-color:rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);

    z-index:1002;
}

div.overlay span.modal
{
    display:block;

    height:auto;
    width:100%;
    max-width:80ch;
    min-width:40ch;

    margin-top:33.33vh;

    background-color:var(--aku);
    color:var(--ash);
}

div.overlay span.modal div.header
{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;

    align-items:center;
    background-color:var(--ash);
    color:var(--aku);

    height:auto;
    width:100%;
    max-width:80ch;
    min-width:40ch;
    
    padding:0;
    padding-top:2px;
    padding-bottom:2px;
    margin:0;

    border:1px solid var(--aku);
    box-sizing:border-box;
}

span.modal div.header span.title
{
    display:inline-flex;
    align-items:center;
    
    flex:6;
    left:0;

    font-family: var(--header-font);
    font-size:var(--paragraph-font-size);
    font-weight:400;
    line-height:1;

    padding-left:6px;
    padding-right:6px;
    padding-top:3px;
    padding-bottom:3px;
}

span.modal div.header span.controls
{
    flex:4;
    text-align:right;

    padding-right:2px;
}

span.modal div.header span.controls span.escape
{
    display:inline-flex;
    align-items:center;
    cursor: pointer;

    font-family: var(--mono-font);
    line-height:1.2;

    background-color:var(--aku);
    color:var(--ash);
    border:1px solid var(--rikyu-grey);

    padding-top:0;
    padding-right:7px;
    padding-bottom:3.5px; /* why did this cause a visible change that 4 and 3 didn't */
    padding-left:7px;

    margin:3px;

    transition: color 0.35s, border 0.35s, background-color 0.35s;
}

span.modal div.header span.controls span.escape:hover
{
    background-color:var(--rikyu-grey);
    color:var(--aku);
    border:1px solid var(--aku);

    transition: color 0.25s, border 0.25s, background-color 0.35s;
}

span.modal span.content
{
    display:block;

    padding-top:0.25in;
    padding-bottom:0.25in;
    padding-left:0.25in;
    padding-right:0.25in;
}

span.modal span.content div.prompts
{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;

    justify-content: center;

    width:100%;
    height:auto;

    margin-top:var(--paragraph-font-size);
}

span.modal span.content div.prompts span.button
{
    display:inline-block;

    cursor: pointer;

    color:var(--aku);
    border:1px solid var(--aku);

    padding-left:1.6ch;
    padding-right:1.6ch;
    padding-top:1ch;
    padding-bottom:1ch;
}

div.overlay span.modal div.prompts span.button:nth-child(odd)
{
    background-color:var(--aku);
    color:var(--ash);
    border:1px solid var(--ash);

    transition: color 0.35s, background-color 0.35s, border 0.35s;
}

div.overlay span.modal div.prompts span.button:nth-child(odd):hover
{
    background-color:var(--rikyu-grey);
    color:var(--aku);
    border:1px solid var(--rikyu-grey);

    transition: color 0.25s, background-color 0.25s, border 0.25s;
}