@import "variables.css";

html {
    box-sizing: border-box;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg);
    background-image: radial-gradient(
        color-mix(in srgb, var(--rule) 30%, transparent) 10%,
        transparent 10%
    );
    background-size: 12px 12px;
    background-attachment: fixed;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}
*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--fg);
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.72;
}

/* App shell: the top bar never moves. `main` claims whatever height is left
   and hands it to whichever page is routed in — each page decides for itself
   which of its own parts are static chrome and which part scrolls. */
main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

main > * {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--f-display);
    font-weight: 600;
    letter-spacing: 0.005em;
    line-height: 1.1;
}

a {
    color: var(--link);
}
a:hover {
    color: var(--link-hover);
}

/* ---- fenced code ----
   The spans come from src/highlight/mod.rs, so they live outside the css
   modules and are matched globally. Inline `code` is never highlighted. */

pre code .hl-com {
    color: var(--syn-comment);
    font-style: italic;
}
pre code .hl-kw {
    color: var(--syn-keyword);
    font-weight: 500;
}
pre code .hl-ty {
    color: var(--syn-type);
}
pre code .hl-fn {
    color: var(--syn-function);
}
pre code .hl-str {
    color: var(--syn-string);
}
pre code .hl-num {
    color: var(--syn-number);
}
pre code .hl-const {
    color: var(--syn-const);
}
pre code .hl-attr {
    color: var(--syn-attr);
}
pre code .hl-prop {
    color: var(--syn-prop);
}

/* Css has no type names to compete with, so its selectors take the type ink
   and its functions step aside — leaving the blue to say "property". */
pre code.language-css .hl-fn {
    color: var(--syn-type);
}

.green {
    color: green;
}
.blue {
    border-radius: 5px;
    background-color: #0070bb;
    color: white;
    border: 2px solid black;
}

.content {
    box-sizing: border-box;
    margin-left: var(--sidebar-width);
}

h1 {
    text-align: center;
    font-size: 4rem;
}

h2 {
    text-decoration: underline;
    font-size: 2rem;
}

.post {
    max-width: 90%;
    font-size: 1.5rem;
    isolation: isolate;
}

.container {
    width: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-width);
    padding: 20px;
    background: radial-gradient(var(--bg), transparent);
    p {
        font-size: 1.2rem;
    }
}

/* Phone Styles */
@media (max-width: 600px) {
    h1 {
        font-size: 3.2rem;
    }

    h2 {
        font-size: 2rem;
    }

    .container {
        padding: 20px;
        margin: 0;
    }
}
