:root {
  --accent-color: #3a5a78;
  --hover-color: #6b8ba3;
  --bg-color: #fdfdfe;
  --text-color: #1e1e1e;
  --heading-font: 'Besley', serif;
  --body-font: 'Besley', serif;
  --nav-font: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--body-font);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 23px;
  margin: 0;
  padding: 0;
}

header {
  padding: 2rem 2rem 0rem;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75em;
  padding: 0 2rem;
}

.topbar h1 {
  font-family: var(--heading-font);
  font-weight: 900;
  font-size: 3.3rem;
  color: var(--accent-color);
  letter-spacing: -0.015em;
}

.topbar h1 span {
  display: inline;
}

/* Kerning classes for h1
   Kern pulls the following letter left, toward the letter in the span */
.kern-tightest { margin-right: -0.07em; }
.kern-tighter { margin-right: -0.05em; }
.kern-tight { margin-right: -0.04em; }
.kern-high { margin-right: -0.03em; }
.kern-medium { margin-right: -0.02em; }
.kern-light { margin-right: -0.015em; }
.kern-subtle { margin-right: -0.01em; }
.kern-subtler { margin-right: -0.005em; }
.kern-none { margin-right: 0; }

nav {
  font-family: var(--nav-font);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  display: flex;
  align-items: baseline;
}

nav a {
  margin-left: 1.25rem;
  text-decoration: none;
  color: var(--accent-color);
  transition: color 0.3s ease;
  display: inline-block;
}

nav a:hover {
  color: var(--hover-color);
}

.rule {
  border-top: 2px solid #ccc;
  margin: -0.5em 0 2rem;
  width: 100%;
}

section {
  max-width: 1200px;
  margin: 2.1rem auto 2rem;
  padding: 0 1.5rem;
}

/* Special styling for contact section to align with h1 */
.contact {
  padding: 0 4rem;
}

/* Special styling for poems section to align h2 with h1 */
.poems {
  padding: 0 4rem;
}

.about {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: nowrap;
  flex-direction: row;
}

.about-image {
  flex-shrink: 1;
  flex-grow: 1;
  max-width: 600px;
}

.about img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.photo-credit {
  font-family: var(--nav-font);
  font-size: 0.8rem;
  color: var(--text-color);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.about-text {
  flex: 0 1 400px;
  min-width: 250px;
  margin-top: 2em;
}

.about-text p {
  margin-bottom: 1rem;
}

h2 {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  margin-top: 2rem;
  color: var(--accent-color);
}

.poems p, .contact p {
  margin-bottom: 1rem;
}

/* Styling for blog links */
.poems a {
  color: var(--text-color);
  text-decoration: none;
  transition: text-decoration 0.3s ease;
}

.poems a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
  font-family: var(--nav-font);
}

@media (max-width: 983px) {
  body {
    font-size: 20px;
  }

  header {
    padding: 1rem 1rem 0rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    margin-bottom: 1rem;
  }

  .topbar h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }

  nav {
    flex-direction: row;
    gap: 0.5rem;
  }

  nav a {
    margin-left: 0;
    margin-right: 1rem;
    font-size: 1.5rem;
  }

  section {
    margin: 1.5rem auto;
    padding: 0 1rem;
  }

  /* Adjust contact alignment for mobile */
  .contact {
    padding: 0 1rem;
  }

  /* Adjust poems alignment for mobile */
  .poems {
    padding: 0 1rem;
  }

  .about {
    flex-direction: column;
    gap: 1.5rem;
  }

  .about-image {
    max-width: 100%;
    order: 1;
  }

  .about img {
    max-width: 100%;
  }

  .about-text {
    order: 2;
    flex: none;
    min-width: auto;
  }

  h2 {
    font-size: 2rem;
  }

  footer {
    padding: 1.5rem 0;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 18px;
  }

  .topbar h1 {
    font-size: 2rem;
  }

  nav a {
    font-size: 1.25rem;
  }

  section {
    padding: 0 0.75rem;
  }

  /* Adjust contact alignment for small mobile */
  .contact {
    padding: 0 0.75rem;
  }

  /* Adjust poems alignment for small mobile */
  .poems {
    padding: 0 0.75rem;
  }

  h2 {
    font-size: 1.75rem;
  }
}