/* The home page: a pinned card on the left whose photo cycles, the text on the right. It shares its fonts and base colours with the posts, which carry their own styles. */
:root {
  --bg: #fcfcfb; --panel: #ffffff; --fg: #0b0b0b; --muted: #5f5e5a; --line: #e2e1dc; --soft: #f1f0ec; --link: #0f766e; --select: #c9ece7;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
/* Dark colours: when the system asks for them and nobody chose light, or when the toggle chose dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1a1a19; --panel: #222221; --fg: #f0efec; --muted: #b0afa6; --line: #3a3a37; --soft: #2a2a28; --link: #5fd0c4; --select: #1f5c56; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #1a1a19; --panel: #222221; --fg: #f0efec; --muted: #b0afa6; --line: #3a3a37; --soft: #2a2a28; --link: #5fd0c4; --select: #1f5c56; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16.5px/1.65 var(--body); }
/* Links and selected text are teal. */
::selection { background: var(--select); color: var(--fg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.page { position: relative; max-width: 1040px; margin: 0 auto; padding: 72px 24px 40px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 72px; align-items: start; }

/* The light/dark toggle, top right. It shows the sun in dark mode and the moon in light mode. */
.theme { position: absolute; top: 20px; right: 24px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s; }
.theme:hover { color: var(--fg); border-color: var(--muted); }
.theme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: block; }
  :root:not([data-theme="light"]) .theme .moon { display: none; }
}

/* The card. */
.card { position: sticky; top: 48px; }
.photo { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--soft); cursor: pointer; border: 0; padding: 0; display: block; width: 100%; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
/* The new photo fades in on top of the one before it, which stays put underneath, so the frame is never half empty. */
.photo img.prev { opacity: 1; z-index: 1; }
.photo img.on { opacity: 1; z-index: 2; }
.dots { display: flex; gap: 6px; margin-top: 12px; }
.dots button { width: 22px; height: 3px; padding: 0; border: 0; border-radius: 2px; background: var(--line); cursor: pointer; transition: background .3s; }
.dots button.on { background: var(--fg); }
h1 { font: 600 40px/1.05 var(--display); letter-spacing: -0.02em; margin: 22px 0 0; }
.role { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.45; }
.role a { color: inherit; }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--fg); transition: background .2s, color .2s, border-color .2s, transform .2s; }
.social a:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); transform: translateY(-2px); }
.social svg { width: 19px; height: 19px; fill: currentColor; }

/* Languages and interests, under the icons: the label above its line, in the same small capitals as the section labels. */
.side { margin: 24px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.side div { margin-top: 14px; }
.side dt { font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.side dd { margin: 0; font-size: 14.5px; line-height: 1.45; }

/* The text column. */
.label { font: 500 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 20px; display: flex; align-items: center; gap: 14px; }
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lead { font: 400 25px/1.4 var(--display); letter-spacing: -0.005em; margin: 0 0 22px; }
.about p { margin: 0 0 18px; }
/* Now / Topic / Soon: plain rows between hairlines, in the same small capitals as the section labels. No box. */
.facts { margin: 30px 0 60px; border-bottom: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); }
.facts dt { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 15.5px; line-height: 1.45; }

/* The post card: the post's own hero animation on top (it has its own pause button), the linked text below. */
.post { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; transition: border-color .2s; }
.post:hover { border-color: var(--muted); }
.post iframe { display: block; width: 100%; height: 230px; border: 0; border-bottom: 1px solid var(--line); }
.post a { display: block; padding: 20px 22px 22px; color: inherit; }
.post a:hover { text-decoration: none; }
.post time { font: 400 13px/1 var(--mono); color: var(--muted); }
.post h3 { font: 500 23px/1.22 var(--display); margin: 8px 0 8px; letter-spacing: -0.01em; }
.post p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.post .more { display: inline-block; margin-top: 12px; font-size: 14.5px; color: var(--link); }
/* A post that is not out yet: no link, and bars where its title will be. */
.post.soon:hover { border-color: var(--line); }
.post.soon .body { padding: 20px 22px 22px; }
.post.soon .when { font: 400 13px/1 var(--mono); color: var(--muted); }
.post.soon h3 { margin: 12px 0 14px; }
.post.soon .bar { display: block; height: 20px; margin-bottom: 8px; border-radius: 3px; background: var(--fg); opacity: .82; }

/* Education: one row per degree, the years in the left column like the labels of the rows above. */
.edu { margin-top: 60px; }
.degrees { list-style: none; margin: 0; padding: 0; }
.degrees > li { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); }
.degrees > li:first-child { border-top: 0; padding-top: 0; }
.degrees .when { font: 400 13px/1 var(--mono); color: var(--muted); }
.degrees h3 { font: 500 20px/1.25 var(--display); letter-spacing: -0.005em; margin: 0; }
.degrees p { margin: 6px 0 0; font-size: 15.5px; line-height: 1.55; }
.degrees p.where { color: var(--muted); }
/* links to the redacted documents: small capitals at the right end of the degree's last line, beside the grade */
.degrees > li > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: baseline; }
.degrees > li > div > * { grid-column: 1 / -1; }
.degrees > li > div > p:nth-child(3) { grid-column: 1; }
.degrees p.docs { grid-column: 2; grid-row: 3; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.docs a { color: var(--muted); }
.docs a:hover { color: var(--fg); text-decoration: none; }
.docs a::after { content: " ↗"; }
.docs-note { margin: 4px 0 0; padding: 14px 0 0 96px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

footer { max-width: 1040px; margin: 0 auto; padding: 24px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 820px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; }
  .card { position: static; }
  .photo { max-width: 260px; }
  .lead { font-size: 22px; }
  .degrees > li { grid-template-columns: 1fr; gap: 8px; }
  .docs-note { padding-left: 0; }
  .degrees > li > div { grid-template-columns: minmax(0, 1fr); }
  .degrees p.docs { grid-column: 1; grid-row: auto; margin-top: 10px; }
}
/* On a short window the pinned card would not fit, and its last lines would stay cut off: let it scroll with the page. */
@media (max-height: 760px) { .card { position: static; } }
@media (prefers-reduced-motion: reduce) { .photo img { transition: none; } }
