/* Layout closely modeled on karrisaarinen.com; warmth from paper ground and warm ink. */

:root {
  --paper: #fbf8f1;
  --ink: #26241f;
  --muted: #77746c;
  --accent: #a4672a;
  --hairline: #e0d9ca;
  --underline: #cec5b2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 71rem;
  margin: 0 auto;
  padding: 11rem 2.5rem 5rem;
}

/* Hero: cut-out photo floated right, text wraps along its silhouette,
   photo bottom flush with the rule */

.hero {
  display: flow-root;
}

.portrait {
  float: right;
  width: 26rem;
  height: auto;
  margin: 4.5rem 2.5rem 0 0;
  shape-outside: polygon(100% 0%, 99.8% 0%, 41% 7.1%, 35.4% 14.2%, 31.1% 21.4%, 29.3% 28.5%, 30.5% 35.6%, 30.7% 42.7%, 36.5% 49.8%, 37.7% 56.9%, 36.9% 64.1%, 12.5% 71.2%, 1.2% 78.3%, 0% 85.4%, 0% 100%, 100% 100%) border-box;
  shape-margin: 3.25rem;
  display: block;
}

h1 {
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.125rem;
  line-height: 1.5;
}

.hero .links {
  margin-top: 3.5rem;
}

.links a {
  font-size: 1.0625rem;
  margin-right: 2.5rem;
}

hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 0 0 4.75rem;
}

/* Columns below the rule, like Karri's Currently / Writing */

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5.5rem;
}

section {
  margin-bottom: 3.5rem;
}

section:last-child {
  margin-bottom: 0;
}

h2 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

p + p {
  margin-top: 1rem;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.publications {
  list-style: none;
}

.publications li {
  margin-bottom: 1.5rem;
}

.publications .meta {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.more {
  margin-top: 1.75rem;
  font-size: 0.9375rem;
}

/* Below ~1080px the floated hero gets cramped: stack everything, photo after the links */

@media (max-width: 1080px) {
  main {
    max-width: 46rem;
    padding: 2.5rem 1.5rem 4rem;
  }

  .hero {
    display: flex;
    flex-direction: column;
  }

  .portrait {
    float: none;
    order: 10;
    width: min(100%, 26rem);
    height: auto;
    margin: 2.5rem 0 0;
    shape-outside: none;
  }

  h1 {
    font-size: 1.25rem;
  }

  .hero p {
    font-size: 1.0625rem;
  }

  .hero .links {
    margin-top: 2rem;
  }

  hr {
    margin-bottom: 3rem;
  }

  .columns {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}
