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

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    line-height: var(--lh-base);
    background: var(--bg);
    color: var(--text);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
    font: inherit;
    max-width: 100%;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 var(--space-3) 0;
    font-weight: 600;
    line-height: 1.2;
    font-family: var(--font-sans);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 13px; }

p {
    margin: 0 0 var(--space-3) 0;
}

main,
section,
article,
aside,
header,
footer,
nav,
form,
fieldset,
.panel,
.card {
    min-width: 0;
}

table {
    max-width: 100%;
}

th,
td {
    overflow-wrap: anywhere;
}

pre,
code,
.text-mono {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 17px; }

    input,
    select,
    textarea {
        width: 100%;
    }
}

::selection {
    background: rgba(37, 99, 235, 0.15);
}
