@font-face {
  font-family: "Airbnb Cereal W XBd";
  src: url("/fonts/AirbnbCereal_W_XBd.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Airbnb Cereal W Bd";
  src: url("/fonts/AirbnbCereal_W_Bd.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Airbnb Cereal W Bk";
  src: url("/fonts/AirbnbCereal_W_Bk.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 0 = flat white page, 1 = white card floating on black */
  --p: 0;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: #000000;
  color: #000000;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* White card that shrinks and rounds as you scroll */
.frame {
  position: fixed;
  inset: calc(var(--p) * min(5vw, 28px));
  /* Extra room at the bottom for the footer line on the black backdrop */
  bottom: calc(var(--p) * 56px);
  border-radius: calc(var(--p) * 32px);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Invisible spacer: document must exceed the viewport by the scroll
   distance of the effect (320px) for scrolling to happen at all */
.scroll-space {
  height: calc(100vh + 340px);
}

/* Game of Life canvas behind the hero content, clipped by the card */
.life {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.brand {
  font-family: "Airbnb Cereal W XBd", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.4rem, 6.5vw, 4.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* " AI" suffix revealed by scroll: width grows from 0 to its natural
   width (--ai-w, measured in JS) so the whole title stays centered */
.brand-ai {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  white-space: pre;
  width: calc(var(--p) * var(--ai-w, 0px));
  opacity: var(--p);
  transform: translateY(calc((1 - var(--p)) * 0.12em));
}

/* Tagline and Contact button share the same slot and cross-fade on scroll */
.swap {
  display: grid;
  margin-top: 1.5rem;
}

.swap > * {
  grid-area: 1 / 1;
}

.tagline {
  font-family: "Airbnb Cereal W Bk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  line-height: 1.8;
  color: #000000;
  opacity: calc(1 - var(--p));
  transform: translateY(calc(var(--p) * -0.6rem));
}

html.scrolled .tagline {
  pointer-events: none;
}

.tagline a {
  color: #000000;
  text-underline-offset: 3px;
}

.tagline a:hover {
  opacity: 0.6;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: var(--p);
  transform: translateY(calc((1 - var(--p)) * 0.6rem));
  pointer-events: none;
}

html.scrolled .contact {
  pointer-events: auto;
}

.contact-btn {
  font-family: "Airbnb Cereal W Bd", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #000000;
  text-decoration: none;
  background: #ffffff;
  border: 2px solid #000000;
  padding: 0.8em 2.2em;
  transition: background 0.2s ease, color 0.2s ease;
}

.contact-btn:hover {
  background: #000000;
  color: #ffffff;
}

/* Scroll hint: a short grey line dropping down and fading out before it
   reaches the bottom. Absolutely positioned so the hero stays centered. */
.scroll-hint {
  position: absolute;
  top: 75%;
  left: 50%;
  margin-left: -1px;
  transform: translateY(-50%);
  width: 2px;
  height: 96px;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
  opacity: calc(1 - var(--p));
}

.scroll-hint::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 36px;
  background: #a3a3a3;
  animation: hint-drop 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes hint-drop {
  0% {
    transform: translateY(-36px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  70% {
    transform: translateY(56px);
    opacity: 0;
  }
  100% {
    transform: translateY(56px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint::before {
    animation: none;
  }
}

/* Footer line centered in the black band below the card, revealed by scroll */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--p) * 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Airbnb Cereal W Bk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: #ffffff;
  opacity: var(--p);
  pointer-events: none;
}
