/* Fonts */
@font-face {
    font-family: 'Centima Mono';
    src: url('fonts/centima-mono-regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

/* Colours. Light is black on white, dark is soft grey. Change them here. */
:root {
    --text: #000;
    --background: #fff;
    --accent: #a8e306;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e6e6e6;
        --background: #1f1f1f;
        --accent: #a8e306;
    }
}

/* Page */
html {
    font-family: 'Centima Mono', ui-monospace, monospace;
    /* 18px normally (112.5% follows the browser's text size setting), shrinking
       on very narrow screens so words fit instead of breaking */
    font-size: max(8px, min(112.5%, 6.4vw));
    line-height: 1.5;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
}

/* Margins and sizes grow with the screen, so there are no breakpoints */
main {
    max-width: 64rem;
    margin: clamp(0.3rem, 2vw, 1.4rem) clamp(0.55rem, 3vw, 2.8rem);
}

/* Reset the browser defaults for headings, paragraphs and lists */
h1,
h2,
p,
ul {
    margin: 0;
}

h1,
h2 {
    font-size: inherit;
    font-weight: 400;
}

ul {
    padding: 0;
    list-style: none;
}

/* The name is the one big thing on the page */
h1 {
    margin-bottom: clamp(2rem, 6vw, 3rem);
    font-size: min(clamp(2.6rem, 7vw, 4.2rem), 15vw);
    line-height: 1;
    letter-spacing: -0.04em;
}

/* Each section: the label sits beside the content, and drops above it when
   there isn't room for both. */
section,
footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    padding: 0.9rem 0 1.4rem;
    border-top: 1px solid;
}

footer {
    row-gap: 0;
    padding-bottom: 0;
}

h2 {
    flex: 0 0 10rem;
}

/* Keeps the copyright line lined up with the section content */
footer::before {
    content: '';
    flex: 0 0 10rem;
}

section > :not(h2),
footer > p {
    flex: 1 1 22rem;
    min-width: 0;
}

/* Releases line up as a table: title, type, year. The columns size themselves. */
section > ul.releases {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: clamp(0.75rem, 3vw, 2rem);
}

.release {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
}

.release a {
    overflow-wrap: anywhere;
}

.year {
    text-align: right;
}

/* Links */
a {
    color: inherit;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent);
}

::selection {
    color: var(--background);
    background: var(--text);
}
