@font-face {
  font-family: "Arapey";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/arapey-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Arapey";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/arapey-italic.woff2") format("woff2");
}

:root {
  --cream: #f5f5ed;
  --cream-deep: #ece9dc;
  --forest: #396140;
  --sage: #96b492;
  --parchment: #f0e7db;
  --ink: #393131;
  --black: #1d1b1a;
  --gutter: 20px;
  --measure: 680px;
  --s: min(1.15px, calc((100vw - 2 * var(--gutter)) / 330));
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--black);
  font-family: "Arapey", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
}

img,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--forest);
  color: var(--cream);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.type {
  width: calc(var(--w) * var(--s));
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Cover */

.cover {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  padding: 72px var(--gutter) 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cover__leaves {
  position: absolute;
  pointer-events: none;
}

.cover__leaves--top {
  top: 0;
  left: 0;
  width: clamp(110px, 30vw, 230px);
}

.cover__leaves--bottom {
  right: 0;
  bottom: 0;
  width: clamp(140px, 38vw, 290px);
}

.cover__inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.cover__brand {
  display: block;
  width: min(280px, 72%);
  margin: 0 auto 32px;
}

.cover__brand img {
  width: 100%;
}

.cover__photo {
  width: 100%;
  aspect-ratio: 356 / 409;
  object-fit: cover;
  object-position: 50% 40%;
  border-radius: 999px 999px 0 0;
}

.cover__title {
  margin: 28px 0 0;
}

.cover__title .type {
  width: calc(var(--w) * var(--s) * 1.3);
}

.cover__sub {
  margin: 10px 0 0;
  color: var(--ink);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.9;
}

.cover__jump {
  display: inline-block;
  margin-top: 22px;
  color: var(--forest);
  font-style: italic;
  text-decoration: none;
  border-bottom: 1px solid var(--sage);
}

/* Principles */

.principles {
  background: var(--forest);
  color: #fff;
  padding: 64px 0 72px;
}

.principles__block + .principles__block {
  margin-top: 48px;
}

.principles__heading {
  position: relative;
  margin: 0;
  padding-top: 60px;
}

.principles__arc {
  position: absolute;
  top: 0;
  left: 2px;
  width: calc(109.1 * var(--s));
}

.principles p {
  margin: 18px 0 0;
  padding-left: 12px;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.9;
}

/* Index */

.index {
  padding: 64px 0 40px;
}

.index__eyebrow {
  margin: 0;
  color: var(--forest);
  font-style: italic;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
}

.index__title {
  margin: 4px 0 4px;
  color: var(--forest);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.2;
}

.index__note {
  margin: 0 0 20px;
  color: var(--ink);
  font-style: italic;
}

.index__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(57, 97, 64, 0.25);
}

.index__list a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 2px;
  border-bottom: 1px solid rgba(57, 97, 64, 0.25);
  text-decoration: none;
}

.index__list img {
  flex: none;
  width: 40px;
  height: 48px;
  object-fit: cover;
  border-radius: 999px 999px 0 0;
}

.index__name {
  flex: 1;
  color: var(--forest);
  font-size: 1.25rem;
  line-height: 1.25;
}

.tag {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--native {
  background: rgba(57, 97, 64, 0.12);
  color: var(--forest);
}

.tag--invasive {
  background: rgba(150, 70, 40, 0.12);
  color: #8a3f25;
}

.tag--naturalized {
  background: rgba(150, 120, 40, 0.14);
  color: #6f5a1d;
}

@media (min-width: 640px) {
  .index__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
  }
}

/* Plants */

.plant {
  position: relative;
  padding: 40px 0 56px;
  scroll-margin-top: 8px;
}

.plant + .plant {
  border-top: 1px solid rgba(57, 97, 64, 0.18);
}

.plant__head {
  position: relative;
}

.plant__title {
  margin: 0;
}

.plant__head .tag {
  display: inline-block;
  margin-top: 12px;
}

.plant__photo {
  width: 100%;
  max-width: 360px;
  margin: 24px 0 0;
}

.plant__photo img {
  width: 100%;
  aspect-ratio: 150 / 185;
  object-fit: cover;
  border-radius: 999px 999px 0 0;
  background: var(--cream-deep);
}

.plant__meta {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-style: italic;
  line-height: 1.75;
}

.plant__meta li + li {
  margin-top: 4px;
}

.plant__meta .caution {
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--sage);
  background: rgba(150, 180, 146, 0.16);
}

.plant__id {
  margin: 28px 0 0;
  font-style: italic;
  line-height: 1.8;
}

.plant__id div + div {
  margin-top: 10px;
}

.plant__id dt,
.plant__id dd {
  display: inline;
  margin: 0;
}

.plant__meta strong,
.plant__id dt {
  font-weight: 700;
  color: #000;
  -webkit-text-stroke: 0.3px currentColor;
}

@media (min-width: 720px) {
  .plant__body {
    display: grid;
    grid-template-columns: 1fr 220px;
    column-gap: 32px;
    align-items: start;
  }

  .plant__photo {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .plant__meta {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
  }

  .plant__id {
    grid-column: 1 / -1;
  }
}

/* Footer */

.footer {
  padding: 72px var(--gutter) 96px;
  text-align: center;
  background: var(--cream);
  border-top: 1px solid rgba(57, 97, 64, 0.18);
}

.footer .type {
  margin: 0 auto;
}

.footer a {
  display: inline-block;
  margin-top: 18px;
}

/* Back-to-index button */

.to-index {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  font-style: italic;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(29, 27, 26, 0.18);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.to-index.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-index:focus-visible,
.index__list a:focus-visible,
.cover__jump:focus-visible,
.cover__brand:focus-visible,
.footer a:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

.to-index:focus-visible {
  outline-color: var(--ink);
}

@media print {
  .to-index,
  .skip-link {
    display: none;
  }

  .plant {
    break-inside: avoid;
  }
}
