/* Bonjour Bob — landing page. Only the layout of this page lives here: colours, type, the sheet,
   buttons and the sunrise all come from /system. The page is a scene: always night. */

:root {
  --scene-horizon: clamp(5.5rem, 17vh, 10.5rem);
  --pad: clamp(1rem, 4vw, 3rem);
  --title: clamp(2.25rem, min(5.2vw, 9vh), 4.75rem);
  --lead: clamp(1.0625rem, min(1.55vw, 2.5vh), 1.375rem);
}

html {
  height: 100%;
  background: var(--color-sky-top);
}

/* Exactly one screen when the content fits (it does from 360x740 up);
   on a smaller window the page simply grows and scrolls, nothing is clipped. */
.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* never wider than the screen, whatever the content */
  grid-template-rows: auto minmax(0, 1fr) var(--scene-horizon);
  color: var(--color-on-scene-soft);
}

.landing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: clamp(1rem, 3.2vh, 2rem) var(--pad) 0;
}

/* For the people who already have an account: present, never louder than the sheet. */
.sign-in {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: var(--space-3);
  border-radius: var(--radius-control);
  color: var(--color-on-scene);
  font-weight: var(--weight-strong);
  text-decoration: underline;
  text-decoration-color: var(--color-sun);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.sign-in:hover {
  background: var(--color-raised);
}

.landing .brand {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  color: var(--color-on-scene);
}

.stage {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vh, 1.5rem) var(--pad);
  text-align: center;
}

.title {
  font-size: var(--title);
  line-height: 1.08;
  color: var(--color-on-scene);
}

.together {
  white-space: nowrap;
}

.lead {
  margin-block-start: clamp(0.75rem, 2.4vh, 1.5rem);
  max-width: 43rem;
  font-size: var(--lead);
  text-wrap: pretty;
}

.stage .composer {
  max-width: 44rem;
  margin-block-start: clamp(1.25rem, 4.4vh, 2.75rem);
}

.after {
  margin-block-start: clamp(0.5rem, 1.8vh, 1rem);
  max-width: 44rem;
}

/* One sentence the visitor can borrow: a click writes it in the field. */
.example {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.375rem 0.75rem;
  border: 0;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--color-on-scene-soft);
  font: inherit;
  cursor: pointer;
}

.example-text {
  color: var(--color-on-scene);
  text-decoration: underline;
  text-decoration-color: var(--color-sun);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.example:hover {
  background: var(--color-raised);
}

.note {
  margin-block-start: 0.125rem;
  color: var(--color-on-scene-muted);
  text-wrap: balance;
}

.note.is-message {
  color: var(--color-on-scene);
  font-weight: var(--weight-strong);
}

.horizon {
  pointer-events: none;
}

/* --- the sheet, in three steps: the message, the address, the thanks --- */

.composer-row .send {
  margin-inline-start: auto;
}

/* What the visitor wrote stays in view while they give their address, and can be taken back. */
.recap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-end: clamp(0.5rem, 1.4vh, 0.75rem);
  padding: 0.25rem 0.25rem 0.25rem var(--space-3);
  border-radius: var(--space-3);
  background: var(--color-sunken);
}

.recap-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recap .button {
  min-height: 2.75rem;
}

/* The address is written like the message: on the sheet, in the same size, without a box. */
.composer input[type="email"] {
  min-height: 0;
  margin: var(--space-1) 0 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  caret-color: var(--color-caret);
}

.composer input[type="email"]:focus-visible {
  outline: none;
}

.privacy {
  min-width: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-wrap: balance;
}

.done-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.2;
}

.done-title:focus {
  outline: none;
}

.done-text {
  margin-block-start: var(--space-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  text-wrap: pretty;
}

.composer[data-step="done"] {
  cursor: default;
}

.composer[data-step="done"] .composer-row {
  display: none;
}

/* Once the request is sent, the example has done its job. */
.composer[data-step="email"] ~ .after .example,
.composer[data-step="done"] ~ .after .example {
  visibility: hidden;
}

/* Out of sight and out of reach, but still in the form for robots. */
.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 34rem) {
  :root {
    --scene-horizon: clamp(4.5rem, 13vh, 7rem);
  }

  .stage {
    align-items: stretch;
    justify-content: flex-start;
    padding-block-end: 0.5rem;
    text-align: start;
  }

  .title {
    text-wrap: wrap;
  }

  .example {
    padding-inline: 0;
    text-align: start;
  }

  .note {
    text-wrap: wrap;
  }

  /* Once there is something to send, the example has done its job: its room goes to the sheet. */
  .composer.is-ready ~ .after .example,
  .composer[data-step="email"] ~ .after .example,
  .composer[data-step="done"] ~ .after .example {
    display: none;
  }

  .composer-row {
    flex-wrap: wrap;
  }

  .privacy {
    flex-basis: 100%;
  }
}
