:root {
  color-scheme: light;
  --paper: #eef3f6;
  --ink: #14212b;
  --muted: #526575;
  --accent: #2c7899;
  --page-width: 960px;
  --page-gutter: 40px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

::selection {
  background: #c7dce6;
  color: var(--ink);
}

body {
  min-width: 0;
  min-height: 100svh;
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 15% 10%, rgb(91 145 171 / 7%), transparent 38%),
    radial-gradient(ellipse at 88% 78%, rgb(91 145 171 / 5%), transparent 35%),
    linear-gradient(rgb(44 91 116 / 1.4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(44 91 116 / 1.4%) 1px, transparent 1px);
  background-attachment: fixed;
  background-size: auto, auto, 64px 64px, 64px 64px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.site-header {
  width: min(100% - var(--page-gutter) * 2, var(--page-width));
  height: 64px;
  margin: 0 auto;
  padding-top: 22px;
}

.brand {
  display: inline-flex;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  text-decoration: none;
}

.brand-period {
  color: var(--accent);
}

.hero {
  display: grid;
  width: min(100% - var(--page-gutter) * 2, var(--page-width));
  min-height: calc(100svh - 64px);
  grid-template-areas: "profile portrait";
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: center;
  column-gap: clamp(40px, 5vw, 64px);
  margin: 0 auto;
  padding: 12px 0 132px;
}

.profile-copy {
  display: grid;
  grid-area: profile;
  grid-template-areas:
    "intro"
    "bio"
    "documents";
  grid-template-rows: max-content max-content max-content;
  row-gap: clamp(20px, 3vh, 28px);
}

.intro {
  grid-area: intro;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 4.5vw, 50px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.role {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: clamp(24px, 3vw, 30px);
}

.bio {
  grid-area: bio;
  max-width: 66ch;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.portrait {
  grid-area: portrait;
  width: auto;
  height: min(66svh, 500px);
  aspect-ratio: 0.665;
  align-self: center;
  justify-self: end;
  overflow: hidden;
  margin: 0;
  border: 2px solid var(--ink);
  background: #d5dfe4;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.documents {
  grid-area: documents;
}

.cv-links {
  position: fixed;
  z-index: 5;
  right: max(var(--page-gutter), calc((100vw - var(--page-width)) / 2));
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: max(var(--page-gutter), calc((100vw - var(--page-width)) / 2));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: var(--page-width);
  margin: 0 auto;
}

.cv-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.cv-button:hover {
  background: #294657;
}

.cv-button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 650px) {
  :root {
    --page-gutter: 26px;
  }

  body {
    min-height: 100svh;
  }

  .site-header {
    height: 58px;
    padding-top: 15px;
  }

  .brand {
    font-size: 21px;
    letter-spacing: -1.5px;
  }

  .hero {
    min-height: calc(100svh - 58px);
    grid-template-areas:
      "intro intro"
      "bio portrait";
    grid-template-columns: minmax(0, 1.15fr) minmax(90px, 0.85fr);
    align-content: center;
    align-items: start;
    column-gap: 12px;
    row-gap: 14px;
    padding: 16px 0 112px;
  }

  .profile-copy {
    display: contents;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(22px, 7.5vw, 30px);
    line-height: 1.04;
  }

  .role {
    margin: 2px 0 0;
    font-size: clamp(19px, 5.7vw, 24px);
    white-space: nowrap;
  }

  .bio {
    grid-area: bio;
    align-self: start;
    padding-top: 2px;
    font-size: clamp(10px, 3.1vw, 12px);
    line-height: 1.3;
  }

  .portrait {
    grid-area: portrait;
    width: 100%;
    height: auto;
    aspect-ratio: 0.665;
    justify-self: stretch;
    margin-top: 2px;
  }

  .portrait img {
    object-position: center 24%;
  }

  .documents {
    position: static;
  }

  .cv-links {
    right: var(--page-gutter);
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: var(--page-gutter);
    gap: 12px;
  }

  .cv-button {
    min-height: 52px;
    padding: 6px 8px;
    font-size: clamp(10px, 2.8vw, 12px);
    line-height: 1.15;
  }
}

@media (max-width: 360px) {
  :root {
    --page-gutter: 18px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(82px, 0.92fr);
    column-gap: 9px;
  }

  h1 {
    font-size: 22px;
  }

  .role {
    font-size: 18px;
  }

  .cv-links {
    gap: 8px;
  }

  .cv-button {
    padding-inline: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
