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

/* The hidden attribute has to beat any display rule a class sets. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--morning);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
}
h1 { letter-spacing: -0.03em; line-height: 1.02; }
h2 { letter-spacing: -0.02em; line-height: 1.12; }
h3, h4 { letter-spacing: -0.01em; line-height: 1.25; }

/* Standard title for app pages. Only the landing page and the species guide
   use <h1>; every other page titles itself with <h2 class="page-title">,
   always left-aligned. */
.page-title {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  text-align: left;
  margin: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-sub {
  color: var(--loam);
  margin-top: 6px;
}

p { margin: 0; }

a {
  color: var(--turf-ink);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
a:hover { color: var(--turf-strong); }

img, video, svg {
  max-width: 100%;
  display: block;
}
/* width/height attributes are presentational hints; without this the height
   attribute wins over any CSS aspect-ratio. */
img, video {
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--turf) 55%, transparent);
  outline-offset: 2px;
}

/* Every page's content sits in <main class="container ...">. The 24px gutter
   lines up with the header; page wrapper classes may only set vertical
   padding. */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
body .container { padding-inline: var(--gutter); }
@media (max-width: 640px) {
  :root { --gutter: 16px; }
}

.container--narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.page {
  padding-top: 36px;
  padding-bottom: 72px;
}

.muted { color: var(--loam); }

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

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card-pad { padding: 22px; }
@media (max-width: 640px) {
  .card-pad { padding: 18px; }
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sprout);
  color: var(--turf-ink);
  font-size: 26px;
}
.empty-state h3 {
  font-size: 22px;
  margin-bottom: 6px;
}
.empty-state p {
  color: var(--loam);
  max-width: 44ch;
  margin: 0 auto 20px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
