/* Explain: Global styles and animated background color gradient for the entire page. */
* {
    box-sizing: border-box;
}

html {
    background: var(--background-color);
    color: var(--text-color);
    /* The whole site is set one step larger. Every size on the page is measured
       from this one root, so lifting it by a fifth grows the lettering, the
       logos, and the spacing together by exactly twenty per cent and keeps every
       proportion between them intact. */
    font-size: 120%;
    scroll-padding-top: 76px;
    /* Sideways overflow is clipped rather than hidden, so the page itself never
       turns into its own little scroll box. */
    overflow-x: clip;
}

body {
    margin: 0;
    /* `clip` keeps anything sticking out sideways off the page without making
       the body a scroll container of its own. With `hidden` the body becomes a
       second scroller, and on some phones that makes the page stick partway down
       instead of carrying on to the footer — clipping avoids that completely, so
       the page always scrolls freely to the very bottom. */
    overflow-x: clip;
    isolation: isolate;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* The painting palette carried as one continuous field down the whole page:
       it opens on the matte black of the intro, then drifts slowly through the
       collection's hues — crimson, violet, blue, magenta, cobalt, crimson-green,
       gold and orange — before easing back to black at the foot. Because the
       colour lives on the page itself rather than in a block per section, one
       section's hue melts into the next with no seam and no hard edge. */
    background-color: var(--background-color);
    background-image: linear-gradient(
        180deg,
        #040404 0%,
        #040404 8%,
        #080c06 14%,
        #0e0a03 21%,
        #0e0902 28%,
        #0d0502 34%,
        #0d0206 41%,
        #080512 47%,
        #040a15 53%,
        #040915 60%,
        #09030e 65%,
        #0a040e 72%,
        #030712 79%,
        #0c0206 86%,
        #060605 93%,
        #040404 100%
    );
    background-repeat: no-repeat;
}

img {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
}

button,
a,
summary {
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 300;
    letter-spacing: -0.02em;
}

::selection {
    background: var(--accent-color);
    color: #000000;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #111111;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

/* The colour field breathes. Over the continuous base wash sit two soft pools of
   the collection's hues — crimson, blue, green, magenta, orange and violet —
   and each pool gathers and eases back on its own long, offset cycle. Because
   the two layers never rise together, the colour underneath keeps surfacing and
   sinking: one hue drifts up out of the dark, holds faintly, and melts away as
   the next gathers somewhere else along the page. The tints are deliberately
   light so the movement only ever reads as the background quietly changing
   colour, never as bands or hard lines. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(120% 62% at 16% 12%, rgba(111, 168, 46, 0.12) 0%, rgba(111, 168, 46, 0) 60%),
        radial-gradient(120% 62% at 84% 38%, rgba(46, 107, 230, 0.11) 0%, rgba(46, 107, 230, 0) 62%),
        radial-gradient(124% 62% at 22% 70%, rgba(193, 18, 31, 0.11) 0%, rgba(193, 18, 31, 0) 62%),
        radial-gradient(132% 70% at 78% 92%, rgba(122, 63, 176, 0.10) 0%, rgba(122, 63, 176, 0) 64%);
    background-repeat: no-repeat;
    opacity: 0;
    animation: nd-hue-breathe-a 54s ease-in-out infinite;
    will-change: opacity;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(120% 62% at 80% 10%, rgba(232, 112, 30, 0.11) 0%, rgba(232, 112, 30, 0) 60%),
        radial-gradient(120% 62% at 18% 44%, rgba(194, 30, 122, 0.10) 0%, rgba(194, 30, 122, 0) 62%),
        radial-gradient(128% 66% at 70% 76%, rgba(46, 107, 230, 0.11) 0%, rgba(46, 107, 230, 0) 64%),
        radial-gradient(132% 68% at 30% 96%, rgba(111, 168, 46, 0.10) 0%, rgba(111, 168, 46, 0) 66%);
    background-repeat: no-repeat;
    opacity: 0;
    animation: nd-hue-breathe-b 54s ease-in-out infinite;
    will-change: opacity;
}

/* The two layers rise on their own uneven rhythms so a hue is always somewhere
   between appearing and fading — colour is never switched on all at once. */
@keyframes nd-hue-breathe-a {
    0%, 100% { opacity: 0; }
    32% { opacity: 0.78; }
    50% { opacity: 1; }
    68% { opacity: 0.62; }
}

@keyframes nd-hue-breathe-b {
    0% { opacity: 0; }
    22% { opacity: 0.86; }
    46% { opacity: 0.34; }
    74% { opacity: 0.9; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
        opacity: 0.55;
    }

    body::after {
        animation: none;
        opacity: 0.4;
    }
}

/* Phones hold the two pools of colour still. They are full-screen washes lying
   behind the entire page, and re-blending them frame after frame on a handset
   keeps the whole view reworking itself non-stop — a large part of why the
   mobile page stuttered and eventually fell over. The same hues are still
   there, resting at a steady strength. */
@media (max-width: 767px) {
    body::before {
        animation: none;
        opacity: 0.62;
    }

    body::after {
        animation: none;
        opacity: 0.46;
    }
}