/* One narrow, left-aligned column of text, like a well-kept homepage.
   Colour comes only from the links; everything else is ink on wheat paper. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-ground);
  color: var(--c-ink);
  font: 400 var(--fs-body)/1.6 var(--f-text);
  font-optical-sizing: auto;
}
::selection { background: var(--c-mark); }

.page {
  max-width: calc(var(--measure) + 2 * 20px);
  padding: clamp(40px, 10vh, 96px) 20px 64px;
}
@media (min-width: 900px) { .page { margin-left: 12vw; } }

h1 { font-size: var(--fs-name); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-body); font-weight: 600; margin: 0 0 .75rem; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
/* Each block starts with a hairline rule. In two columns the first rules of both columns sit on one line. */
section, .project { margin-top: var(--gap); padding-top: var(--rule-space); border-top: 1px solid var(--c-rule); }
.cols { margin-top: var(--gap); }
.cols .col > section:first-child { margin-top: 0; }
/* Home page sections sit on slightly darker panels instead of hairlines.
   The panel reaches a little past the text on both sides, so the text stays aligned with the header above. */
.page > .cols > .col > section {
  background: color-mix(in srgb, var(--c-ink) 4%, var(--c-ground));
  border-top: 0; border-radius: 8px;
  margin-inline: -1rem; margin-top: 1rem; padding: var(--rule-space) 1rem;
}
.page > .cols > .col > section:first-child { margin-top: 0; }
/* On narrow screens the two columns stack: same gap between them as between panels. */
@media (max-width: 999.98px) { .page > .cols > .col + .col { margin-top: 1rem; } }

/* Links: always coloured and underlined, so they read as links. */
a { color: var(--c-link); text-decoration: underline; text-decoration-color: var(--c-link-line); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; border-radius: 2px; }
/* Links inside text (organisations, project titles, links in descriptions) keep the text colour;
   the underline is enough. Contact links, "All … and details" and project links stay in the link colour. */
.rows a, .skill-list a, .edu a, .project > p:not(.project__meta) a { color: inherit; }
.rows a:hover, .skill-list a:hover, .edu a:hover, .project > p a:hover { color: var(--c-link); }

.intro { max-width: 34rem; }

/* Home header: name, intro and links on the left, portrait on the right.
   On phones the portrait stays beside the name and the intro runs full width beneath. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name photo" "intro photo" "links photo"; column-gap: 2rem; align-items: start; }
.hero__name { grid-area: name; }
.hero__intro { grid-area: intro; }
.hero__links { grid-area: links; }
.hero__photo { grid-area: photo; width: var(--photo-size); height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; background: var(--c-rule); }
.hero__photo[hidden] { display: none; }
.muted, .row__note, .project__meta, .back { color: var(--c-muted); }

/* Links row under the intro */
.links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: 1rem; }
.links a { overflow-wrap: anywhere; }

/* Dated rows: years in a narrow left column */
.rows { display: grid; gap: .6rem; }
.row { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 1rem; }
.row__years { color: var(--c-muted); font-size: var(--fs-small); padding-top: .15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row__title { font-weight: 600; }
.row__note { font-size: var(--fs-small); margin-top: .1rem; }

.more { margin-top: 1rem; }

/* Projects page */
.back { font-size: var(--fs-small); margin-bottom: 2rem; }
.back a { color: inherit; text-decoration-color: var(--c-rule); }
.project h2 { font-size: 22px; margin-bottom: .1rem; }
.project__meta { font-size: var(--fs-small); margin-bottom: .5rem; }
.project .links { margin-top: .5rem; }

details { margin-top: var(--gap); border-top: 1px solid var(--c-rule); padding-top: var(--rule-space); }
summary { cursor: pointer; font-weight: 600; width: fit-content; padding-block: .25rem; }
summary:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }
details[open] summary { margin-bottom: .75rem; }

/* Skills: a plain wrapped list, comma-separated by CSS */
.tags { display: flex; flex-wrap: wrap; row-gap: .1rem; }
.tags li:not(:last-child)::after { content: ",\00a0"; }
.details--inline { margin-top: .75rem; border-top: 0; padding-top: 0; }
.details--inline summary { font-weight: 400; color: var(--c-link); text-decoration: underline; text-decoration-color: var(--c-link-line); text-underline-offset: 3px; }
.details--inline[open] summary { margin-bottom: .25rem; }
.details--inline .tags { color: var(--c-muted); }

/* Skill groups use the same left column as the dated rows, so everything lines up. */
.skills { display: grid; gap: .5rem; }
.skills__row { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 1rem; }
.skills__group { color: var(--c-muted); font-size: var(--fs-small); padding-top: .15rem; }
.details--inline .skills { margin-top: .5rem; }
.details--inline + .more { margin-top: .5rem; }

/* A button that looks like the page's links (used for "Open all / Close all"). */
.page-intro { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; }
.text-button { font: inherit; color: var(--c-link); background: none; border: 0; padding: .5rem 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--c-link-line); text-decoration-thickness: 1.5px; text-underline-offset: 3px; min-height: 44px; }
.text-button:hover { text-decoration-color: currentColor; }
.text-button:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; border-radius: 2px; }

/* Skills page: one line per skill. Skills with details open in place; plain ones line up with them. */
.skill-list { display: grid; gap: .6rem; }
details.skill { margin-top: 0; border-top: 0; padding-top: 0; }
.skill > summary { font-weight: 400; padding-block: .15rem; cursor: pointer; }
.skill > summary::marker { color: var(--c-link); }
.skill > summary:hover { color: var(--c-link); }
.skill[open] > summary { margin-bottom: .25rem; }
.skill > p { color: var(--c-muted); font-size: var(--fs-small); padding: 0 0 .5rem 1.1rem; max-width: 34rem; }
.skill--plain { padding: .15rem 0 .15rem 1.1rem; }

/* Small icons before names. .icon: one-colour, takes the muted text colour. .logo: organisation logo in colour. */
.icon, .logo { display: inline-block; width: 1em; height: 1em; margin-right: .4em; vertical-align: -.14em; flex: none; }
.icon { background-color: var(--c-muted); mask: center / contain no-repeat; -webkit-mask: center / contain no-repeat; }
.logo { border-radius: 3px; object-fit: contain; }
/* Don't leave a lone word on the last line of a row. */
.row > div, .edu h3 { text-wrap: pretty; }

/* Section links at the top of the home page on narrow screens.
   One line that stays at the top while scrolling. Any section with an id can be linked. */
.jump {
  position: sticky; top: 0; z-index: 1;
  display: flex; gap: 1.25rem; overflow-x: auto; scrollbar-width: none;
  padding: 0 20px; background: var(--c-ground); border-bottom: 1px solid var(--c-rule);
  font-size: var(--fs-small); white-space: nowrap;
}
.jump::-webkit-scrollbar { display: none; }
.jump a { padding: .7rem 0; color: var(--c-ink); text-decoration: none; }
.jump a:hover, .jump a:focus-visible { color: var(--c-link); text-decoration: underline; }
/* Home icon: back to the top of the page. Wider tap area than the icon itself. */
.jump .jump__home { display: flex; align-items: center; padding-inline: .25rem; margin-left: -.25rem; }
.jump__home svg { display: block; }
/* Leave room for the bar when a link scrolls to a section. */
section[id], footer[id] { scroll-margin-top: 3rem; }
@media (min-width: 1000px) { .jump { display: none; } }

/* Home page on wide screens: sections split into two columns under the intro.
   Left: work and projects. Right: skills, volunteering, achievements. */
@media (min-width: 1000px) {
  .page--wide { max-width: calc(2 * var(--measure) + var(--col-gap) + 2 * 20px); margin-inline: auto; }
  .page--wide > :not(.cols, .hero) { max-width: var(--measure); }
  /* The header uses the same two columns as the sections, so the portrait lines up with the right column. */
  .page--wide > .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .page--wide > .hero .hero__photo { justify-self: center; align-self: center; }
  /* A hairline between the two columns, in the middle of the gap. It starts level with the first section rules. */
  .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col:first-child { padding-right: calc(var(--col-gap) / 2); }
  .col + .col { padding-left: calc(var(--col-gap) / 2); border-left: 1px solid var(--c-rule); }
  /* Home page: the panels already separate the columns, so no line between them. */
  .page > .cols > .col + .col { border-left: 0; }
  .page--wide > .band__cols { max-width: none; }
  .band__cols .edu + .edu { margin-top: 0; }
}

/* Bottom band (education): full width, a shade darker than the page.
   The html background uses the same shade, so on tall screens the band runs to the bottom edge. */
:root { --c-band: color-mix(in srgb, var(--c-rule) 45%, var(--c-ground)); }
html:has(body > .band) { background: var(--c-band); }
.band { background: var(--c-band); border-top: 1px solid var(--c-rule); }
.band__inner { padding-top: var(--gap); padding-bottom: 56px; }
.band h2 { margin-bottom: 0; }
.band__cols { margin-top: 1rem; }
.edu h3 { font-size: 20px; margin: 0 0 .25rem; }
.edu__years { font-size: var(--fs-small); }
.edu__notes { margin-top: .5rem; font-size: var(--fs-small); }
.edu__notes li { padding-left: 1.1rem; position: relative; }
.edu__notes li::before { content: "–"; position: absolute; left: 0; color: var(--c-muted); }
.edu__list { display: grid; gap: .4rem; margin-top: .5rem; }
/* Course and exam lists: the toggle is a small outlined button. */
.edu .details--inline { margin-top: 1rem; }
.edu .details--inline > summary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .9rem; border: 1px solid var(--c-link-line); border-radius: 6px;
  background: var(--c-ground); color: var(--c-ink); text-decoration: none;
  font-size: var(--fs-small); list-style: none;
}
.edu .details--inline > summary::-webkit-details-marker { display: none; }
.edu .details--inline > summary::after { content: "▾"; color: var(--c-muted); transition: transform .15s; }
.edu .details--inline[open] > summary::after { transform: rotate(180deg); }
.edu .details--inline > summary:hover { border-color: var(--c-link); color: var(--c-link); }
.edu .details--inline[open] > summary { margin-bottom: .5rem; }
.edu__code { white-space: nowrap; }
.edu + .edu { margin-top: var(--gap); }

@media (max-width: 480px) {
  :root { --fs-body: 17px; --fs-name: 27px; --photo-size: 88px; }
  .hero { grid-template-areas: "name photo" "intro intro" "links links"; column-gap: 1rem; align-items: center; }
  .hero__intro { margin-top: .75rem; }
  .row, .skills__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .skills__group { padding-top: 0; }
  .row__years { padding-top: 0; }
}
