/* Tokens from the BeforeYouMove Figma design system */
:root {
  --blue: #3d76f5;
  --blue-hover: #2f64dc;
  --black: #000;
  --white: #fff;
  --neutral-600: #666;
  --neutral-200: #e4e4e7;
  --sky: #d1ebff; /* matches the illustration's sky */
  --error: #c0362c;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

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

html {
  min-height: 100%;
  background: var(--sky);
}

/* One screen, no scrolling: text on top, the illustration fills the rest. */
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--black);
  background: var(--sky);
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 19px 24px 0;
}

/* Fills the space under the text. The square illustration is drawn with its
   empty sky cropped off the top (house roof starts ~49% down), so the house
   sits right under the text. It always spans the full width and is scaled up
   on tall screens so the ground reaches the bottom; extra ground is cropped. */
.art {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  container-type: size;
}

.art::before {
  --w: max(100cqw, 760px, 100cqh / 0.54);
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/hero.png") no-repeat;
  background-size: var(--w) auto;
  background-position: 60% calc(var(--w) * -0.46);
}

.brand img {
  display: block;
  height: 32px;
  width: auto;
}

.hero {
  max-width: 734px;
  margin: clamp(16px, 8vh, 120px) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.badge {
  margin: 0 0 clamp(12px, 2.2vh, 20px);
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--white);
  color: var(--blue);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.28px;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  /* Scales with width and height so everything fits on one screen */
  font-size: clamp(32px, min(8vw, 7vh), 64px);
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.lede {
  max-width: 526px;
  margin: clamp(12px, 2.2vh, 20px) 0 clamp(16px, 3.5vh, 32px);
  color: var(--neutral-600);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.32px;
}

.waitlist {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 460px;
}

.waitlist input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: var(--white);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.32px;
  color: var(--black);
}

.waitlist input[type="email"]::placeholder {
  color: var(--neutral-600);
}

.waitlist input[type="email"][aria-invalid="true"] {
  border-color: var(--error);
}

.waitlist button {
  padding: 14px 24px;
  border: 0;
  border-radius: 100px;
  background: var(--blue);
  color: var(--white);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.32px;
  white-space: nowrap;
  cursor: pointer;
}

.home-link {
  margin: 0 auto;
  padding: 14px 24px;
  border-radius: 100px;
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
  font-size: 16px;
  letter-spacing: -0.32px;
}

.waitlist button:hover {
  background: var(--blue-hover);
}

.waitlist button:disabled {
  opacity: 0.6;
  cursor: progress;
}

:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

.status {
  min-height: 1.6em;
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -0.28px;
  color: var(--neutral-600);
}

.status[data-state="error"] {
  color: var(--error);
}

.status[data-state="success"] {
  color: var(--black);
}

.foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--white);
  text-shadow: 0 1px 2px rgb(0 0 0 / 35%);
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

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

@media (max-width: 520px) {
  .waitlist {
    flex-direction: column;
  }
  .waitlist button {
    width: 100%;
  }
}

/* Phones held sideways are too short for one screen: let them scroll
   rather than hide the form. */
@media (max-height: 520px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  .art {
    flex: 1 0 200px;
  }
}
