:root {
  --bg: #faf8f5;
  --text: #1a1917;
  --muted: #5c5854;
  --rule: #e4dfd6;
  --focus: #1a1917;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.7;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 4.75rem 1.5rem 6.5rem;
}

h1 {
  margin: 0 0 2.75rem;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 2.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.15;
}

.bio {
  margin: 0 0 3.25rem;
  max-width: 36rem;
}

.block {
  margin-bottom: 3.25rem;
}

h2 {
  margin: 0 0 0.85rem;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.publications {
  margin: 0;
  padding: 0;
  list-style: none;
}

.publications li {
  margin: 0 0 0.35rem;
}

cite {
  font-style: italic;
  font-weight: 400;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.75rem;
  max-width: 24rem;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
button {
  font: inherit;
  color: var(--text);
}

input,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: 0;
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

button {
  justify-self: start;
  margin-top: 0.25rem;
  padding: 0.45rem 1.15rem;
  border: 1px solid var(--text);
  background: transparent;
  cursor: pointer;
}

button:hover {
  background: var(--text);
  color: var(--bg);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.form-thanks,
.form-error {
  margin: 1.75rem 0 0;
  max-width: 24rem;
}

.form-error {
  margin-top: 0.75rem;
}

@media (max-width: 40rem) {
  html {
    font-size: 17px;
  }

  .page {
    padding: 3rem 1.25rem 4.5rem;
  }

  h1 {
    font-size: 2.35rem;
    margin-bottom: 2rem;
  }

  .bio,
  .block {
    margin-bottom: 2.5rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  .contact-form {
    display: none;
  }

  a {
    text-decoration: none;
  }
}
