:root {
    --linkedin-blue: #0077B5;
    --strava-orange: #fc5200;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--base);
}

@media screen and (max-width: 600px) {
    html {
        font-size: 112.5%;
    }
}

@media (prefers-reduced-motion) {
    html {
        scroll-behavior: auto;
    }
}

body {
    width: clamp(200px, calc(100vw - 2 * (var(--space-m) + 8px)), 968px);
    margin: auto;

    color: var(--text);
    font-family: "InterVariable", ui-sans-serif, system-ui, "Helvetica", sans-serif;
    font-size: var(--body-m);

    display: grid;
    grid-template-columns: 1fr 4fr 1fr;
}

@media screen and (max-width: 600px) {
    body {
        grid-template-columns: 1fr;
    }
}

a {
    color: inherit;
    text-decoration: underline dotted var(--subtext);
}

a:hover {
    text-decoration: underline;
}

nav {
    height: fit-content;
    position: sticky;
    top: var(--space-xxl);
}

@media screen and (max-width: 600px) {
    nav {
        position: static;
        margin-top: var(--space-xxl);
    }
}

ul, menu {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

nav a {
    color: var(--subtext);
    text-decoration: none;
}

nav a:hover, nav a.active {
    color: var(--text);
    text-decoration: none;
}

nav a.active::before {
    content: "⏺︎";
    position: absolute;
    left: calc(-1 * var(--body-l));
}

@media screen and (max-width: 600px) {
    nav a.active::before {
        position: static;
        margin-right: var(--body-xs);
    }
}

nav h1 {
    margin-top: 0;
    font-size: inherit;
}

nav h1 a {
    color: var(--text);
}

section {
    padding-top: var(--space-xxl);
}

h2 {
    margin-top: 0;
    margin-bottom: var(--space-m);
}

.mail-link {
    color: var(--subtext);
}

.mail-link:hover {
    color: var(--text);
}

a:has(svg) {
    text-decoration: none;
    margin-right: var(--space-xs);
}

a:has(svg):hover {
    text-decoration: none;
}

a svg {
    height: var(--body-l);
    fill: var(--subtext);
}

a svg:hover {
    fill: var(--text);
}

#instagram-svg:hover {
    fill: url(#instagram-gradient);
}

#linkedin-svg:hover {
    fill: var(--linkedin-blue);
}

#letterboxd-svg:hover {
    fill: url(#letterboxd-gradient);
}

#strava-svg:hover {
    fill: var(--strava-orange);
}

#work .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-m);
}

@media screen and (max-width: 600px) {
    #work .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-s);
    }
}

#work a {
    line-height: 0;
}

#work img:hover {
    opacity: 0.8;
}

img {
    max-width: 100%;
}

#writing li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-m);
    margin: var(--space-m) 0;
}

#writing time {
    font-size: var(--body-s);
    color: var(--subtext);
}

footer {
    margin: var(--space-xxl) 0;
    font-size: var(--body-s);
    color: var(--subtext);
}

footer * {
    margin: 0;
}
