:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --border: #e2ded6;
  --text: #1b1e23;
  --muted: #4b5563;
  --accent: #0b57a4;
  --accent-soft: #dfeaf7;
  --focus: #0b57a4;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #181c22;
    --border: #2b323c;
    --text: #e8eaed;
    --muted: #a9b1bc;
    --accent: #7db4ff;
    --accent-soft: #1d2a3b;
    --focus: #7db4ff;
  }
}

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

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

body {
  margin: 0 auto;
  max-width: 44rem;
  padding: 2.5rem 1.25rem 3rem;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Header: name, tagline, location and email link on the left, round photo on the right. */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name     photo"
    "tagline  tagline"
    "location location"
    "contact  contact";
  column-gap: 1rem;
  row-gap: 0.75rem;
  align-items: center;
}

.hero h1 {
  grid-area: name;
  font-size: clamp(2rem, 1.4rem + 3vw, 2.75rem);
  letter-spacing: -0.02em;
}

.tagline {
  grid-area: tagline;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
}

.location {
  grid-area: location;
  color: var(--muted);
}

.hero-contact {
  grid-area: contact;
  font-weight: 700;
}

.nowrap {
  white-space: nowrap;
}

.avatar {
  grid-area: photo;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.avatar--placeholder {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: none;
}

main {
  margin-top: 2rem;
  display: grid;
  gap: 2.75rem;
}

h2 {
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

/* Projects: one <li class="project"> per project. */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.project {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.project h3 {
  font-size: 1.125rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-weight: 600;
}

.contact {
  padding: 1.5rem 1.25rem;
  background: var(--accent-soft);
  border-radius: 0.75rem;
}

.contact h2 {
  margin-bottom: 0.5rem;
}

.email {
  display: inline-block;
  margin: 0.75rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-weight: 600;
}

@media (min-width: 40rem) {
  body {
    padding-top: 4.5rem;
  }

  .hero {
    grid-template-areas:
      "name     photo"
      "tagline  photo"
      "location photo"
      "contact  photo";
    column-gap: 2rem;
    row-gap: 0.5rem;
  }

  .avatar {
    width: 8rem;
    height: 8rem;
  }

  .avatar--placeholder {
    font-size: 2.5rem;
  }

  main {
    margin-top: 3rem;
  }

  .contact {
    padding: 2rem;
  }
}
