/* Font */
@font-face {
    font-family: "juxtacloud futura";
    src: url("/font/futura-regular-book.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "juxtacloud futura";
    src: url("/font/futura-bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Tokens */
:root {
    --font-sans: "juxtacloud futura", "Futura", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --text-xs: 0.8rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.25rem;
    --text-xl: 1.563rem;
    --text-2xl: 1.953rem;
    --text-3xl: 2.441rem;
    --text-4xl: 3.052rem;

    --color-text: #1a1d23;
    --color-muted: #5b6270;
    --color-bg: #ffffff;
    --color-surface: #f3f5f8;
    --color-border: #d9dde4;
    --color-link: #8d1938;
    --color-link-hover: #691229;

    --measure: 65ch;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-text: #e8eaee;
        --color-muted: #a0a7b4;
        --color-bg: #12141a;
        --color-surface: #1c1f27;
        --color-border: #333845;
        --color-link: #8d1938; /* TODO: figure out alternatives cuz this is almost unreadable */
        --color-link-hover: #af1e45;
    }
}

/* Default */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    color-scheme: light dark;
}

html {
    background: var(--color-bg);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin: 2em 0 0.5em;
    text-wrap: balance;
}
h1 {
    font-size: var(--text-4xl);
    letter-spacing: -0.02em;
    margin-top: 0;
}
h2 {
    font-size: var(--text-3xl);
    letter-spacing: -0.015em;
}
h3 {
    font-size: var(--text-2xl);
}
h4 {
    font-size: var(--text-xl);
}
h5 {
    font-size: var(--text-lg);
}
h6 {
    font-size: var(--text-base);
}

@media (max-width: 600px) {
    h1 {
        font-size: var(--text-3xl);
    }
    h2 {
        font-size: var(--text-2xl);
    }
    h3 {
        font-size: var(--text-xl);
    }
}

/* Body Text */
p,
ul,
ol,
dl,
blockquote,
pre,
table,
figure {
    margin: 0 0 1.25em;
}
p,
li,
dd,
blockquote {
    max-width: var(--measure);
}

.lead {
    font-size: var(--text-lg);
    line-height: 1.5;
    color: var(--color-muted);
}
.small,
small {
    font-size: var(--text-sm);
}
.caption {
    font-size: var(--text-xs);
    color: var(--color-muted);
}
.muted {
    color: var(--color-muted);
}

strong,
b {
    font-weight: 700;
}
em,
i {
    font-style: italic;
}

mark {
    background: #ffe58a;
    color: #1a1d23;
    padding: 0 0.2em;
    border-radius: 2px;
}
sub,
sup {
    font-size: 0.75em;
    line-height: 0;
}
abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}
del {
    text-decoration: line-through;
    color: var(--color-muted);
}

/* Links */
a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}
a:hover {
    color: var(--color-link-hover);
    text-decoration-thickness: 2px;
}
a:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Lists */
ul,
ol {
    padding-left: 1.5em;
}
li {
    margin-bottom: 0.35em;
}
li > ul,
li > ol {
    margin: 0.35em 0 0;
}
dt {
    font-weight: 700;
}
dd {
    margin: 0 0 0.75em;
    color: var(--color-muted);
}

/* Quotes */
blockquote {
    padding: 0.25em 0 0.25em 1.25em;
    border-left: 3px solid var(--color-border);
    font-size: var(--text-lg);
    color: var(--color-muted);
}
blockquote footer,
cite {
    font-size: var(--text-sm);
    font-style: normal;
}

/* Code */
code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}
code,
kbd {
    background: var(--color-surface);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}
kbd {
    border: 1px solid var(--color-border);
}
pre {
    background: var(--color-surface);
    padding: 1em 1.25em;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
}
pre code {
    background: none;
    padding: 0;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    font-size: var(--text-sm);
}
th,
td {
    text-align: left;
    padding: 0.6em 0.9em;
    border-bottom: 1px solid var(--color-border);
}
th {
    font-weight: 700;
}

/* Buttons */
.button {
    display: inline-block;
    font: 700 var(--text-base)/1 var(--font-sans);
    padding: 0.85em 1.5em;
    color: #fff;
    background: var(--color-link);
    border: 0;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
}
.button:hover {
    background: var(--color-link-hover);
    color: #fff;
}
.button:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 3px;
}
.button--secondary {
    background: transparent;
    color: var(--color-link);
    box-shadow: inset 0 0 0 2px var(--color-link);
}
.button--secondary:hover {
    background: var(--color-surface);
    color: var(--color-link-hover);
}

/* Helpers */
.container {
    max-width: 52rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* Misc */
hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 2.5em 0;
}
