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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: #000;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p,
h1 {
  margin: 0;
}

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

/* ---------- Page shell ---------- */

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #000;
}

.background__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Nav (nav-top) ---------- */

.nav-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-32);
}

.nav-top__logo {
  display: block;
  width: var(--logo-width);
  height: var(--logo-height);
}

.nav-top__actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

/* ---------- Button component ----------
 * Variants: default (brand) / secondary (white)
 * States:   Default / Hover (+ focus-visible mirrors hover)
 */

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-20) var(--space-24);
  border: 0;
  border-radius: 0;
  background: var(--surface-brand);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--body-large-size);
  line-height: var(--body-large-leading);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.button__icon {
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
}

.button:hover,
.button:focus-visible {
  background: var(--surface-brand-hover);
}

.button--secondary {
  background: var(--surface-primary);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: var(--surface-brand);
}

.button:focus-visible {
  outline: 2px solid var(--border-strong);
  outline-offset: -2px;
}

.button--block {
  width: 100%;
  justify-content: space-between;
}

.button[disabled] {
  cursor: progress;
  opacity: 0.7;
}

/* ---------- Hero (hero-headline / hero-word) ---------- */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-32);
}

.hero-headline {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  max-width: var(--hero-width);
  font-size: var(--title-large-size);
  line-height: var(--title-large-leading);
  letter-spacing: var(--title-large-tracking);
  font-weight: var(--font-weight-medium);
  text-align: center;
}

/* hero-word — Property 1=Default (light) */
.hero-word {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: var(--surface-primary);
  color: var(--text-primary);
  white-space: nowrap;
}

/* hero-word — Property 1=Variant2 (inverse) */
.hero-word--inverse {
  background: var(--surface-primary-inverse);
  color: var(--text-primary-inverse);
}

/* ---------- Form ---------- */

.form-area {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: var(--space-32);
}

.signup {
  width: var(--form-width);
  background: var(--surface-primary);
  display: flex;
  flex-direction: column;
}

.signup__header {
  padding: var(--space-24) var(--space-24) var(--space-32);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--body-large-size);
  line-height: var(--body-large-leading);
}

.signup__fields {
  display: flex;
  flex-direction: column;
}

.signup__status {
  padding: var(--space-20) var(--space-24);
  font-size: var(--body-large-size);
  line-height: var(--body-large-leading);
  border-bottom: 1px solid var(--border-light);
}

.signup__status[hidden] {
  display: none;
}

.signup__status--error {
  color: var(--text-primary);
}

/* ---------- Input component ----------
 * States: Default / Hover / active (focus or filled)
 */

.input {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--space-20) var(--space-24);
  border: 0;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  background: var(--surface-primary);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--body-large-size);
  line-height: var(--body-large-leading);
  outline: none;
  transition: border-color var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-tertiary);
  opacity: 1;
  transition: color var(--transition-fast);
}

/* Hover */
.input:hover::placeholder {
  color: var(--text-secondary);
}

/* active */
.input:focus {
  border-bottom-color: var(--border-strong);
}

.input:focus::placeholder {
  color: var(--text-primary);
}

.input[aria-invalid="true"] {
  border-bottom-color: var(--border-strong);
}

/* ---------- Responsive ---------- */

/* Desktop: match Figma — headline centred on the full viewport,
 * form pinned 32px from the bottom-right corner. */
@media (min-width: 721px) and (min-height: 640px) {
  .page {
    display: block;
  }

  .hero {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .hero-headline {
    width: min(var(--hero-width), 100%);
    pointer-events: auto;
  }

  .form-area {
    position: absolute;
    right: 0;
    bottom: 0;
  }
}

@media (max-width: 1100px) {
  .hero-headline {
    --title-large-size: 56px;
    --title-large-tracking: -1.96px;
  }
}

@media (max-width: 720px) {
  .nav-top {
    padding: var(--space-24);
  }

  .nav-top__actions .button {
    padding: 12px 16px;
    font-size: 16px;
  }

  .nav-top__actions .button__icon {
    display: none;
  }

  .hero {
    padding: var(--space-32) var(--space-24);
  }

  .hero-headline {
    --title-large-size: 36px;
    --title-large-tracking: -1.26px;
    gap: 4px;
  }

  .hero-word {
    padding: 6px;
  }

  .form-area {
    padding: 0 var(--space-24) var(--space-24);
  }

  .signup {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .nav-top__actions .button--secondary {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .background__video {
    display: none;
  }
}
