:root {
    --bg: #FCFCFC;

    --text: #0F1210;
    --text-muted: #3F4A43;

    --accent: #12A05C;

    --link: #1E4E8C;
    --link-hover: #2B63B8;
    --link-visited: #513A7A;

    --border: #D7D1C4;

    --body-max-width: 800px;

    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --base-size: 12pt;

    --line: 1.55;
    --space: 0.8em
}

/* Basic reset */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body{
    margin: 0;
    font-family: var(--font), sans-serif;
    font-size: var(--base-size);
    line-height: var(--line);
    color: var(--text);
    background: var(--bg);
    text-rendering: optimizeLegibility;

    display: grid;
    min-height: 100vh;
    grid-template-rows: auto 1fr auto;
}

img, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p { margin: var(--space) 0;}

/* Header reset (h1–h6): remove browser defaults, then rebuild deliberately */
h1, h2, h3, h4, h5, h6{
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
}

/* Minimal heading scale (optional but practical) */
h1, h2, h3, h4, h5, h6{
    font-weight: 550;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: calc(var(--space) * 1.25) 0 calc(var(--space) * 0.6);
}
h1{ font-size: 2.0rem; }
h2{ font-size: 1.6rem; }
h3{ font-size: 1.3rem; }
h4{ font-size: 1.15rem; }
h5{ font-size: 1.0rem; }
h6{ font-size: 0.9rem; letter-spacing: 0.02em; }

a {
    color: var(--link);
}

a:hover {
    color: var(--link-hover);
}

a:visited {
    color: var(--link-visited);
}

/* Header */
header {
    color: var(--text-muted);
    padding: 0.6em;
    border-bottom: 2px solid var(--accent);
    line-height: 38px;
}

header .homelink {
    font-size: 1.1em;
    font-weight: 550;
}

.header-menu {
    display: flex;
    justify-content: space-between;
}

header a {
    text-decoration: none;
    color: inherit;
}

header a:hover {
    text-decoration: underline;
    color: inherit;
}

header a:visited {
    color: inherit;
}

/* Navigation */

.nav-bar {
    position: absolute;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    right: 0.6em;
    text-align: right;
}

.triggered {
    display: none;
    clear: both;
}

.nav-trigger {
    display: none;
}

.nav-bar .menu-icon {
    float: right;
    width: 36px;
    height: 26px;
    line-height: 0;
    padding-top: 10px;
    text-align: center;
    cursor: pointer;
}

.nav-bar svg {
    display: inline;
}

.nav-bar .menu-icon svg path {
    color: var(--text-muted);
}

label[for=nav-trigger] {
    float: right;
    display: block;
    width: 36px;
    height: 36px;
}

.nav-trigger:checked ~ .triggered {
    display: block;
}

.nav-bar ul {
    list-style: none;
    margin: 0;
    padding: 0.3em 0.8em 0.6em 2em;
}

.nav-bar ul li {
    line-height: 2em;
}

@media (min-width: 800px) {
    .nav-bar {
        display: flex;
        position: relative;
        background-color: var(--bg);
        border: none;
        text-align: left;
    }

    label[for=nav-trigger] {
        display: none;
    }

    .triggered {
        display: flex;
    }

    .nav-bar ul {
        padding: 0;
    }

    .nav-bar li.nav-bar-item {
        display: inline-block;
        padding-left: 2em;
        line-height: inherit;
    }

    .nav-bar li.nav-bar-item.language-toggle {
        padding-left: 4em;
    }

    .nav-bar li.nav-bar-item.language-toggle a:hover {
        text-decoration: none;
    }
}

main {
    margin: 0 auto;
    max-width: 80ch;
}

.max-width {
    max-width: var(--body-max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--space);
}

.grayscale {
    filter: grayscale(100%);
}

code {
    display: inline-block;
    background: var(--border);
    padding: 0 0.3rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
}

/* Footer
 */

footer {
    border-top: 1px solid var(--border);
    height: 4em;
    padding-top: 1em;

    font-size: 0.8em;
}
