:root {
  --background: #030712;
  --foreground: #fafafa;
  --muted-foreground: rgba(255, 255, 255, 0.6);
  --border-strong: rgba(255, 255, 255, 0.15);
  --white-alpha-10: rgba(255, 255, 255, 0.1);
  --primary: #ecedf1;
  --primary-foreground: #020617;
  --success: #4ade80;
  --danger: #f87171;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;

  --container: 1376px;
  --gutter: 32px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

.page {
  --glow-stops: rgb(153 161 175) 0%, rgb(116 123 136) 25%, rgb(78 84 97) 50%, rgb(59 65 77) 62.5%, rgb(41 46 57) 75%, rgb(22 26 38) 87.5%, rgb(12 17 28) 93.75%, rgb(3 7 18) 100%;
  position: relative;
  /* Locked to the viewport: no scrolling, the screenshot just runs off the bottom. */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  /* Radial glow from the Figma background: centred on the bottom edge of the
     screen and sized as a share of it (1920x1080 frame: 905.6 x 638px), so it
     widens with the screen width and rises with its height. */
  background: radial-gradient(47.17% 59.07% at 50% 100%, var(--glow-stops)) var(--background);
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 24px;
}

.logo img {
  width: 92px;
  height: 32px;
}

.launch {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--foreground);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  /* 38px at 1080px tall (the Figma frame), growing on taller screens. */
  padding-top: clamp(16px, 49vh - 491px, 400px);
  padding-top: clamp(16px, 49dvh - 491px, 400px);
  text-align: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

h1 {
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -1.2px;
  color: #fff;
}

.lede {
  max-width: 448px;
  font-size: var(--text-base);
  line-height: 1.35;
  color: var(--muted-foreground);
}

/* ---------- Signup ---------- */

.signup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 448px;
}

.signup-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 8px 8px 24px;
  border-radius: 9999px;
  background: var(--white-alpha-10);
  transition: box-shadow 0.15s ease;
}

.signup-form:focus-within {
  box-shadow: 0 0 0 1px var(--border-strong);
}

.signup-form input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--text-sm);
  line-height: 1.45;
  outline: none;
}

.signup-form input[type="email"]::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  background: #fff;
}

.btn:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.signup-note {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--muted-foreground);
}

.signup-note.is-success {
  color: var(--success);
}

.signup-note.is-error {
  color: var(--danger);
}

/* ---------- Features ---------- */

.features {
  position: relative;
  z-index: 1;
  /* Four equal columns, so every item is the same width and the dividers
     land on an even grid across the screenshot below. */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
  /* 91px at 1080px tall, growing on taller screens. */
  margin-top: clamp(40px, 21vh - 136px, 300px);
  margin-top: clamp(40px, 21dvh - 136px, 300px);
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-inline: 12px;
  border-left: 1px solid var(--border-strong);
}

/* Same text width in every column, so descriptions wrap alike. */
.feature > div {
  max-width: 200px;
}

.feature h2 {
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.45;
  color: var(--foreground);
}

.feature p {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--muted-foreground);
}

/* ---------- App showcase ---------- */

.showcase {
  position: relative;
  margin-top: 31px;
}

.showcase-inner {
  position: relative;
}

.slideshow {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate; /* keep slide z-indexes below the mobile edge fade */
}

/* The first slide sits in the flow and sets the height; the rest stack on top. */
.slide {
  width: 100%;
  height: auto;
  opacity: 0;
}

.slide:not(:first-child) {
  position: absolute;
  inset: 0;
}

.slide.is-current {
  z-index: 1;
  opacity: 1;
}

/* The next slide fades in over the current one. */
.slide.is-incoming {
  z-index: 2;
  opacity: 0;
  transition: opacity 600ms ease-in-out;
}

.slide.is-incoming.is-visible {
  opacity: 1;
}

/* ---------- Tablet ---------- */

@media (max-width: 1023px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature > div {
    max-width: 280px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 639px) {
  :root {
    --gutter: 16px;
  }

  .hero {
    padding-top: 47px;
  }

  h1 {
    font-size: 32px;
    letter-spacing: -0.8px;
  }

  .lede {
    max-width: 314px;
  }

  .br-desktop {
    display: none;
  }

  .signup {
    padding-inline: 16px;
    max-width: none;
  }

  .signup-form {
    padding-left: 16px;
  }

  /* The design drops the feature row on mobile. */
  .features {
    display: none;
  }

  .page {
    background: radial-gradient(150.5% 93% at 50% 133.9%, var(--glow-stops))
      var(--background);
  }

  .showcase {
    margin-top: 71px;
  }

  /* Screenshot runs off the right edge at a fixed size, like the design. */
  .showcase-inner {
    padding-right: 0;
  }

  .slideshow {
    width: 890px;
  }

  .showcase-inner::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 164px;
    background: linear-gradient(to left, var(--background), rgba(3, 7, 18, 0));
    pointer-events: none;
  }
}

/* Very short screens (e.g. a phone held sideways): allow scrolling so the
   signup form is never cut off. */
@media (max-height: 420px) {
  .page {
    height: auto;
    min-height: 100dvh;
    padding-bottom: 48px;
  }
}

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