/* Shared values and automatic color modes. */
:root {
  color-scheme: light dark;

  --background: #fdfdfc;
  --text: #292929;
  --muted: #626262;
  --link: #365c76;
  --link-hover: #1c3d55;
  --separator: #dededb;
  --focus: #365c76;

  --content-width: 850px;
  --page-padding: 1.5rem;
  --section-space: 3.5rem;
  --radius: 4px;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #191a1b;
    --text: #e9e9e6;
    --muted: #b0b0ac;
    --link: #a6c7df;
    --link-hover: #d0e4f2;
    --separator: #3b3c3d;
    --focus: #a6c7df;
  }
}

/* Base typography and page layout. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.container {
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--page-padding));
  margin-inline: auto;
  padding: 4.5rem var(--page-padding) 2rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.03em;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover {
  color: inherit;
  text-decoration: underline;
}

h2 {
  margin-bottom: 1.75rem;
  font-size: 1.5rem;
}

h3 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Profile. */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2rem;
  align-items: start;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.location {
  margin: 0.5rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.social-links {
  margin: 1.5rem 0 0;
}

.social-links a {
  display: inline-block;
}

.social-links span {
  color: var(--muted);
}

/* Projects and footer. */
.projects {
  margin-top: var(--section-space);
}

.project+.project {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--separator);
}

.project-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.65rem;
}

.project-heading a {
  flex-shrink: 0;
  font-size: 0.9375rem;
}

.project p {
  margin: 0;
  color: var(--muted);
}

footer {
  margin-top: var(--section-space);
  padding-top: 1.5rem;
  border-top: 1px solid var(--separator);
  color: var(--muted);
  text-align: center;
}

footer p {
  margin: 0;
}

footer small {
  font-size: 0.8125rem;
}

/* Narrow screens. */
@media (max-width: 640px) {
  :root {
    --page-padding: 1.25rem;
    --section-space: 2.75rem;
  }

  .container {
    padding-top: 2rem;
  }

  .profile {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .portrait {
    width: 200px;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
  }

  .profile-text {
    width: 100%;
    max-width: 34rem;
    margin-inline: auto;
    text-align: left;
  }

  h1 {
    font-size: 2rem;
  }

  .project-heading {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
  }

  .project-heading a {
    margin-left: auto;
  }
}