:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --ink: #203d31;
  --accent: #50683f;
  --text: #364439;
  --muted: #596650;
  --rule: #c9cdbd;
  --display: "PT Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Roboto", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background-color: var(--paper);
  font: 1rem/1.5 var(--sans);
}

h1, h2, p, dl, dd, ul { margin: 0; }

a {
  color: var(--ink);
  text-underline-offset: .25em;
  text-decoration-color: #9da890;
}

a:hover { color: #35562a; text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid #536a3e; outline-offset: 4px; }

.wrap {
  width: min(100% - clamp(2.5rem, 8vw, 8rem), 76rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 1;
  inset: .6rem auto auto .6rem;
  padding: .6rem 1rem;
  background: white;
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.65rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark, .masthead nav, .sources ul {
  display: flex;
  align-items: center;
}

.wordmark {
  gap: .7rem;
  color: var(--ink);
  font: 1.08rem/1.2 var(--display);
}

/* A small sprig for the masthead, drawn entirely in CSS. */
.sprig {
  display: inline-block;
  position: relative;
  flex: 0 0 1.55rem;
  width: 1.55rem;
  height: 1.8rem;
  color: var(--accent);
}

.sprig::before {
  content: "";
  position: absolute;
  bottom: .1rem;
  left: .28rem;
  width: 1px;
  height: 1.58rem;
  background: currentColor;
  transform: rotate(32deg);
  transform-origin: bottom;
}

.sprig i {
  position: absolute;
  width: .43rem;
  height: .79rem;
  border-radius: 0 85% 0 85%;
  background: currentColor;
}

.sprig i:nth-child(1) { top: .1rem; left: .93rem; transform: rotate(41deg); }
.sprig i:nth-child(2) { top: .55rem; left: .39rem; transform: rotate(-12deg); }
.sprig i:nth-child(3) { top: .82rem; left: .81rem; transform: rotate(68deg); }

.masthead nav { gap: clamp(.85rem, 2.2vw, 2rem); }
.masthead nav a { padding-block: .6rem; font-size: .9rem; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 22rem);
  align-items: end;
  gap: clamp(1.4rem, 4vw, 4rem);
  padding-block: clamp(3rem, 5.4vw, 5rem) clamp(2.35rem, 4.2vw, 3.8rem);
}

.intro h1 {
  color: var(--ink);
  font: 400 clamp(3.75rem, 7.6vw, 7.1rem)/.99 var(--display);
  letter-spacing: -.055em;
}

.intro h1 em { color: var(--accent); font-weight: inherit; }

.intro p {
  max-width: 29ch;
  margin-bottom: .14rem;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.45;
}

.collection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(2.5rem, 4vw, 3.75rem) clamp(1.4rem, 2.55vw, 2.45rem);
  scroll-margin-top: 1rem;
}

.plant { min-width: 0; --wash: #e9eddf; }
.plant:nth-of-type(3n + 2) { --wash: #e8eee8; }
.plant:nth-of-type(3n) { --wash: #f2e8d8; }

.plate {
  display: grid;
  place-items: center;
  aspect-ratio: 1.35;
  overflow: hidden;
  border: 1px solid rgb(52 67 36 / .1);
  border-radius: .25rem;
  background: radial-gradient(ellipse at 48% 42%, #fcfbf5 3%, var(--wash) 100%);
  isolation: isolate;
}

.plate img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.plant-name {
  padding-block: 1.15rem 1rem;
  border-bottom: 1px solid var(--rule);
}

.plant-name h2 {
  color: var(--ink);
  font: 400 clamp(1.7rem, 2.45vw, 2.35rem)/1.14 var(--display);
  letter-spacing: -.035em;
  overflow-wrap: break-word;
}

.plant-name p {
  margin-top: .25rem;
  color: var(--muted);
  font: italic 1rem/1.4 var(--display);
}

.plant dl { display: grid; gap: .9rem; padding-top: 1.05rem; }
.plant dt { margin-bottom: .14rem; font-size: .875rem; font-weight: 650; color: var(--ink); }
.plant dd { max-width: 39ch; line-height: 1.48; }

.sources {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.1rem 2rem;
  margin-block: clamp(2.9rem, 5.2vw, 5rem) 2rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.sources h2 { color: var(--ink); font: 400 1.22rem/1.3 var(--display); }
.sources h3 { margin: 0 0 .35rem; color: var(--muted); font: 500 .9rem/1.45 var(--sans); }
.sources ul { flex-wrap: wrap; gap: 0 1.2rem; padding: 0; list-style: none; }
.sources a { display: inline-block; padding-block: .4rem; font-size: .9rem; }

@media (min-width: 54rem) {
  .plant dl { grid-template-rows: minmax(4.5rem, auto) auto; }
}

@media (max-width: 53.99rem) {
  .intro { grid-template-columns: 1fr; gap: .85rem; }
  .intro p { max-width: 42ch; }
  .collection { grid-template-columns: 1fr; gap: 2.2rem; }
  .sources { grid-template-columns: 1.3fr 1fr; }
  .sources h2 { grid-column: 1 / -1; }
}

@media (min-width: 38rem) and (max-width: 53.99rem) {
  .plant { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 1.75rem; }
  .plate { aspect-ratio: 1.05; }
  .plant-name { padding-top: 0; }
}

@media (max-width: 37.99rem) {
  .masthead { flex-wrap: wrap; gap: 0 .85rem; min-height: 3.9rem; padding-block: .45rem; }
  .wordmark { gap: .4rem; font-size: 1rem; }
  .masthead nav { gap: .8rem; }
  .masthead nav a { font-size: .875rem; }
  .intro { padding-block: 2.4rem 1.9rem; }
  .intro h1 { font-size: clamp(2.95rem, 11vw, 4.2rem); }
  .plate { aspect-ratio: 1.32; }
  .plant-name { padding-block: .85rem .75rem; }
  .plant dl { gap: .7rem; padding-top: .75rem; }
  .sources { grid-template-columns: 1fr; margin-block: 2.8rem 1.4rem; }
}
