@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Instrument+Serif&display=swap');

:root {
  color-scheme: light;
  --paper: #eeebe4;
  --ink: #182b34;
  --muted: #52616a;
  --accent: #8a4c35;
  --line: #d3cfc6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  display: block;
  height: 5px;
  background: var(--ink);
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.skip {
  position: absolute;
  top: 12px;
  left: 12px;
  min-height: 44px;
  padding: 12px;
  background: #fff;
  transform: translateY(-200%);
  z-index: 1;
}

.skip:focus {
  transform: none;
}

.page {
  width: min(100% - 40px, 440px);
  margin: 0 auto;
  padding: clamp(40px, 9vh, 80px) 0 24px;
}

.intro {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.portrait {
  display: block;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #f9f7f2;
}

h1 {
  margin: 0 0 7px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2.25rem, 10vw, 3rem);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1;
}

.affiliation {
  margin: 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.6;
}

.links {
  display: grid;
  gap: 10px;
  scroll-margin-top: 20px;
}

.link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f9f7f2;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.5;
}

.link:hover {
  background: #fffdf8;
  border-color: #9b8f7e;
}

.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffdf5;
}

.primary:hover {
  border-color: #28424f;
  background: #28424f;
}

.icon {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
}

.icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 16px;
  margin-top: 20px;
  color: var(--muted);
}

.contact a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: .875rem;
  line-height: 1.5;
  text-underline-offset: 5px;
}

@media (max-width: 350px) {
  .intro {
    gap: 14px;
  }

  .portrait {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }
}

dialog {
  width: min(calc(100% - 32px), 420px);
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

dialog::backdrop {
  background: rgb(24 43 52 / 55%);
}

dialog h2 {
  margin: 12px 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
}

dialog p {
  line-height: 1.5;
  color: var(--muted);
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.dialog-close {
  display: block;
  min-height: 44px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f9f7f2;
  color: var(--ink);
}

dialog label {
  display: block;
  font-size: .875rem;
  margin-bottom: 6px;
}

#email-address {
  width: 100%;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffdf8;
  color: var(--ink);
}

#copy-email {
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
}

#email-status {
  min-height: 24px;
  font-size: .875rem;
}

.email-options {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.email-options a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .875rem;
  text-underline-offset: 4px;
}

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