/*
  The whole stylesheet for the landing page.

  Colours and font sizes are custom properties in the :root block below, so changing a value there
  changes it everywhere. The page is one screen: the photo fills the window, and the headline and
  the contact button sit centred in the empty space above the robot.
*/

:root {
  --color-background: #0a0b0d;
  --color-text: #ffffff;
  --color-button-border: rgb(255 255 255 / 38%);

  --space-lg: 1.5rem;
  --space-xl: 2.5rem;

  /* The system font of the device, the way the LimX headings are set. */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-title: clamp(2.25rem, 1rem + 4vw, 4.5rem);

  --transition: 180ms ease;
}

/* Reset */

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

body,
h1 {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Tells the browser to draw its own controls and scrollbars in dark colours. */
  color-scheme: dark;
}

/*
  The headline and the button are centred across the page. The padding puts them in the empty space
  above the robot, which starts about a third of the way down the photo. Centring them vertically as
  well would put them over the head.
*/
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100dvh;
  padding: clamp(2rem, 12vh, 8rem) var(--space-lg) var(--space-lg);
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Background */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/*
  Darkens the top of the photo so the headline stays readable against the lighter part of the
  backdrop. It fades out well before the robot.
*/
.backdrop-shade {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgb(10 11 13 / 80%), rgb(10 11 13 / 32%) 34%, transparent 54%);
  pointer-events: none;
}

/* The headline and the button stack, centred, above the two fixed layers. */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

/*
  The headline and the button fade in once, so they do not snap into place while the photo is still
  loading. The button starts a moment later than the headline, so the two arrive one after the other.
*/
.hero__title {
  font-size: var(--font-size-title);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
  animation: fade-up 700ms ease both;
}

.button {
  display: inline-flex;
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid var(--color-button-border);
  border-radius: 999px;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
  animation: fade-up 700ms ease 150ms both;
}

/* On hover the outline button fills, so the label turns dark to stay readable. */
.button:hover {
  background-color: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-background);
}

.button:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

/* Some people set their system to reduce motion. We then turn animation off. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
