:root {
    --color-white: #fff;
    --color-black: #000;
    --color-navy: #002f4d;
    --color-cyan: #007977;
    --color-teal: #00a3a1;

    --font-sans:
        'XenoisSoftPro', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
        'Noto Sans', 'Liberation Sans', sans-serif;
    --font-slab: 'XenoisSlabPro', 'Roboto Slab', 'RobotoSlab', 'Roboto-Slab', serif;

    --page-gutter: clamp(1.5rem, 8vw - 1.5rem, 3rem);
    --page-max-width: 1320px;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.375;
    color: var(--color-black);
    background: var(--color-white);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-slab);
    font-weight: 400;
    line-height: 1.2;
    overflow-wrap: break-word;
    hyphens: auto;
}

a {
    text-decoration-skip-ink: auto;
    text-decoration-thickness: 0.075rem;
    text-underline-offset: 0.3125rem;
}

:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.container {
    width: min(100% - 2 * var(--page-gutter), var(--page-max-width));
    margin-inline: auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Hero (homepage) */

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--color-white);
    background: var(--color-white);
}

.hero__background {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    container-type: size;
    pointer-events: none;
}

/* Clipped to the circle the viewport can ever see, so the rotating layer stays small. */
.hero__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 145cqmax;
    height: 145cqmax;
    width: calc(hypot(100cqw, 100cqh) * 1.02);
    height: calc(hypot(100cqw, 100cqh) * 1.02);
    translate: -50% -50%;
    overflow: hidden;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.hero__spinner--stars-bottom {
    animation-duration: 240s;
}

.hero__spinner--stars-top {
    mix-blend-mode: multiply;
    animation-duration: 150s;
    animation-direction: reverse;
}

.hero__stars {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(5.5 * min(100cqw, 100cqh));
    max-width: none;
    height: calc(5.5 * min(100cqw, 100cqh));
    translate: -50% -50%;
}

.hero__overlay {
    position: absolute;
    top: -80%;
    left: -90%;
    width: 250%;
    max-width: none;
    height: 160%;
    object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
    .hero__spinner {
        animation-name: spin;
    }
}

@keyframes spin {
    to {
        rotate: 360deg;
    }
}

.hero__container {
    display: grid;
    grid-template-rows: 1fr auto auto;
    row-gap: 2rem;
    padding-block: 1.5rem 1rem;
}

.hero__main {
    display: grid;
    align-items: center;
}

.hero__headline {
    max-width: 12em;
    padding-top: clamp(3rem, 20vh, 10rem);
    font-size: clamp(2rem, 1rem + 3.5vw, 3.75rem);
    hyphens: manual;
    text-wrap: balance;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem 3rem;
}

/* Only where there is spare height; otherwise the hero outgrows the viewport and the background shifts. */
@media (min-height: 50rem) {
    .hero__actions {
        padding-bottom: 1.5rem;
    }
}

@media (min-width: 48rem) and (min-height: 40rem) {
    .hero__actions {
        padding-bottom: clamp(1.5rem, 8vh, 5rem);
    }
}

/* Button */

.button {
    display: inline-block;
    padding: 1rem 2rem;
    border: 2px solid currentColor;
    font-size: 1.25rem;
    color: inherit;
    text-decoration: none;
    transition:
        background-color 0.2s ease-in-out,
        color 0.2s ease-in-out;
}

.button:hover,
.button:focus-visible {
    background: var(--color-white);
    color: var(--color-navy);
}

/* Publishers */

.publishers__label {
    margin-bottom: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
}

.publishers__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2.5rem;
}

.publishers__link {
    display: block;
    color: inherit;
}

.publishers__logo {
    width: auto;
    height: 2.5rem;
}

/* Footer */

.footer {
    padding-block: 1rem;
    font-size: 0.875rem;
    color: var(--color-white);
    background: var(--color-navy);
}

.footer--transparent {
    padding-block: 0;
    background: none;
}

.footer__credits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.footer__link {
    color: inherit;
}

/* Legal pages */

.legal-header {
    padding-block: 1.5rem;
}

.legal-header__logo {
    width: clamp(10rem, 8rem + 6vw, 14rem);
    height: auto;
}

.legal {
    width: min(100% - 2 * var(--page-gutter), 50rem);
    margin-inline: auto;
    padding-block: 3rem 4rem;
}

.legal__headline {
    margin-bottom: 2rem;
    font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.legal__toc {
    margin-bottom: 3rem;
}

.legal__toc-headline {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.legal__toc-list {
    display: grid;
    gap: 0.25rem;
}

.legal__section {
    margin-top: 3rem;
    scroll-margin-top: 1.5rem;
}

.legal__section-headline {
    margin-bottom: 1rem;
    font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

.legal__section :is(h3, h4) {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal__section h3 {
    font-size: 1.5rem;
}

.legal__section h4 {
    font-size: 1.25rem;
}

.legal__section p,
.legal__section ul {
    margin-bottom: 1rem;
}

.legal__section ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.legal a {
    color: var(--color-cyan);
}
