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

/* Ensure HTML hidden attribute always wins over display rules */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Noto Sans', sans-serif;
  font-weight: 200;
  background: #0a0a0f;
}

/* ── Background ── */
.bg-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url(img/hero.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: filter;
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

/* ── Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  pointer-events: none;
}

.overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.1) 40%,
    rgba(0, 0, 0, 0.1) 60%,
    rgba(0, 0, 0, 0.5) 100%
  );
  pointer-events: none;
}

.overlay > * {
  pointer-events: auto;
}

/* ── Hero block ── */
.hero-block {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 600px;
  padding: 2.5rem 2rem;
  background: rgba(8, 8, 18, 0.40);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: translate(-50%, -50%);
  /* Start invisible so backdrop-filter pre-warms during the delay,
     then fade the whole card in — text never sees the unblurred flash */
  animation: heroCardIn 0.5s ease 0.25s both;
}

/* ── Brand mark ── */
.brand-mark {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
  animation: fadeSlideUp 0.6s ease both;
  animation-delay: 0.05s;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(180, 200, 255, 0.9);
  background: rgba(100, 130, 255, 0.12);
  border: 1px solid rgba(120, 150, 255, 0.25);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.25rem;
  animation: fadeSlideUp 0.6s ease both;
  animation-delay: 0.15s;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(150, 180, 255, 0.9);
  box-shadow: 0 0 6px rgba(150, 180, 255, 0.8);
  animation: pulse 2s ease-in-out infinite;
}

/* ── Hero text ── */
.hero {
  text-align: center;
  margin-bottom: 0;
}

.hero h1 {
  font-family: 'Noto Sans', sans-serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.85rem;
  line-height: 1.2;
  animation: fadeSlideUp 0.6s ease both;
  animation-delay: 0.25s;
}

.hero-tagline {
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: rgba(255, 255, 255, 0.65);
  font-weight: 300;
  letter-spacing: 0.01em;
  margin-bottom: 2rem;
  animation: fadeSlideUp 0.6s ease both;
  animation-delay: 0.35s;
}

/* ── Waitlist ── */
.waitlist {
  margin-top: 0;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  animation: fadeSlideUp 0.6s ease both;
  animation-delay: 0.45s;
}

.hero-submit {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: #fff;
  background: linear-gradient(135deg, #3a3a6e 0%, #2d2d4a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s, border-color 0.25s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(100, 120, 255, 0);
  letter-spacing: 0.01em;
}

.hero-submit:hover {
  background: linear-gradient(135deg, #4a4a8e 0%, #3d3d6a 100%);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(80, 100, 220, 0.25);
}

.hero-submit:active {
  transform: translateY(0);
}

.waitlist-hint {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.02em;
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  /* Use pointer-events instead of visibility so the backdrop GPU layer
     stays alive between opens — this eliminates the blur render delay */
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal.is-open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: rgba(14, 14, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(80, 100, 220, 0.12);
  border: 1px solid rgba(100, 130, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(160, 180, 255, 0.9);
  margin-bottom: 1.1rem;
}

.modal-title {
  font-family: 'Noto Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 300;
  color: #f0f0f5;
  margin-bottom: 0.35rem;
}

.modal-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.waitlist-input {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 300;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #f0f0f5;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.waitlist-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.waitlist-input:focus {
  border-color: rgba(100, 130, 255, 0.6);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(80, 100, 220, 0.15);
}

.waitlist-submit {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: #fff;
  background: linear-gradient(135deg, #3a3a6e 0%, #2d2d4a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.waitlist-submit:hover {
  background: linear-gradient(135deg, #4a4a8e 0%, #3d3d6a 100%);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(80, 100, 220, 0.25);
  transform: translateY(-1px);
}

.waitlist-submit:active {
  transform: translateY(0);
}

.waitlist-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.submit-loading svg {
  animation: spin 0.8s linear infinite;
}

.modal-success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: rgba(160, 230, 180, 0.95);
  margin-top: 0.25rem;
  padding: 0.75rem 0.9rem;
  background: rgba(80, 180, 100, 0.1);
  border: 1px solid rgba(100, 200, 120, 0.2);
  border-radius: 8px;
}

.modal-error {
  font-size: 0.875rem;
  color: rgba(255, 200, 150, 0.9);
  margin-top: 0.25rem;
  padding: 0.65rem 0.9rem;
  background: rgba(200, 100, 60, 0.1);
  border: 1px solid rgba(220, 130, 80, 0.2);
  border-radius: 8px;
  line-height: 1.5;
}

.modal-error a {
  color: rgba(255, 220, 170, 1);
  text-decoration: underline;
}

.modal-error a:hover {
  color: #fff;
}

.modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

/* ── Footer ── */
.footer {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  animation: fadeSlideUp 0.6s ease both;
  animation-delay: 0.6s;
}

.footer p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.04em;
}

/* ── Animations ── */
@keyframes heroCardIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
