:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1d1c1a;
  --muted: #6b6862;
  --border: #e5e2dc;
  --accent: #2c55c7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --surface: #1c1c1a;
    --text: #edebe7;
    --muted: #a29f98;
    --border: #2e2d2a;
    --accent: #8fabff;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(3rem, 12vh, 7rem) 16px 3rem;
}

/* Photo on the left; name, bio and links stacked to its right. */
.profile {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "photo name"
    "photo bio"
    "photo links";
  column-gap: 2.5rem;
  align-items: start;
  align-content: start;
}

.photo {
  grid-area: photo;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--border);
}

.profile h1 {
  grid-area: name;
  margin-top: -0.15em;
}

.profile .bio {
  grid-area: bio;
  margin-top: 1rem;
}

.profile .links {
  grid-area: links;
  margin-top: 0.5rem;
}

/* Too narrow for text beside a large photo: photo and name share a row,
   bio and links run full width underneath. */
@media (max-width: 600px) {
  .profile {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "photo name"
      "bio bio"
      "links links";
    column-gap: 1.25rem;
    align-items: center;
  }

  .profile h1 {
    margin-top: 0;
  }

  .profile .bio {
    margin-top: 1.5rem;
  }
}

@media (max-width: 360px) {
  .profile {
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 1rem;
  }
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.bio {
  margin-top: 1.75rem;
}

.bio p {
  margin: 0 0 1em;
}

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

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.links a:hover,
.links a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.links svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

footer {
  padding: 2rem 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
