@font-face {
  font-family: "LM Roman";
  src: url("fonts/lmroman10-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LM Roman";
  src: url("fonts/lmroman10-italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "LM Roman";
  src: url("fonts/lmroman10-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LM Roman Display";
  src: url("fonts/lmroman17-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --muted: #595959;
  --label: 9.5rem;
  --gap: 1.5rem;
  --serif: "LM Roman", "Latin Modern Roman", "CMU Serif", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e6e6;
    --paper: #161616;
    --muted: #a3a3a3;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.55;
}

main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 2rem;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Header: name and contact on the left, framed photo on the right, as in the CV */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2.5rem;
  align-items: end;
  margin-bottom: 3.5rem;
}

.masthead h1 {
  font-family: "LM Roman Display", var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
}

.role {
  font-style: italic;
  color: var(--muted);
  margin: 0.6rem 0 1.25rem;
}

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.portrait {
  display: block;
  width: 128px;
  height: auto;
  border: 1px solid var(--ink);
}

/* Sections: a black bar in the label column, heading in the content column */

section {
  display: grid;
  grid-template-columns: var(--label) 1fr;
  column-gap: var(--gap);
  margin-top: 2.75rem;
}

section h2 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--label) 1fr;
  column-gap: var(--gap);
  align-items: center;
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 1rem;
}

section h2::before {
  content: "";
  height: 0.3em;
  background: var(--ink);
}

section p {
  grid-column: 2;
  max-width: 34em;
  margin: 0 0 1rem;
}

dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--label) 1fr;
  column-gap: var(--gap);
  row-gap: 0.7rem;
  margin: 0;
}

dt {
  text-align: right;
  font-style: italic;
  color: var(--muted);
  hyphens: manual;
}

dd {
  margin: 0;
  max-width: 34em;
}

.nowrap { white-space: nowrap; }

.empty {
  color: var(--muted);
  font-style: italic;
}

footer {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

footer p { margin: 0 0 0.3rem; }

/* Intro and credo: no section bar, text sits in the content column */

.intro {
  margin-top: 0;
}

.credo {
  grid-column: 2;
  font-style: italic;
  font-size: 1.65rem;
  line-height: 1.3;
  max-width: 24em;
  margin: 1.25rem 0 0.5rem;
}

.doing {
  grid-column: 2;
  margin: 0;
  padding-left: 1.1em;
  max-width: 34em;
}

.doing li { margin-bottom: 0.6rem; }
.doing li::marker { color: var(--muted); }

/* Narrow screens: labels move above their content */

@media (max-width: 40rem) {
  main { padding-top: 3rem; }

  .masthead {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .portrait {
    grid-row: 1;
    width: 104px;
  }

  section,
  dl {
    grid-template-columns: 1fr;
  }

  dl { row-gap: 0; }

  section h2 {
    grid-template-columns: 2.5rem 1fr;
    column-gap: 0.9rem;
  }

  section p,
  .credo,
  .doing { grid-column: 1; }

  dt { text-align: left; }

  dd { margin-bottom: 1rem; }
}
