/* All of It: holding page styles.
   The colours, type and sizes below repeat src/styles/tokens.css so that
   this folder can be published on its own. If a token changes there before
   launch, change it here too. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/fraunces-300.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-500.woff2") format("woff2");
}

:root {
  --colour-ground: #f5f1ea; /* Linen */
  --colour-surface: #fbf8f3;
  --colour-ink: #2a2521;
  --colour-muted: #6b625a;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--colour-ground);
  color: var(--colour-ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1,
p {
  margin: 0;
}

/* One centred column, sized like the phone screens on the design canvas. */
.page {
  width: 100%;
  max-width: 27.5rem;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 3rem 1.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page--centred {
  justify-content: center;
}

.motif {
  display: block;
  width: 100%;
  max-width: 20.875rem;
  height: auto;
}

.name {
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 3.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.name--small {
  margin-top: 0;
  font-size: 2rem;
  color: var(--colour-muted);
}

.strapline {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1.3;
}

.descriptor {
  margin-top: 0.5rem;
  color: var(--colour-muted);
}

.idea {
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.25rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.signup {
  width: 100%;
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.signup__label {
  font-weight: 500;
}

/* The border is the muted colour, not the pale sheet border, so the edge
   of the field is clear to everyone (at least 3:1 against the page). */
.signup__input {
  width: 100%;
  height: 3.375rem;
  margin-top: 0.5rem;
  padding: 0 1.25rem;
  border: 1px solid var(--colour-muted);
  border-radius: 1.6875rem;
  background: var(--colour-surface);
  color: var(--colour-ink);
  font: inherit;
  font-size: 1rem;
  appearance: none;
}

/* Primary button: ink fill, linen text, 54px tall, fully rounded (brief section 4). */
.button {
  width: 100%;
  height: 3.375rem;
  margin-top: 0.875rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 1.6875rem;
  background: var(--colour-ink);
  color: var(--colour-ground);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

/* The promise under the button: one email, nothing else. */
.signup__note {
  margin-top: 0.875rem;
  color: var(--colour-muted);
  text-align: center;
}

/* The prices, shown plainly (brief section 9). */
.prices {
  margin-top: 1.75rem;
  text-align: center;
  text-wrap: balance;
}

.privacy {
  margin-top: 1.75rem;
  font-size: 0.8125rem;
  color: var(--colour-muted);
  text-align: center;
}

/* Same colour as the text around it, so the underline is what marks it as a link. */
.privacy a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.back {
  margin-top: 2.5rem;
}

/* Links get a generous tap area (44px or more). */
.back a {
  display: inline-block;
  padding: 0.75rem 1rem;
  color: var(--colour-ink);
  text-underline-offset: 0.2em;
}

/* A clear focus ring for keyboard users. */
:focus-visible {
  outline: 2px solid var(--colour-ink);
  outline-offset: 3px;
}

/* The map assembles once, then rests.

   Order, over about four seconds:
   1. the far points drift in from the edges (what's out there),
   2. the centre and the near points arrive,
   3. the links draw outwards from the centre,
   4. the centre begins to glow, as a hub does in the app.

   It runs once and stops, so no pause control is needed (WCAG 2.2.2), and
   it only runs for people who have not asked their device to reduce motion.
   Without it, the map simply appears complete. */
@media (prefers-reduced-motion: no-preference) {
  .motif__point {
    transform-box: fill-box;
    transform-origin: center;
    animation: motif-arrive 1400ms ease-out both;
  }

  /* Where each point drifts in from: a short, soft distance. */
  .motif__point--from-nw {
    --from-x: -10px;
    --from-y: -8px;
  }

  .motif__point--from-ne {
    --from-x: 10px;
    --from-y: -8px;
  }

  .motif__point--from-se {
    --from-x: 10px;
    --from-y: 8px;
  }

  .motif__point--from-sw {
    --from-x: -10px;
    --from-y: 8px;
  }

  .motif__point--from-n {
    --from-x: 0px;
    --from-y: -10px;
  }

  .motif__point--from-s {
    --from-x: 0px;
    --from-y: 10px;
  }

  /* 1. Far points, one after another. */
  .motif__point--far.motif__point--1 {
    animation-delay: 0ms;
  }

  .motif__point--far.motif__point--2 {
    animation-delay: 120ms;
  }

  .motif__point--far.motif__point--3 {
    animation-delay: 240ms;
  }

  .motif__point--far.motif__point--4 {
    animation-delay: 360ms;
  }

  .motif__point--far.motif__point--5 {
    animation-delay: 480ms;
  }

  .motif__point--far.motif__point--6 {
    animation-delay: 600ms;
  }

  /* 2. The centre, then the near points. */
  .motif__point--centre {
    animation-name: motif-appear;
    animation-delay: 800ms;
  }

  .motif__point--near.motif__point--1 {
    animation-delay: 1000ms;
  }

  .motif__point--near.motif__point--2 {
    animation-delay: 1120ms;
  }

  .motif__point--near.motif__point--3 {
    animation-delay: 1240ms;
  }

  .motif__point--near.motif__point--4 {
    animation-delay: 1360ms;
  }

  /* 3. Links draw from the centre outwards. Each path counts as length 1
        (pathLength in the HTML), so one dash can cover or uncover it. */
  .motif__link {
    stroke-dasharray: 1;
    animation: motif-draw 900ms ease-in-out both;
  }

  .motif__link--1 {
    animation-delay: 2000ms;
  }

  .motif__link--2 {
    animation-delay: 2150ms;
  }

  .motif__link--3 {
    animation-delay: 2300ms;
  }

  .motif__link--4 {
    animation-delay: 2450ms;
  }

  /* 4. The centre glows. */
  .motif__halo {
    transform-box: fill-box;
    transform-origin: center;
    animation: motif-glow 900ms ease-out 3200ms both;
  }
}

@keyframes motif-arrive {
  from {
    opacity: 0;
    transform: translate(var(--from-x, 0), var(--from-y, 0));
  }

  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes motif-appear {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes motif-draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes motif-glow {
  from {
    opacity: 0;
    transform: scale(0.6);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* A little more room and a larger name on wider screens. */
@media (min-width: 48rem) {
  .page {
    padding-top: 4.5rem;
  }

  .name {
    font-size: 4.5rem;
  }
}
