:root {
    --background: #fff8f1;
    --foreground: black;
    --accent: #07429b;
    --transparent: rgba(255, 128, 0, 0.06);
    --border: rgba(172, 166, 161, 0.87);
    --th-bg-color: #d9dbde;
    --th-b-color: #dee2e6;
    --inline-code: #d63384;
    --code-b: #e0e0e0;
    --code-bg: #fff8f2;
    --box-shadow: #ccc;
}

html[data-theme='dark'] {
    --background: #0b0e11;
    --foreground: #e6edf3;
    --accent: #58a6ff;
    --transparent: rgba(88, 166, 255, 0.1);
    --border: rgba(48, 54, 61, 0.8);
    --th-bg-color: #161b22;
    --th-b-color: #21262d;
    --inline-code: #95d7ff;
    --code-b: #30363d;
    --code-bg: #10151c;
    --box-shadow: #010409;
}

* {
    box-sizing: border-box;
    border: 0;
    padding: 0;
}

body {
    font-family: "et-book", Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    min-height: 100vh;
    max-width: 65rem;
    margin: 0 auto;
    letter-spacing: 0.05em;
    padding: 3vh 1.2rem 2rem;
    background-color: var(--background);
    color: var(--foreground);
}

footer {
    font-family: "et-book", Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    font-variant: small-caps;
    font-size: 1rem;
    text-align: center;
    margin-top: 3rem;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 2.3rem;
    font-style: italic;
}

h3 {
    font-size: 1.6rem;
    font-style: italic;
}

h1, h2, h3 {
    font-weight: 400;
    line-height: 1;
}

p, ul, ol {
    font-size: 1.3rem;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    padding-left: 1.8em;
}

table {
    font-size: 1.2rem;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    text-align: justify;
    box-shadow: 0 2px 8px 2px var(--box-shadow);
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

th, td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--th-b-color);
    border-right: 2px solid var(--th-b-color);
}

th {
    background-color: var(--th-bg-color);
    border-bottom: 2px solid var(--th-b-color);
    border-right: 2px solid var(--th-b-color);
}

tr:last-child td {
    border-bottom: none;
}

th, td:last-child{
    border-right: none;
}

thead {
    font-weight: bold;
    font-variant: small-caps;
}

code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.8em;
    color: var(--inline-code);
    border: 1px solid var(--code-b);
    word-break: break-word;
    overflow-wrap: break-word;
}

img {
    display: block;
    margin: auto;
    width: 80%;
    border-radius: 8px;
}

pre {
    margin: 0;
    padding: 0;
    overflow-x: auto;
    tab-size: 2;
    font-family: monospace;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px 2px var(--box-shadow);
    border-radius: 8px;
}

pre code.hljs {
    background-color: var(--code-bg);
}

.navbar {
    display: flex;
    align-items: center;
    font-variant: small-caps;
    margin-top: 1.2rem;
    margin-bottom: 4rem;
    font-size: 1.3rem;
}

.post-meta {
    font-variant: small-caps;
    font-size: 0.9rem;
    opacity: 0.7;
}

.custom-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.element {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    padding: 1.2rem 0;
}

.element-logo {
    width: 3rem;
    height: 3rem;
}

.project-logo {
    width: 4rem;
    height: 4rem;
}

.element-logo, .project-logo {
    pointer-events: none;
    margin: 0;
}

.element-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.element-title {
    font-variant: small-caps;
    font-weight: bold;
}

.banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}

.banner h1 {
    font-variant: small-caps;
}

.banner p {
    font-style: italic;
}

.banner-logo {
    pointer-events: none;
    width: 200px;
    height: 200px;
    margin: 0;
}

#logo {
    background: url("/icons/logo.svg") no-repeat center 0;
    background-size: 48px 48px;
    background-position: center;
    height: 58px;
    width: 70px;
}

#navbar-title {
    text-decoration: none;
    font-variant: small-caps;
    font-weight: bold;
    font-size: 2.3rem;
}

#theme-btn, #theme-reset-btn {
    color: var(--foreground);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
}

@media (max-width: 670px) {
    .banner {
        justify-content: center;
        text-align: center;
    }

    .banner p {
        font-size: 1rem;
    }

    img {
        width: 100%;
    }
}

@media (max-width: 470px) {
    .custom-grid {
        grid-template-columns: 1fr;
    }

    .element-title {
        font-size: 0.9rem;
    }

    #navbar-links {
        font-size: 1rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    table {
        font-size: 0.9rem;
        text-align: center;
    }

    td {
        padding: 12px 0;
    }

    .katex-display, .katex-html {
        font-size: 1.3rem;
    }
}
