/* jamesduplessie.com. EB Garamond (SIL OFL 1.1, see /fonts/OFL.txt), self-hosted. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: "EB Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: clamp(1.125rem, 0.95rem + 0.55vw, 1.4375rem);
  line-height: 1.55;
  font-kerning: normal;
}

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

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

a:focus-visible {
  outline: 2px solid #14213d;
  outline-offset: 2px;
}

/* Layout: portrait a third of the width on the left, text on the right. */

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(1.75rem, 6vw, 5.5rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  column-gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

/* The portrait is cut flat at the bottom; it stands on a hairline rule. */
.portrait {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  border-bottom: 1px solid #000;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
}

.text,
footer {
  grid-column: 2;
  max-width: 32em;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.005em;
}

.role {
  margin: 0.4em 0 0;
  font-size: 1.2em;
  font-style: italic;
  line-height: 1.3;
}

header {
  margin-bottom: 1.6em;
}

p {
  margin: 0 0 0.9em;
}

/* "Education:" and "Contact:" stay as written, as run-in headings. */
.facts {
  margin: 0 0 0.9em;
}

main > p + .facts {
  margin-top: 1.8em;
}

.facts h2,
.facts p {
  display: inline;
  margin: 0;
  font-size: 1em;
}

.facts h2 {
  font-style: italic;
  font-weight: 400;
}

/* Larger hit area for the two standalone links without moving the text. */
.role a,
.facts a {
  display: inline-block;
  padding: 0.45em 0;
  margin: -0.45em 0;
}

footer {
  margin-top: 2.5em;
  font-size: 0.85em;
}

footer p {
  margin: 0;
}

/* Single-column pages (404). */
.page.single {
  grid-template-columns: minmax(0, 1fr);
}

.page.single .text {
  grid-column: 1;
}

.page.single h1 a {
  color: #000;
  text-decoration: none;
}

/* Phones: portrait above the text, standing on a full-width rule. */
@media (max-width: 47.99rem) {
  .page {
    grid-template-columns: minmax(0, 1fr);
  }

  .portrait,
  .text,
  footer {
    grid-column: 1;
    grid-row: auto;
  }

  .portrait img {
    width: min(15rem, 64%);
  }

  .text {
    margin-top: 1.75rem;
  }
}
