/*
 * BittyBites landing page. Sizes are taken from the 1920px-wide design and
 * scaled with --s, one design pixel at the current viewport width.
 */

/*
 * The app's fonts: Sniglet for display headings, SF Pro Rounded for the rest.
 * SF Pro Rounded may only be used on Apple platforms, so it is not served:
 * `ui-rounded` picks it up in Safari, and Nunito, the closest free rounded
 * sans, stands in elsewhere. A browser downloads Nunito only if it needs it.
 */
@font-face {
  font-family: "Sniglet";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/sniglet-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("./assets/fonts/nunito-latin.woff2") format("woff2");
}

:root {
  --s: calc(min(100vw, 1920px) / 1920);
  --olive: rgb(91 105 43);
  --ink: #111;
  /* The design's 56%-opacity section fills, blended over white. */
  --page: rgb(226 228 221);
  --header: rgb(182 201 215);
  --footer: rgb(201 219 237);
  --orange: rgb(240 174 139);
  --blue: rgb(169 197 227);
  --yellow: rgb(250 214 121);
  --pink: rgb(247 200 221);
  --sage: rgb(163 171 136);
  --display: "Sniglet", ui-rounded, system-ui, sans-serif;
  --body: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.15;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: max(56px, calc(88 * var(--s)));
  padding: 0 max(12px, calc(14 * var(--s)));
  background: var(--header);
}

.site-header__logo img {
  width: max(40px, calc(71 * var(--s)));
  height: auto;
}

.site-header__nav {
  display: flex;
  gap: max(1rem, calc(36 * var(--s)));
  font-size: max(1rem, calc(37 * var(--s)));
}

/* Bands and decorations ---------------------------------------------------- */

.band {
  position: relative;
  overflow: hidden;
}

.band > :not(.decoration) {
  position: relative;
  z-index: 1;
}

.band--hero {
  background: var(--page);
}

.band--orange {
  background: var(--orange);
}

.band--blue {
  background: var(--blue);
}

.band--yellow {
  background: var(--yellow);
}

.band--pink {
  background: var(--pink);
}

.band--sage {
  background: var(--sage);
}

.decoration {
  position: absolute;
  z-index: 0;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  pointer-events: none;
}

/* Hero --------------------------------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(72px, calc(300 * var(--s))) 16px max(56px, calc(150 * var(--s)));
  text-align: center;
}

.hero__title {
  margin: 0;
}

.hero__wordmark {
  width: max(240px, calc(1074 * var(--s)));
}

.hero__tagline {
  margin: max(12px, calc(10 * var(--s))) 0 max(28px, calc(50 * var(--s)));
  color: var(--olive);
  font-family: var(--display);
  font-size: max(1.35rem, calc(76 * var(--s)));
  line-height: 1.3;
}

/* Signup ------------------------------------------------------------------- */

.signup {
  width: min(100%, max(300px, calc(840 * var(--s))));
  margin: 0 auto;
  text-align: left;
  font-size: max(1rem, calc(37.5 * var(--s)));
}

.signup__prompt {
  margin: 0 0 0.9em;
}

.signup__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em 0.5em;
}

.signup__input {
  flex: 1 1 12em;
  min-width: 0;
  padding: 0.15em 0.1em;
  border: 0;
  border-bottom: 1.5px solid currentcolor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.signup__input::placeholder {
  color: rgb(0 0 0 / 0.35);
}

.signup__input:focus-visible {
  outline: none;
  border-bottom-color: var(--olive);
  box-shadow: 0 1.5px 0 var(--olive);
}

.signup__button {
  padding: 0.35em 0.9em;
  border: 0;
  border-radius: 999px;
  background: var(--olive);
  color: #fff;
  font: inherit;
  font-size: 0.85em;
  cursor: pointer;
}

.signup__button:hover,
.signup__button:focus-visible {
  background: rgb(70 82 30);
}

/* Feature sections --------------------------------------------------------- */

.feature {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.feature--allergens {
  grid-template-columns: minmax(0, 755fr) minmax(0, 1165fr);
}

.feature--guidance {
  grid-template-columns: minmax(0, 900fr) minmax(0, 1020fr);
}

.feature--families {
  grid-template-columns: minmax(0, 600fr) minmax(0, 820fr) minmax(0, 500fr);
}

.feature__title {
  grid-column: 1 / -1;
  padding: max(40px, calc(70 * var(--s))) max(16px, calc(64 * var(--s))) 0;
}

.feature--guidance .copy {
  align-self: start;
  padding-top: max(12px, calc(40 * var(--s)));
}

.media {
  position: relative;
  aspect-ratio: var(--aspect);
}

.phone {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: var(--w);
  max-width: none;
  transform: translate(-50%, -50%) rotate(var(--rot));
}

.media__arrow {
  position: absolute;
  z-index: 1;
  left: var(--x);
  top: var(--y);
  width: var(--w);
}

.copy {
  align-self: start;
  padding: max(40px, calc(110 * var(--s))) max(16px, calc(70 * var(--s)));
}

.copy--center {
  text-align: center;
}

.heading,
.subheading,
.launching__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.2;
}

.heading {
  width: calc(var(--span, 900) * var(--s));
  font-size: max(1.9rem, calc(var(--size, 110) * var(--s)));
}

.copy--center .heading {
  margin-inline: auto;
}

.subheading {
  white-space: nowrap;
  font-size: max(1.6rem, calc(var(--size, 80) * var(--s)));
}

.squiggle {
  width: auto;
  height: max(9px, calc(30 * var(--s)));
  margin: max(4px, calc(10 * var(--s))) 0 max(18px, calc(48 * var(--s)));
}

.copy--center .squiggle {
  margin-inline: auto;
}

.squiggle--small {
  height: max(9px, calc(32 * var(--s)));
  margin-bottom: max(10px, calc(20 * var(--s)));
}

.copy__body {
  margin: 0;
  font-size: max(1.05rem, calc(52 * var(--s)));
  line-height: 1.05;
}

.copy__body--small {
  font-size: max(1rem, calc(37.5 * var(--s)));
}

.aside {
  position: relative;
  width: fit-content;
  max-width: max(18rem, calc(500 * var(--s)));
  margin-top: max(36px, calc(110 * var(--s)));
}

.aside__arrow {
  position: absolute;
}

.aside--stay-on-track {
  margin-left: 0;
}

.aside--stay-on-track .aside__arrow {
  right: 100%;
  top: 0.4em;
  width: calc(245 * var(--s));
}

.aside--cooking {
  max-width: max(18rem, calc(600 * var(--s)));
  margin-left: calc(90 * var(--s));
}

.aside--cooking .aside__arrow {
  left: 62%;
  top: calc(100% + 0.3em);
  width: calc(245 * var(--s));
}

/* Launching soon ----------------------------------------------------------- */

.launching {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(56px, calc(170 * var(--s))) 16px max(72px, calc(260 * var(--s)));
  text-align: center;
}

.launching__logo {
  width: max(120px, calc(290 * var(--s)));
}

.launching__title {
  margin: max(16px, calc(30 * var(--s))) 0 max(24px, calc(70 * var(--s)));
  color: var(--olive);
  font-size: max(2.2rem, calc(150 * var(--s)));
}

/* Documents: Privacy Policy, Terms of Use, Support ------------------------- */

.prose {
  max-width: 46rem;
  margin: 0 auto;
  padding: max(32px, calc(80 * var(--s))) 16px max(48px, calc(110 * var(--s)));
  font-size: 1.0625rem;
  line-height: 1.6;
}

.prose__title {
  margin: 0;
  color: var(--olive);
  font-family: var(--display);
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 400;
  line-height: 1.1;
}

.prose__updated {
  margin: 0.25rem 0 0;
  color: rgb(17 17 17 / 65%);
}

.prose h2 {
  margin: 2.5rem 0 0.5rem;
  font-size: 1.4rem;
  line-height: 1.25;
}

.prose h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.1rem;
  line-height: 1.3;
}

.prose p,
.prose ul {
  margin: 0.75rem 0;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose a {
  color: var(--olive);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.callout {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  border: 2px solid;
  border-radius: 16px;
}

.callout > :first-child {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout--summary {
  border-color: var(--blue);
  background: rgb(169 197 227 / 40%);
}

.callout--warning {
  border-color: var(--yellow);
  background: rgb(250 214 121 / 40%);
}

.prose__table {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgb(17 17 17 / 15%);
  text-align: left;
  vertical-align: top;
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: ". links social" ". copyright social";
  align-items: center;
  row-gap: 0.8em;
  padding: max(28px, calc(70 * var(--s))) max(16px, calc(70 * var(--s)));
  background: var(--footer);
  font-size: max(1rem, calc(37 * var(--s)));
  text-align: center;
}

.site-footer__links {
  grid-area: links;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.site-footer__copyright {
  grid-area: copyright;
  margin: 0;
}

.site-footer__social {
  grid-area: social;
  display: flex;
  justify-content: flex-end;
  gap: max(12px, calc(44 * var(--s)));
}

.site-footer__social img {
  width: max(36px, calc(97 * var(--s)));
}

/* Narrow screens ----------------------------------------------------------- */

@media (max-width: 800px) {
  .feature,
  .feature--allergens,
  .feature--guidance {
    grid-template-columns: minmax(0, 1fr);
  }

  .heading {
    width: auto;
  }

  .copy__body {
    line-height: 1.3;
  }

  .feature__title {
    order: -2;
  }

  .feature .copy {
    order: -1;
    padding-bottom: 0;
  }

  .feature > .media {
    width: min(100%, 520px);
    justify-self: center;
  }

  .feature--families {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .feature--families .copy {
    grid-column: 1 / -1;
  }

  .feature--families > .media {
    width: 100%;
  }

  .aside__arrow,
  .media__arrow {
    display: none;
  }

  .aside,
  .aside--cooking {
    margin-left: 0;
    max-width: none;
  }

  .copy--center .aside {
    margin-inline: auto;
  }

  .site-footer {
    grid-template-columns: 1fr;
    grid-template-areas: "links" "copyright" "social";
  }

  .site-footer__social {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
