/* Nico's website. One stylesheet, no build step. */

/* The site is always dark, whatever the visitor's device is set to. */
:root {
    color-scheme: dark;
    --bg: #161616;
    --text: #e4e2dc;
    --muted: #9a9890;
    --rule: #333;
    --link: #8ab4f8;
    --visited: #c3a6f2;
    --select: #4a4326;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.6;
}

/* The column is centered on the page; the text inside it stays left-aligned. */
.page {
    max-width: 700px;
    margin: 60px auto;
    padding: 0 20px;
}

::selection { background: var(--select); }

/* Keyboard users: hidden until focused */
.skip { position: absolute; left: -10000px; }
.skip:focus { left: 20px; top: 12px; background: var(--bg); padding: 2px 6px; }

h1 { font-size: 30px; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 21px; line-height: 1.3; margin: 48px 0 10px; }
h3 { font-size: 17px; margin: 28px 0 2px; }

p, ul, ol, dl { margin: 0 0 16px; }

a { color: var(--link); text-underline-offset: 2px; }
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

/* Top of every page: name, then a line of links */
.site-name { margin: 0; font-weight: 600; }
.site-name a { color: inherit; text-decoration: none; }
.site-name a:hover { text-decoration: underline; }
.tagline { margin: 0; color: var(--muted); }

nav { margin: 14px 0 44px; }
nav a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: none; }

/* Inner pages (class "sub"): the links wrap in a row on small screens,
   and move into the left margin as a vertical list on wide ones.
   The text column stays centered either way. */
.page { position: relative; }
.sub nav { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.sub .site-name { padding-bottom: 8px; border-bottom: 1px solid var(--rule); }

@media (min-width: 1100px) {
    .sub header { position: absolute; top: 0; bottom: 0; right: 100%; width: 80px; margin-right: 20px; }
    .sub .site-name { position: sticky; top: 60px; }
    .sub nav { position: sticky; top: 100px; flex-direction: column; gap: 6px; margin: 14px 0 0; }
}

/* Lists */
ul, ol { padding-left: 1.3em; }
ul.arrows { list-style-type: "→  "; }
ul.plain { list-style: none; padding-left: 0; }
li { margin-bottom: 4px; }

/* Projects: the name stands out, the description sits back */
.projects li { color: var(--muted); margin-bottom: 8px; }
.projects strong { color: var(--text); font-weight: 600; margin-right: 6px; }

dt { font-weight: 600; margin-top: 12px; }
dd { margin: 0; color: var(--muted); }

.muted, time { color: var(--muted); }
.small { font-size: 15px; }

/* Notes index: date on the left, title on the right */
.notes li { display: flex; gap: 14px; }
.notes time { flex: 0 0 7.5em; font-size: 15px; line-height: 1.8; }

img, video { max-width: 100%; height: auto; }

/* Homepage: square photo on the left, as tall as the block from the name to the links */
.profile { display: flex; align-items: stretch; gap: 20px; margin-bottom: 44px; }
.profile nav { margin: 14px 0 0; }
.avatar { flex: none; align-self: flex-start; width: 137px; height: 137px; object-fit: cover; }
@media (max-width: 600px) { .avatar { width: 96px; height: 96px; } .profile { gap: 14px; } }

/* About page photo: small, to the right, text wraps around it */
.photo { float: right; width: 150px; margin: 6px 0 12px 24px; }
h2 { clear: both; }
video { display: block; margin: 8px 0 6px; background: #000; }

footer {
    margin-top: 64px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 600px) {
    .page { margin: 28px auto; }
    h1 { font-size: 27px; }
    h2 { margin-top: 38px; }
    nav { margin-bottom: 34px; }
}
