/* =====
   Fonts
   ===== */

@font-face {
  font-family: "Lexend";
  src: url("/assets/fonts/Lexend-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* ======
   Tokens
   ====== */

:root {
  /* Colours (match the desktop app's AppColours) */
  --bg: #0f0f0f;
  --bg-card: #131315;
  --text-primary: #ffffff;
  --accent-cyan: #00afef;
  --accent-magenta: #ec268f;
  --accent-yellow: #ffe800;
  --gradient: linear-gradient(to right, var(--accent-cyan), var(--accent-magenta), var(--accent-yellow));
  --gradient-diagonal: linear-gradient(to top right, var(--accent-cyan), var(--accent-magenta), var(--accent-yellow));

  /* Effects */
  --tint: rgba(0, 0, 0, 0.3);
  --blur: blur(0.375rem);
  --text-shadow: 0.125rem 0.125rem 0.375rem #000000;

  /* Sizes */
  --header-height: 11.125rem;
  --letter-spacing: -0.02em;

  /* Animation */
  --duration: 300ms;
  --duration-slow: 900ms;
}

/* =====
   Base
   ===== */

/* The design is drawn at 2560px wide, where 1rem = 16px. The root size scales with the
   viewport so every rem value keeps the same proportions on smaller screens */
html {
  font-size: clamp(10px, 100vw / 160, 16px);
}

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

body {
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Lexend", sans-serif;
  font-weight: 400;
  letter-spacing: var(--letter-spacing);
}

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
}

/* ==========
   Background
   ========== */

/* Stays hidden over the dark background until it starts playing, like the desktop app */
.background-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--duration-slow) ease;
}

.background-video.is-ready {
  opacity: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--tint);
  backdrop-filter: var(--blur);
}

/* ======
   Header
   ====== */

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding-left: 2.3125rem;
  background: var(--bg-card);
}

.brand {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand__logo {
  width: auto;
  height: 6.4375rem;
}

.brand__name {
  font-size: 3.5rem;
  font-weight: 300;
  text-shadow: var(--text-shadow);
}

/* ====
   Hero
   ==== */

/* The title sits in the middle row so it's centred on the screen, with the button hanging below it */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  height: 100vh;
  padding: 0 1.5rem;
  text-align: center;
}

.hero__title {
  grid-row: 2;
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1.25;
  /* drop-shadow instead of text-shadow, as text-shadow would paint over the gradient text */
  filter: drop-shadow(0 0.375rem 0.5625rem rgba(0, 0, 0, 0.5));
}

/* One gradient runs across the whole first line and only shows through the highlighted words */
.hero__title-gradient {
  display: inline-block;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero__title-plain {
  color: var(--text-primary);
}

.hero__button {
  grid-row: 3;
  align-self: start;
  /* Sized by its padding so the box fits the label on one line, at the Figma height of 82px */
  padding: 1.375rem 2rem;
  margin-top: 1.25rem;
  border: 0.25rem solid transparent;
  border-radius: 0.9375rem;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--gradient-diagonal) border-box;
  box-shadow: 0 0.375rem 1.125rem 0.5rem rgba(0, 0, 0, 0.15);
  font-size: 1.5rem;
  line-height: 1.25;
  white-space: nowrap;
  text-shadow: var(--text-shadow);
  transition: transform var(--duration) ease;
}

.hero__button:hover {
  transform: scale(1.05);
}

/* ============
   Accessibility
   ============ */

:focus-visible {
  outline: 0.125rem solid var(--accent-cyan);
  outline-offset: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
