@import url("./css/prompt.css");
@import url("./css/dashboard.css");
@import url("./css/whiteboard.css");

:root {
  --bg: #000000;
  --text: #f4f6f9;
  --muted: rgba(244, 246, 249, 0.72);
  --faint: rgba(244, 246, 249, 0.46);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.3);
  --glass: rgba(10, 10, 10, 0.42);
  --glass-soft: rgba(255, 255, 255, 0.07);
  --acc: #5eea88;
  --acc-soft: rgba(94, 234, 136, 0.18);
  --shadow: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: transparent;
  font-family: "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: #ffffff;
  color: #000000;
}

.bip-video-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #050505;
}

.bip-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.92;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 780ms cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-stage="welcome"] .bip-bg-video {
  opacity: 0.1;
}

body[data-stage="dashboard"] .bip-bg-video {
  opacity: 0.72;
}

body[data-stage="whiteboard"] .bip-video-background,
body[data-stage="whiteboard"] .bip-video-overlay {
  opacity: 0;
}

.bip-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 52%, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.34) 72%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.48));
  transition: opacity 520ms ease;
}

.bip-page {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 24px;
  background: transparent;
  overflow: hidden;
}

.bip-screen {
  position: absolute;
  inset: 44px 24px;
  margin: auto;
  width: min(820px, 100%);
  max-height: calc(100dvh - 88px);
  overflow-y: auto;
  scrollbar-width: thin;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition:
    opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 420ms ease;
  filter: blur(5px);
}

.bip-screen::-webkit-scrollbar {
  width: 8px;
}

.bip-screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.bip-screen.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  filter: blur(0);
}

.welcome-screen {
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  cursor: default;
}

.welcome-screen h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(42px, 6.2vw, 94px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

.welcome-screen h1 span {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  filter: blur(8px);
  animation: welcomeWordIn 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome-screen h1 span:nth-child(2) {
  animation-delay: 140ms;
}

.welcome-screen h1 span:nth-child(3) {
  animation-delay: 280ms;
}

.tap-cue {
  position: fixed;
  left: var(--cue-x, 52%);
  top: var(--cue-y, 58%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translate(14px, 8px);
  animation: tapCueIn 520ms 880ms ease both;
}

body:not([data-stage="welcome"]) .tap-cue {
  display: none;
}

.intake-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateY(86px);
}

.intake-screen.is-active {
  transform: translateY(0);
}

.intake-copy {
  margin-bottom: 18px;
}

.intake-copy h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(34px, 5.8vw, 62px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0;
}

.composer-form {
  width: 100%;
}

.loading-screen {
  display: grid;
  place-items: center;
  width: min(920px, 100%);
  overflow: hidden;
}

.loading-shell {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.loading-orbit {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: 0 24px 80px var(--shadow);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.loading-orbit span {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: loadingSpin 920ms linear infinite;
}

.loading-shell p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
}

@keyframes welcomeWordIn {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes tapCueIn {
  from {
    opacity: 0;
    transform: translate(14px, 16px);
  }

  to {
    opacity: 1;
    transform: translate(14px, 8px);
  }
}

@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 820px) {
  .bip-page {
    min-height: 100svh;
    padding: 32px 16px 22px;
  }

  .bip-screen,
  .loading-screen {
    inset: 32px 16px 22px;
    max-height: calc(100svh - 54px);
    width: 100%;
  }

  .welcome-screen h1,
  .intake-copy h2 {
    font-size: clamp(42px, 13vw, 64px);
  }

  .tap-cue {
    left: var(--cue-x, 38%);
    top: var(--cue-y, 65%);
  }
}

@media (max-width: 480px) {
  .bip-page {
    padding: 24px 14px 18px;
  }

  .bip-screen,
  .loading-screen {
    inset: 24px 14px 18px;
    max-height: calc(100svh - 42px);
  }
}
