/* Landing pages (index.html, de.html). The other pages carry their own styles.

   Four levels of type, and nothing in between:
   display  Burddd, for the one line a block is about (h1, h2)
   eyebrow  small capitals above a heading, says which part of the app this is
   lead     the sentence right under the h1
   body     everything else; .small for terms, captions and the footer */

@font-face {
  font-family: 'Burddd';
  src: url('Burddd.otf') format('opentype');
  font-display: swap;
}

@font-face {
  font-family: 'SF Pro Rounded';
  src: url('SF-Pro-Rounded-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'SF Pro Rounded';
  src: url('SF-Pro-Rounded-Semibold.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #111;
  --body: #3a3a3a;
  --quiet: #6f6f6f;
  --dark: #174A09;
  --leaf: #3d7a22;
  --light: #F1FDE1;
  --line: #e9e9e4;
  --gutter: 20px;
}

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

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

/* The artwork has a white ground, so the page has to be white too. */
body {
  background: #fff;
  color: var(--body);
  font-family: 'SF Pro Rounded', ui-rounded, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: clip;
}

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

a {
  color: var(--dark);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Type */

h1,
h2 {
  font-family: 'Burddd', 'SF Pro Rounded', sans-serif;
  font-weight: normal;
  /* Burddd's letters are small for their size: 100px reads like 38px of text. */
  /* …and they sit in a tall box: wrapped lines need a line height well under 1. */
  line-height: 0.62;
  padding-top: 0.12em;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(92px, 25vw, 168px);
}

h2 {
  font-size: clamp(68px, 17vw, 100px);
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--leaf);
  margin-bottom: 6px;
}

.lead {
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
}

.small {
  font-size: 15px;
  color: var(--quiet);
}

/* Top bar */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
}

.top .logo {
  width: 150px;
}

.top a {
  font-size: 15px;
  color: var(--quiet);
}

/* Hero: the robin behind its hedge */

.hero {
  display: grid;
  gap: 8px;
  text-align: center;
  padding: 8px 0 0;
}

.stage {
  position: relative;
  width: min(420px, 92vw);
  margin: 0 auto;
}

.stage .twig {
  position: absolute;
  pointer-events: none;
}

.stage .twig.a {
  width: 46%;
  top: -3%;
  right: -13%;
  rotate: -8deg;
}

.stage .twig.b {
  width: 62%;
  bottom: 2%;
  left: -20%;
  rotate: 8deg;
}

.hero .lead {
  max-width: 26em;
  margin: 18px auto 0;
}

.download-btn {
  position: relative;
  display: inline-block;
  margin-top: 20px;
  text-decoration: none;
  transition: scale 0.1s ease-out;
}

.download-btn:hover {
  scale: 1.03;
}

.download-btn img {
  height: 84px;
  width: auto;
}

.download-btn span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 18px;
  padding-right: 4px;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}

.hero .small {
  margin-top: 6px;
}

/* Feature blocks: words on one side, something from the app on the other */

.feature {
  display: grid;
  gap: 28px;
  align-items: center;
  padding: 72px 0 0;
}

.feature .words {
  max-width: 30em;
}

.feature h2 {
  margin-bottom: 22px;
}

.feature .media {
  position: relative;
  width: min(400px, 100%);
  margin: 0 auto;
}

/* The thicket: two branches over a bird. They part once the block is on screen
   (site.js sets .parted); without script they are parted from the start. */

.peek .branch {
  position: absolute;
  pointer-events: none;
  transition: translate 1.1s cubic-bezier(0.3, 0, 0.2, 1), rotate 1.1s cubic-bezier(0.3, 0, 0.2, 1);
}

.peek .branch.l {
  width: 92%;
  left: -52%;
  top: 14%;
  rotate: -16deg;
}

.peek .branch.r {
  width: 68%;
  right: -44%;
  top: -4%;
  rotate: 14deg;
}

.js .peek:not(.parted) .branch.l {
  translate: 46% 6%;
  rotate: 4deg;
}

.js .peek:not(.parted) .branch.r {
  translate: -52% 12%;
  rotate: -6deg;
}

@media (prefers-reduced-motion: reduce) {
  .peek .branch {
    transition: none;
  }
}

/* The bird's page, as the app lays it out: fact, then where it lives */

.sheet {
  background: var(--light);
  border-radius: 28px;
  padding: 24px;
}

.sheet .name {
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
}

.sheet .latin {
  font-style: italic;
  font-size: 15px;
  color: var(--quiet);
}

.sheet .fact {
  margin-top: 10px;
  color: var(--dark);
}

.sheet .habitat {
  margin-top: 18px;
  border-radius: 16px;
  background: #fff;
  padding: 14px 14px 12px;
}

.sheet .habitat .eyebrow {
  font-size: 11px;
  margin: 8px 0 0;
}

.sheet .habitat p:last-child {
  font-size: 16px;
  color: var(--ink);
}

/* The flock */

.flock {
  list-style: none;
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.flock li {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  align-items: center;
  font-size: 16px;
  line-height: 1.45;
}

.flock .name {
  display: block;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}

/* Milestones */

.badges {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* A band of light green across the whole window, for the home screen */

.band {
  background: var(--light);
  margin: 72px calc(50% - 50vw) 0;
  padding: 56px calc(50vw - 50%) 60px;
}

.band .feature {
  padding-top: 0;
}

.widgets {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.widget {
  aspect-ratio: 1;
  background: #fff;
  border-radius: 22%;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(23, 74, 9, 0.14);
  display: grid;
  place-items: center;
}

.widget.four {
  grid-template-columns: 1fr 1fr;
  padding: 8%;
}

.widgets .small {
  margin-top: 10px;
  color: var(--dark);
}

/* The one dark block: what the app is not */

.panel {
  background: var(--dark);
  color: #e4f3d6;
  border-radius: 32px;
  margin-top: 72px;
  /* Room at the bottom for the leaf, so it never lies on the text. */
  padding: 44px 24px 104px;
  position: relative;
  overflow: hidden;
}

.panel h2 {
  color: #fff;
  margin-bottom: 22px;
}

.panel .eyebrow {
  color: #a9d98a;
}

.panel p,
.panel h2 {
  position: relative;
  z-index: 1;
}

.panel p {
  max-width: 32em;
}

.panel .leaf {
  position: absolute;
  width: 150px;
  right: -34px;
  bottom: -50px;
  rotate: -24deg;
  opacity: 0.9;
}

/* Questions */

.faq {
  padding: 72px 0 0;
  max-width: 720px;
  margin: 0 auto;
}

.faq h2 {
  margin-bottom: 14px;
}

.faq h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.faq p {
  margin-top: 4px;
}

/* Last word */

.closing {
  text-align: center;
  padding: 72px 0 0;
}

.closing .bush {
  width: 190px;
  margin: 0 auto 4px;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 24px 0 40px;
  text-align: center;
}

footer a {
  color: var(--quiet);
  margin: 0 8px;
}

/* Wide windows: two columns, sides alternating */

@media (min-width: 860px) {
  body {
    font-size: 19px;
  }

  .top {
    padding-top: 24px;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 40px;
    text-align: left;
    padding-top: 40px;
  }

  .hero .stage {
    order: 2;
    width: 100%;
    max-width: 460px;
  }

  .hero .lead {
    margin-left: 0;
  }

  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    padding-top: 120px;
  }

  .feature.flip .media {
    order: -1;
  }

  .feature .media {
    width: min(440px, 100%);
  }

  /* Beside a column of text the left branch has less room to swing out. */
  .peek .branch.l {
    width: 78%;
    left: -30%;
  }

  .feature.wide {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .flock {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 40px;
  }

  .flock li {
    grid-template-columns: 1fr;
    gap: 4px;
    align-content: start;
  }

  .flock img {
    width: 78%;
    margin: 0 auto;
  }

  .band {
    margin-top: 120px;
    padding-top: 88px;
    padding-bottom: 96px;
  }

  .panel {
    margin-top: 120px;
    padding: 72px 72px 68px;
  }

  .panel .leaf {
    width: 260px;
    right: -30px;
    bottom: -90px;
  }

  .faq,
  .closing {
    padding-top: 120px;
  }
}
