:root {
  --color-background: #050508;
  --color-text-primary: #f0f0f5;
  --color-text-secondary: #a0a0b8;
  --color-accent: #a879ff;
  --color-accent-dark: #8c5de6;
  --color-accent-glow: rgba(168, 121, 255, 0.3);
  --font-main: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Canvas and Overlays --- */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#main-canvas {
  display: block;
}

/* Add a subtle film grain effect */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 200vw;
  height: 200vh;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiGAAAAA1BMVEX///+nxBvIAAAAIElEQVR42mP4z8BQz0AEYCRgRMPGgImhI2ZgYPgPwQYACgAB/0K2Gk4AAAAASUVORK5CYII=");
  animation: grain 8s steps(10) infinite;
  opacity: 0.05;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-5%, -10%);
  }
  20% {
    transform: translate(-15%, 5%);
  }
  30% {
    transform: translate(7%, -25%);
  }
  40% {
    transform: translate(-5%, 25%);
  }
  50% {
    transform: translate(-15%, 10%);
  }
  60% {
    transform: translate(15%, 0%);
  }
  70% {
    transform: translate(0%, 15%);
  }
  80% {
    transform: translate(3%, 35%);
  }
  90% {
    transform: translate(-10%, 10%);
  }
}

/* --- Main Content --- */
#content-container {
  position: relative;
  z-index: 10;
  width: 100%;
  display: grid;
  place-items: center;
}

#hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
}

#main-title {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  max-width: 15ch;
  animation: text-reveal 1.5s ease-out 0.5s forwards;
  opacity: 0;
}

#subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-text-secondary);
  max-width: 45ch;
  margin-top: 2rem;
  line-height: 1.6;
  font-weight: 400;
  animation: text-reveal 1.5s ease-out 0.8s forwards;
  opacity: 0;
}

@keyframes text-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Scroll Indicator --- */
#scroll-indicator {
  /* ** THE FIX: Removed absolute positioning ** */
  margin-top: 4rem; /* Position it below the subtitle */
  opacity: 0;
  animation: text-reveal 1.5s ease-out 1.5s forwards;
}
.mouse {
  width: 24px;
  height: 40px;
  border: 2px solid var(--color-text-secondary);
  border-radius: 12px;
  position: relative;
}
.mouse::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background-color: var(--color-text-secondary);
  border-radius: 2px;
  animation: scroll-wheel 2s ease-in-out infinite;
}
@keyframes scroll-wheel {
  0% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, 10px);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 10px);
    opacity: 0;
  }
}

#cta {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  width: 100%;
}

#final-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  opacity: 0; /* Managed by Intersection Observer */
  transform: translateY(30px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

#final-cta.visible {
  opacity: 1;
  transform: translateY(0);
}

#tessera-logo {
  width: 50px;
  height: 50px;
}
.logo-core {
  fill: var(--color-text);
}
.logo-arc {
  stroke: var(--color-text);
  stroke-width: 2px;
  stroke-linecap: round;
}

.form-group {
  display: flex;
  flex-wrap: wrap; /* Allows button to wrap on small screens */
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(176, 111, 255, 0.3);
  border-radius: 8px;
  background-color: rgba(10, 10, 15, 0.5);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  padding: 6px;
}
.form-group:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 25px var(--color-accent-glow);
}

#email-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 14px 18px;
  width: 280px;
  flex-grow: 1; /* Allows it to take available space */
}
#email-input::placeholder {
  color: var(--color-text-secondary);
}

#waitlist-form button {
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-accent-dark)
  );
  border: none;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-out;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
#waitlist-form button:hover {
  box-shadow: 0 0 20px var(--color-accent-glow);
  transform: scale(1.02);
}

/* Responsive adjustments for the form */
@media (max-width: 480px) {
  #waitlist-form button {
    width: 100%;
    border-radius: 6px;
  }
  .form-group {
    flex-direction: column;
  }
}
