:root {
    --bg: #ffffff;
    --surface-muted: #e8e8e8;
    --text: #1d1d1b;
    --muted: #6b6b6b;
    --danger: #dc3545;
    --max-width: 950px;
    --content-width: 75ch;
    --narrow-width: 720px;
}

@font-face {
    font-family: "U8";
    src: url("/fonts/U8-Light-web.woff") format("woff");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "U8";
    src: url("/fonts/U8-Bold-web.woff") format("woff");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

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

html,
body,
h1,
h2,
h3,
p,
ul,
ol {
    margin: 0;
}

ul,
ol {
    padding: 0;
}

/* Base */
body {
    background: var(--bg);
    color: var(--text);
    font-family: "U8", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
}

.container {
    max-width: var(--max-width);
    margin-inline: auto;
    padding: 4rem 1.5rem 6rem;
}

/* Branding */
.x-logo,
.x-logo-h1 {
    font-family: "U8", sans-serif;
    font-size: 3rem;
    font-weight: 700;
}

.x-logo {
    line-height: 0.2;
    vertical-align: text-top;
}

.x-logo-h1 {
    line-height: 0.35;
    vertical-align: text-bottom;
}

.x-reg,
.x-reg-h1 {
    font-family: "U8", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 0.35;
}

.x-reg {
    vertical-align: super;
}

.x-reg-h1 {
    vertical-align: text-top;
}

/* Page title */
.page-title {
    margin: 0;
}

.page-title span {
    display: block;
}

.page-title span:first-child {
    padding-bottom: 1.5rem;
    font-family: "U8", sans-serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 0.2;
    vertical-align: text-top;
}

.page-title span:nth-child(2),
.page-title span:nth-child(3) {
    padding-bottom: 0.5rem;
    font-size: 0.85em;
}

/* Headings */
h1 {
    margin-bottom: 0.75rem;
    font-family: "U8", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}

h2,
.normalcase {
    margin: 3.5rem 0 1.25rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
}

h3 {
    margin: 3.5rem 0 1.25rem;
    padding-left: 4.5em;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: left;
}

.normalcase {
    font-weight: 400;
    text-transform: none;
}

.x-heading-line {
    display: block;
    margin-bottom: 0.5rem;
}

.x-heading-line:last-child {
    margin-bottom: 0;
}

.x-newlogo {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    text-transform: none;
}

.x-registered {
    position: relative;
    top: -0.75rem;
    margin-left: 0.1em;
    font-size: 1rem;
    font-weight: 400;
    line-height: 0;
}

.x-homepage-h1 {
    font-size: 1.5rem;
}

.x-homepage-h1-smaller {
    font-size: 1.25rem;
}

.h1-divider {
    width: 48px;
    height: 2px;
    margin: 0.5rem auto 2rem;
    background-color: var(--text);
}

.subtitle {
    max-width: 42rem;
    margin: 0 auto 2rem;
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    hyphens: none;
}

/* Content */
p {
    max-width: var(--content-width);
    margin: 0 auto 1.25rem;
    font-size: 1rem;
    text-align: justify;
    hyphens: auto;
}

pre {
    padding: 1em 0 2em;
    text-align: center;
}

.GIFooter {
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
}

.sub {
    font-size: 0.8em;
    vertical-align: sub;
}

/* Navigation */
.nav-top,
.nav-bottom {
    display: flex;
    justify-content: center;
    background: var(--surface-muted);
}

.nav-top {
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
}

.nav-bottom {
    padding: 1rem 0;
}

.nav-top .nav-links,
.nav-bottom ul {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-top .nav-links a,
.nav-bottom a {
    color: var(--text);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.nav-top .nav-links a:hover,
.nav-top .nav-links a:focus-visible,
.nav-bottom a:hover,
.nav-bottom a:focus-visible {
    text-decoration: underline;
}

/* The first top-navigation link changes colour without an underline. */
.nav-top .nav-links > li:first-child > a:hover,
.nav-top .nav-links > li:first-child > a:focus-visible,
.nav-logo-link:hover,
.nav-logo-link:focus-visible {
    color: var(--muted);
    text-decoration: none;
}

.nav-top .nav-links > li:first-child > a:hover .x-logo,
.nav-top .nav-links > li:first-child > a:hover .x-reg {
    color: inherit;
    text-decoration: none;
}

/* Links */
.x-link,
.c-link {
    color: var(--text);
    border-radius: 4px;
    text-decoration: none;
    hyphens: none;
}

.x-link {
    font-weight: 700;
}

.c-link {
    padding: 8px 16px;
    font-size: 0.95rem;
}

.x-link:hover,
.x-link:focus-visible,
.c-link:hover,
.c-link:focus-visible {
    text-decoration: underline;
}

a[href^="mailto:"],
a.sales-email {
    padding: 5px 10px;
    color: var(--text);
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
}

a[href^="mailto:"] {
    background-color: var(--surface-muted);
}

a.sales-email {
    background-color: var(--danger);
}

/* Academic index */
.index-section {
    max-width: var(--narrow-width);
    margin: 4rem auto;
    padding: 0 1rem;
    text-align: left;
}

.index-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 3rem;
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
}

.index-list.two-column {
    display: block;
    column-count: 2;
    column-gap: 3rem;
}

.index-list li {
    margin: 0.35rem 0;
    break-inside: avoid;
    line-height: 1.5;
}

.index-list a {
    color: var(--text);
    font-size: 0.95rem;
    text-decoration: none;
}

.index-list a:hover,
.index-list a:focus-visible {
    text-decoration: underline;
}

/* Glossary */
.glossary dl {
    max-width: var(--narrow-width);
    margin: 1.25rem auto;
    padding-left: 1.2rem;
}

.glossary dt {
    margin: 1rem auto;
    padding-left: 1.2rem;
    font-weight: 700;
}

.glossary dd {
    padding-left: 3rem;
}

/* Policy lists */
.policy-body ul,
.policy-body ol {
    max-width: var(--narrow-width);
    margin: 1.25rem auto;
    padding-left: 1.2rem;
    list-style-position: outside;
}

.policy-body li {
    margin: 0.35rem 0;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.55;
}

.policy-body h2 + ul {
    margin-top: 0.75rem;
}

.policy-body ul li::marker {
    color: var(--muted);
}

/* Utilities */
.center-align {
    text-align: center;
}

.justify-align {
    text-align: justify;
}

.left-align {
    text-align: left;
}

.right-align {
    text-align: right;
}

.indent {
    padding-left: 70px;
}

.no-hyphen {
    hyphens: none;
}

.x-no-hover:hover,
.x-no-hover:focus-visible {
    text-decoration: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-top,
    .nav-bottom {
        align-items: center;
        flex-direction: column;
    }

    .nav-top {
        gap: 1rem;
    }

    .nav-top .nav-links,
    .nav-bottom ul {
        align-items: center;
        flex-direction: column;
        gap: 0;
    }

    .index-list {
        grid-template-columns: 1fr;
    }

    .index-list.two-column {
        column-count: 1;
    }

    h3 {
        padding-left: 0;
        text-align: center;
    }
}
