/* Colours, font and the mark follow apps/web (src/styles/tokens.css and the marketing logo). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/inter-latin.woff2") format("woff2");
}

:root {
  --background: #ffffff;
  --foreground: #16191d;
  --border: #e4e7eb;
  --ring: #0f766e;
  --accent: #0f766e;
  --accent-foreground: #ffffff;
  --accent-subtle: #e9f6f4;
  --accent-subtle-foreground: #0b5e57;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f1114;
    --foreground: #e7e9ec;
    --border: #262a30;
    --ring: #2bb5a5;
    --accent: #2bb5a5;
    --accent-foreground: #04211e;
    --accent-subtle: #0f2b28;
    --accent-subtle-foreground: #6fdccd;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background-color: var(--background);
  color: var(--foreground);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--accent-subtle);
  color: var(--accent-subtle-foreground);
}

main {
  width: 100%;
  max-width: 44rem;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

p,
h1 {
  margin: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.mark svg {
  width: 1.75rem;
  height: 1.75rem;
}

.wordmark {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.025em;
}

h1 {
  margin-top: 2.5rem;
  font-size: clamp(2rem, 1.2rem + 4vw, 3.5rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.soon {
  margin-top: 1.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background-color: var(--accent-subtle);
  color: var(--accent-subtle-foreground);
  font-size: 0.9375rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.trace {
  display: block;
  width: 100%;
  max-width: 37.5rem;
  height: auto;
  margin-top: 3rem;
  overflow: visible;
}

.trace-base {
  stroke: var(--border);
}

/* Without motion the accent rests on the beat in the middle of the line. */
.trace-pulse {
  stroke: var(--accent);
  stroke-dasharray: 10 90;
  stroke-dashoffset: -45;
}

@media (prefers-reduced-motion: no-preference) {
  .mark-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards;
  }

  .wordmark,
  h1,
  .soon {
    opacity: 0;
    animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .wordmark {
    animation-delay: 0.5s;
  }

  h1 {
    animation-delay: 0.9s;
  }

  .soon {
    animation-delay: 1.3s;
  }

  .trace-base {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw 1.8s cubic-bezier(0.65, 0, 0.35, 1) 1.5s forwards;
  }

  .trace-pulse {
    opacity: 0;
    animation: travel 7s cubic-bezier(0.45, 0, 0.55, 1) 3.4s infinite;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The accent runs the line once, slowly, then rests before the next round. */
@keyframes travel {
  0% {
    stroke-dashoffset: 10;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  62% {
    opacity: 1;
  }
  70%,
  100% {
    stroke-dashoffset: -100;
    opacity: 0;
  }
}
