/* Chickadee CMS marketing site.
   The palette is the bird: black cap, white cheek, grey wing, buff flank.
   The only other colour is the periwinkle disc behind the logo, which is part
   of favicon.svg. */

@font-face {
  font-family: "Besley";
  src: url("fonts/besley.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --cap: #1d232b;
  --wing: #55606e;
  --wing-light: #7b8794;
  --cheek: #ffffff;
  --buff: #e2d3bb;
  --rule: #d9dde2;

  --display: "Besley", Georgia, serif;
  --text: "Public Sans", system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 72rem;
  --band: clamp(3.5rem, 8vw, 7rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--cheek);
  color: var(--cap);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

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

h1,
h2 {
  font-family: var(--display);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.75rem);
}
h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}
h3,
dt {
  font-family: var(--text);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--cap);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible {
  outline-color: var(--buff);
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--buff);
  color: var(--cap);
  padding: 0.5rem 0.9rem;
  z-index: 10;
}
.skip:focus {
  top: 0.5rem;
}

/* Buttons */

.button {
  display: inline-block;
  padding: 0.8rem 1.35rem;
  border: 2px solid transparent;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}
.button-buff {
  background: var(--buff);
  color: var(--cap);
}
.button-buff:hover {
  background: var(--cheek);
}
.button-outline {
  border-color: currentColor;
}
.button-outline:hover {
  background: rgb(255 255 255 / 0.12);
}

/* Header and hero share the wing-grey band */

.top {
  background: var(--cap);
  color: var(--cheek);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: clamp(1.1rem, 4.6vw, 1.3rem);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.brand img {
  width: 2.6rem;
  height: 2.6rem;
}
.nav-inline ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.6rem;
  list-style: none;
  font-weight: 600;
}
.nav-inline a:not(.button) {
  display: inline-block;
  padding-block: 0.5rem;
  text-decoration: none;
}
.nav-inline a:not(.button):hover {
  text-decoration: underline;
}
.button-small {
  padding: 0.5rem 0.95rem;
}

/* Phone menu: a labelled button that opens a panel from the right. It is a
   <dialog>, so the browser keeps focus inside it, closes it on Escape and
   returns focus to the button. */
.menu-button,
.menu-close {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.menu-button:hover,
.menu-close:hover {
  background: rgb(255 255 255 / 0.12);
}
@media (max-width: 47.99rem) {
  .masthead {
    flex-wrap: nowrap;
  }
  .js .nav-inline {
    display: none;
  }
  .js .menu-button {
    display: inline-flex;
  }
}

.menu {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(20rem, 86vw);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 1.1rem 1.25rem 2rem;
  border: 0;
  background: var(--cap);
  color: var(--cheek);
  overflow-y: auto;
}
.menu::backdrop {
  background: rgb(29 35 43 / 0.6);
}
.menu[open] {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.menu-close {
  display: inline-flex;
  align-self: flex-end;
}
.menu ul {
  list-style: none;
  border-top: 1px solid rgb(255 255 255 / 0.24);
}
.menu li {
  border-bottom: 1px solid rgb(255 255 255 / 0.24);
}
.menu li a {
  display: block;
  padding: 0.95rem 0.25rem;
  font-size: 1.1875rem;
  font-weight: 600;
  text-decoration: none;
}
.menu li a:hover {
  text-decoration: underline;
}
.menu .button {
  text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .menu[open] {
    animation: menu-in 0.18s ease-out;
  }
  @keyframes menu-in {
    from {
      transform: translateX(100%);
    }
  }
}

/* The photo sits behind the header and the hero. Words are on charcoal panels
   at 85% opacity. Over a pure white pixel, the worst the photo could do, white
   text on that panel still measures about 10:1. Below 0.78 it drops under the
   7:1 of WCAG AAA, so do not go lower than that. */
.has-photo {
  --veil: 0.85;
  background: url("img/hero-village.jpg") top center / max(100%, 110rem) auto no-repeat var(--wing);
}
.has-photo .top,
.has-photo .hero-words {
  background: rgb(29 35 43 / var(--veil));
}
.hero-band {
  overflow-x: clip;
}
.hero {
  display: grid;
  gap: 2.5rem;
  padding-top: clamp(2rem, 5vw, 4rem);
}
.hero h1 {
  font-size: clamp(2.5rem, 4.7vw, 4rem);
}
.hero-lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.5vw, 1.25rem);
  line-height: 1.5;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.hero-words {
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border-radius: 6px;
  background: var(--cap);
  color: var(--cheek);
}

/* The screenshots hang below the band's lower edge. */
.hero-shots {
  --hang: 3.5rem;
  position: relative;
  margin-bottom: calc(-1 * var(--hang));
  padding-right: clamp(0rem, 9vw, 4rem);
}
.shot {
  border: 1px solid var(--cap);
  border-radius: 6px;
  overflow: hidden;
  background: var(--cheek);
}
.hero-shots > .shot:first-child {
  box-shadow: 12px 14px 0 rgb(29 35 43 / 0.45);
}
.shot-phone {
  position: absolute;
  right: 0;
  bottom: -1.5rem;
  width: clamp(7rem, 17vw, 12rem);
  border-width: 5px;
  border-radius: 18px;
  box-shadow: -10px 14px 0 rgb(29 35 43 / 0.45);
}
@media (min-width: 64rem) {
  .hero {
    grid-template-columns: minmax(0, 6fr) minmax(0, 7fr);
    align-items: center;
    gap: 3.5rem;
    padding-top: 3rem;
  }
  .hero {
    padding-bottom: 0;
  }
  .hero-words {
    margin-bottom: 3rem;
  }
  /* The desktop screenshot runs off the right edge of the page. */
  .hero-shots {
    padding-right: 0;
  }
  .hero-shots > .shot:first-child {
    width: 135%;
    max-width: none;
  }
}

/* Bands */

.band {
  padding-block: var(--band);
  background: var(--cheek);
}
.band-first {
  padding-top: calc(var(--band) + 5.5rem);
}
.band-flush {
  padding-top: 0;
}
.band-buff {
  background: var(--buff);
}
.band-cap {
  background: var(--cap);
  color: var(--cheek);
}

.lede {
  margin-top: 1rem;
  max-width: 40rem;
  font-size: 1.1875rem;
}

/* What residents get */

.split {
  display: grid;
  gap: 2.5rem clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (min-width: 60rem) {
  .split {
    grid-template-columns: 5fr 6fr;
  }
}

.listing {
  margin-top: 2rem;
  border-top: 2px solid var(--cap);
}
.listing div {
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--rule);
}
.listing dd {
  margin-top: 0.15rem;
  color: var(--wing);
}

/* What staff get */

.jobs {
  display: grid;
  gap: clamp(3rem, 7vw, 5.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.job {
  display: grid;
  gap: 1.25rem clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.job h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.2;
}
.job p {
  margin-top: 0.6rem;
  max-width: 30rem;
  color: var(--wing);
}
@media (min-width: 60rem) {
  .job {
    grid-template-columns: 4fr 7fr;
  }
  .job:nth-child(even) {
    grid-template-columns: 7fr 4fr;
  }
  .job:nth-child(even) .job-words {
    order: 2;
  }
}

/* Themes */

.themes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem 1.5rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  list-style: none;
}
.themes h3 {
  margin-top: 0.9rem;
}
.themes p {
  margin-top: 0.15rem;
  font-size: 0.9375rem;
}

/* Details */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 2rem clamp(1.5rem, 3vw, 3rem);
  margin-top: 2.5rem;
}
.facts div {
  padding-top: 1rem;
  border-top: 2px solid var(--cap);
}
.facts dd {
  margin-top: 0.3rem;
  color: var(--wing);
}

/* Demo */

.demo {
  display: grid;
  gap: 2rem;
  align-items: end;
}
.demo p {
  margin-top: 1rem;
  max-width: 34rem;
  color: #c9cfd6;
  font-size: 1.1875rem;
}
@media (min-width: 52rem) {
  .demo {
    grid-template-columns: 1fr auto;
  }
}

/* Footer */

.foot {
  background: var(--cap);
  color: #c9cfd6;
  font-size: 0.9375rem;
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.16);
}

/* 404 */

.lost {
  min-height: 60vh;
  padding-block: var(--band);
}
.lost p {
  margin-top: 1rem;
}
