@import '/css/fonts.css';

/* Large screen */
@media (min-width: 769px) {
    html {
        font-size: 20px;
        --menu-box-width: 20%;
        --logo-width: 80px;
    }
}

/* Tablet screen */
@media (max-width: 768px) {
    html {
        font-size: 18px;
        --pad: 20px;
        --menu-box-width: 100%;
        --logo-width: 60px;
    }
}

/* Mobile screen */
@media (max-width: 450px) {
    html {
        font-size: 18px;
        --menu-box-width: 100%;
        --logo-width: 50px;
    }
}

:root {
    /* Color: primary */
    --dark: #002d28;
    --light: #f2f2f2;
    --blue: #005f73;
    --light-blue: #c1e0de;

    --pad: 2rem;
    --edge-gap: clamp(16px, 3vw, 24px);
    --size-large: 1.85rem;
    --size-small: 1.2rem;

    --maxwidth-body: 1400px;
    --maxwidth-text: 750px;

    --web-name-size: 54px;
    --footer-sections: 5rem;
    --toggle-margin: calc(0.55 * var(--logo-width));

    --margin-left: calc((100vw - var(--maxwidth-text)) * 0.5);

    --flap-width: 350px;
    --width: 80%;

    --height-cover: 82.5vh;

    /* Fonts: primary */
    --serif: 'Gentium';
    --sans: 'ClashDisplay';
    --mono: 'SpaceMono';
}


@media (min-width: 1025px) {
    :root {
        --maxwidth-text: 50vw;
    }
}

@media (max-width: 1024px) {
    :root {
        --size-large: 1.6rem;
        --size-small: 1rem;
        --maxwidth-body: 100%;
        --maxwidth-text: 60%;
        --web-name-size: 46px;
        --height-cover: 50vh;
    }
}

@media (max-width: 820px) {
    :root {
        --maxwidth-text: 80%;
    }
}

@media (max-width: 640px) {
    :root {
        --pad: 20px;
        --size-large: 1.6rem;
        --maxwidth-text: none;
        --margin-left: 2rem;
        --height-cover: 30vh;
        --footer-sections: 2rem;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html {
    width: 100vw;
    min-height: 100vh;
    -webkit-text-size-adjust: none;
    scroll-behavior: smooth;
    display: block;
    overflow-x: hidden;
}


body {
    margin: 0;
    padding: 0;
    font-family: var(--serif);
    color: var(--dark);
    background-color: var(--light);
    display: block;
    overflow-x: hidden;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: calc(0.1 * var(--pad)) var(--edge-gap) 1rem;
    z-index: 100;
    display: block;
    background-color: var(--light);
    transform: translateY(0);
    transition: transform 0.25s ease-in-out;
}

header.header-hidden {
    transform: translateY(-100%);
}

main {
    margin-top: 6rem;
    padding-top: 3rem;
    padding-bottom: 6rem;
}

@media (max-width: 640px) {
    main {
        padding: var(--pad);
    }
}

.home main {
    width: 100%;
    display: block;
    position: relative;
}

@media (max-width: 640px) {
    .home main {
        padding: 0;
    }
}

@media (max-width: 1024px) {
    .home main {
        flex-direction: column;
    }
}

main.post .content {
    padding-bottom: 0;
    position: relative;
    max-width: none;
}

.post section {
    max-width: var(--maxwidth-text);
    margin: auto;
}

figure {
    font-family: var(--sans);
    margin: auto;
    padding: var(--pad) 0;
}

@media screen and (max-width: 1300px) {
    .home .corightver figure {
        background-size: auto 100%;
        background-position: calc(100% - 22vw);
    }
}

img {
    width: 100%;
    display: block;
}

.home .right img {
    height: auto;
    object-fit: contain;
}

.toc {
    max-width: var(--maxwidth-text);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1024px) {
    .toc {
        padding-left: var(--pad);
        padding-right: var(--pad);
    }
}

.toc figcaption {
    width: 100%;
    text-align: right;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--blue);
    padding-top: 12px;
    padding-bottom: 12px;
    position: relative;
}

.toc a {
    color: var(--blue);
}

@media (max-width: 640px) {
    .toc figcaption {
        right: 0px;
    }
}

.web-sections ul,
.web-sections li,
.toc ul,
.toc li {
    list-style: none;
    padding: 0;
}

.toc li {
    padding: 1.5rem 0;
}

.toc a {
    text-decoration: none;
}

.article-date {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--blue);
    padding-bottom: 0.9rem;
}

.toc h1 {
    font-family: var(--sans);
    font-size: 1.5rem;
    line-height: 1.2;
    display: inline-block;
    max-width: 50rem;
    padding-bottom: 0.6rem;
}

.article-description {
    font-family: var(--serif);
    font-weight: normal;
    color: var(--blue);
}

.left {
    width: var(--flap-width);
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    font-family: var(--sans);
    font-weight: 400;
    font-size: 1rem;
    background-color: var(--blue);
    padding: var(--pad);
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .left {
        position: static;
        height: auto;
        width: 100%;
        min-width: 100%;
        order: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: calc(1.5 * var(--pad));
    }
}

.web-name h1 {
    text-align: left;
    font-family: var(--mono);
    font-size: var(--web-name-size);
    font-weight: normal;
    color: var(--light);
    margin: auto;
    position: relative;
}

@media (max-width: 1024px) {
    .web-name h1 {
        font-size: var(--web-name-size)
    }

}

.web-description {
    font-family: var(--serif);
    font-size: 0.9rem;
    color: var(--light);
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .web-description {
        position: relative;
        margin-top: 0.5rem;
        margin-block-end: 0;
        bottom: auto;
    }
}

.web-sections {
    font-family: var(--sans);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--light);
    margin-top: 2rem;
    line-height: 2.5rem;
}

.web-sections a.section-link {
    color: var(--light);
    text-decoration: none;
}

.web-sections a.section-link:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .web-sections li {
        display: inline;
        margin-right: 2rem;
    }
}

.web-author p {
    font-family: var(--sans);
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--light);
    position: absolute;
    bottom: var(--pad);
}

@media (max-width: 1024px) {
    .web-author {
        display: none;
    }
}

.opener {
    color: var(--blue);
    padding: 0;
    position: relative;
    max-width: calc(var(--maxwidth-text) * 1.1);
    margin-left: var(--margin-left);
}

@media (max-width: 1024px) {
    .opener {
        left: 0;
        max-width: var(--maxwidth-text);
    }
}

@media (max-width: 640px) {
    .opener {
        margin-left: auto;
    }
}

nav {
    display: block;
}

div {
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--sans);
    font-weight: bold;
    color: var(--blue);
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 25px;
}

p {
    font-size: 1rem;
    font-weight: normal;
    z-index: 1;
}

main.post .content h2,
main.post .content h3,
main.post .content h4,
main.post .content p,
main.post .content blockquote,
main.post .content ol,
main.post .content ul,
main.post .content .code,
main.post .content .line {
    width: var(--maxwidth-text);
    margin-left: auto;
    margin-right: auto;
}

.menu {
    position: fixed;
    transition: top 0.5s;
    z-index: 200;
}

.menu-container {
    background-color: var(--blue);
    width: 0vw;
    height: 100vh;
    top: 0;
    left: 0;
    position: fixed;
    z-index: -100;
    transition: width 0.5s;
}

@media (min-width: 1025px) {
    .menu-container.open {
        width: calc(100% - 420px);
        padding: 2rem;
        padding-top: 5rem;
        padding-left: calc(2rem + 40px);
        transition: width 0.5s;
    }
}

@media (max-width: 1024px) {
    .menu-container.open {
        width: 100vw;
        padding: 2rem;
        padding-top: 5rem;
        padding-left: 2rem;
        transition: width 0.5s;
    }
}

.top-box {
    background-color: var(--light);
    top: -200px;
    left: 0rem;
    width: 100%;
    height: 5rem;
    display: block;
    position: fixed;
    z-index: -100;
    transition: top 0.7s;
}

.nav-links {
    font-size: var(--size-large);
    font-family: var(--sans);
    font-weight: bold;
    color: var(--light);
    position: fixed;
    visibility: hidden;
    opacity: 0;
    z-index: 200;
    cursor: auto;
    transition: visibility 0s, opacity 0.2s linear;
}

.nav-links.open {
    visibility: visible;
    opacity: 1;
}


.nav-link {
    color: var(--light);
    line-height: 3rem;
    padding: 1rem;
    text-decoration-line: none;
    cursor: auto;
}

.nav-link:hover {
    color: var(--dark);
    text-decoration: none;
    cursor: pointer;
}

.nav-footer {
    font-size: var(--size-small);
    font-family: var(--sans);
    font-weight: bold;
    color: var(--light);
    white-space: nowrap;
    padding: 1rem;
    bottom: 3rem;
    position: absolute;
    visibility: hidden;
    opacity: 0;
    z-index: 200;
    cursor: auto;
    transition: visibility 0s, opacity 0.2s linear;
}

.nav-footer.open {
    visibility: visible;
    opacity: 1;
}

.menu-toggle {
    cursor: pointer;
    width: 2rem;
    position: fixed;
    top: -100px;
    left: var(--pad);
    z-index: 100;
    transform: rotate(0) translateY(0);
    transition: top 0.5s;
}


.line1,
.line2,
.line3 {
    background-color: var(--blue);
    height: 3px;
    margin-bottom: 6px;
    transition: 0.2s;
    z-index: 300;
}

.line1.open {
    background-color: var(--light);
    transform: rotate(45deg) translate(6px, 6px);
}

.line2.open {
    opacity: 0;
}

.line3.open {
    background-color: var(--light);
    transform: rotate(-45deg) translate(7px, -7px);
}

.about {
    font-family: var(--mono);
    color: var(--blue);
    margin-top: -0.5rem;
}

a {
    color: var(--blue);
    text-decoration-line: underline;
    text-underline-offset: 0.2rem;
    text-decoration-color: var(--blue);
}

a:hover {
    color: var(--blue);
    text-decoration: none;
}

/* Top buttons on right column */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

/* Push the right-side buttons to the far right while keeping home-btn on the left */
.top-nav .nav-right {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
}

.home-btn {
    display: inline-block;
    font-family: var(--mono);
    font-size: 2rem;
    color: var(--blue);
    background: none;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    vertical-align: baseline;
}

.home-btn:hover {
    color: var(--blue);
}

/* Home logo styling inside the top nav link */
.home-logo {
    height: 3.5rem;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.btn {
    display: inline-block;
    font-family: var(--mono);
    color: var(--blue);
    background: none;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    vertical-align: baseline;
}

.btn:hover {
    color: var(--blue);
    text-decoration-line: underline;
    text-underline-offset: 0.2rem;
    text-decoration-color: var(--blue);
}

@media (max-width: 480px) {
    .home-btn {
        font-size: 1.35rem;
        padding: 8px 10px;
    }

    .top-nav .btn {
        font-size: 1rem;
        padding: 8px 10px;
    }

    .top-nav .nav-right {
        gap: 0.4rem;
    }

    main {
        margin-top: 5rem;
    }
}

@media (max-width: 335px) {
    .home-btn {
        font-size: 1.1rem;
    }

    .nav-right {
        font-size: 0.9rem;
    }
}

.profile-card {
    width: 100%;
}

.left .profile-card {
    margin-top: calc(var(--pad) * 6);
}

.left .profile-meta {
    color: var(--light);
}

.left .profile-link {
    color: var(--light);
    text-decoration-color: var(--light);
}

.left .dot {
    color: var(--light);
}

.profile-figure {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 16px;
    position: relative;
    padding: 0;
}

@media (max-width: 1024px) {
    .profile-card {
        display: flex;
        align-items: flex-end;
        gap: calc(0.75 * var(--pad));
        max-width: var(--maxwidth-text);
        margin: 0 auto;
        padding: 0 var(--pad);
    }

    .profile-figure {
        width: 150px;
        margin: 0;
        flex-shrink: 0;
    }

    .profile-meta {
        margin-top: 0;
    }
}


.profile-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.profile-meta {
    margin-top: 0.5rem;
    font-family: var(--mono);
    color: var(--blue);
}

.profile-links {
    margin: 0.25rem 0 0;
}

.profile-link {
    color: var(--blue);
    text-decoration: underline;
}

.profile-link:hover {
    text-decoration: none;
}

.profile-email {
    color: var(--blue);
}

.dot {
    margin: 0 0.4rem;
}

.intro-text {
    font-family: var(--mono);
    color: var(--blue);
    max-width: var(--maxwidth-text);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--pad);
    padding-right: var(--pad);
}

@media (max-width: 1024px) {
    .profile-card {
        margin-bottom: 2.5rem;
    }

    .intro-text {
        margin-top: 2.5rem;
        margin-bottom: 2.5rem;
    }
}

.intro-text h2 {
    margin-top: 0;
}

.intro-text p+p {
    margin-top: 1.25rem;
}

/* Center the main content column on home */
.home .home-page {
    max-width: calc(var(--maxwidth-text) + 260px + 2rem);
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1025px) {
    .home .home-page {
        display: grid;
        grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
        column-gap: 3rem;
        row-gap: 2.5rem;
        align-items: start;
    }

    .home .home-page .toc {
        grid-column: 1 / -1;
    }
}

.intro h2 {
    margin-bottom: 0.5rem;
}

.intro p {
    margin-top: 0.6rem;
}

.sup-footnote {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--blue);
    padding: 0.1rem;
    margin: 0.1rem;
    border-style: solid;
    border-width: thin;
    border-color: var(--blue);
    border-radius: 0.2rem;
    cursor: pointer;
}

.footnote {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: normal;
    position: absolute;
    margin-left: -3rem;
    margin-top: 1.3rem;
    padding: 14px 20px;
    border-radius: 4px;
    border: 1px solid var(--blue);
    /* box-shadow: 5px 5px 8px var(--light); */
    background-color: var(--light);
    z-index: 100;
    visibility: hidden;
    cursor: auto;
}

.sup-footnote:hover span {
    visibility: visible;
}

.footnote.clicked {
    visibility: visible;
}

hr {
    border: 0.1px solid var(--dark);
}

blockquote {
    max-width: var(--maxwidth-text);
    margin: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    background: var(--light);
    border-left: 0.2rem solid var(--blue);
    color: var(--blue);
    box-sizing: border-box;
}

.blockquote-text {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1rem;
}

.logo-divider {
    width: 1.7rem;
    display: block;
    margin: 1.5rem auto 1rem;
    transition: transform 1s;
}

.logo-divider:hover {
    transform: rotate(180deg);
    transition: 1s;
}

.footer {
    padding: 0;
}

.footer-divider {
    padding-bottom: 1rem;
}

.sections {
    max-width: var(--maxwidth-text);
    margin-left: var(--footer-sections);
    margin-right: var(--footer-sections);
    margin-bottom: 0;
    padding: 0;
    text-align: center;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: bold;
    color: var(--blue);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    position: relative;
    z-index: 700;
}

.section {
    margin-left: 3rem;
    margin-right: 3rem;
}

a.section {
    color: var(--blue);
    text-decoration-line: none;
}

.comments {
    font-family: var(--mono);
    font-style: italic;
    text-align: center;
    color: var(--blue);
    margin-bottom: 2rem;
}

.comments>a {
    color: var(--blue);
    text-decoration-color: var(--blue);
}