:root {
  --bg-paper: #fafbf8;
  --ink-primary: #0f1310;
  --ink-secondary: #434944;
  --ink-muted: #687069;
  --lime-ribbon: #82ff36;
  --lime-deep: #49b836;
  --success-green: #4ba857;
  --pill-border: #1b201c;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-paper);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* =========================================================
   Single-Page, Single-Section Viewport
   ========================================================= */
.waitlist-viewport {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  isolation: isolate;
  /* Subtle static micro-dot paper texture underneath interactive canvas */
  background-color: var(--bg-paper);
  background-image: radial-gradient(rgba(18, 30, 20, 0.055) 1px, transparent 1px);
  background-size: 16px 16px;
}

#halftoneCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Subtle Neo-Print Registration Crosshairs in Corners */
.reg-mark {
  position: absolute;
  width: 15px;
  height: 15px;
  z-index: 1;
  opacity: 0.28;
  pointer-events: none;
}

.reg-mark::before,
.reg-mark::after {
  content: '';
  position: absolute;
  background: var(--ink-primary);
}

.reg-mark::before {
  top: 7px;
  left: 0;
  width: 15px;
  height: 1px;
}

.reg-mark::after {
  left: 7px;
  top: 0;
  width: 1px;
  height: 15px;
}

.reg-top-left { top: 22px; left: 22px; }
.reg-top-right { top: 22px; right: 22px; }
.reg-bottom-left { bottom: 22px; left: 22px; }
.reg-bottom-right { bottom: 22px; right: 22px; }

/* =========================================================
   Centered Hero Content (Ref 2 + Ref 3 + Ref 4)
   ========================================================= */
.hero-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-14px);
  animation: heroEnter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes heroEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(-14px);
  }
}

/* Headline & Subheading (Ref 3 TallyUp Font & Positioning) */
.hero-headline {
  font-size: clamp(1.95rem, 3.85vw, 3.25rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  max-width: 800px;
}

.headline-highlight {
  position: relative;
  display: inline;
  background-image:
    radial-gradient(#50cb12 1.3px, transparent 1.3px),
    linear-gradient(rgba(130, 255, 54, 0.44), rgba(130, 255, 54, 0.44));
  background-size: 5px 10px, 100% 10px;
  background-repeat: repeat-x, no-repeat;
  background-position: 0 100%, 0 100%;
  padding: 0 5px 9px;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero-subheading {
  margin-top: 24px;
  font-size: clamp(0.9rem, 1.08vw, 1rem);
  font-weight: 400;
  line-height: 1.62;
  color: var(--ink-secondary);
  max-width: 575px;
  text-wrap: balance;
}

/* =========================================================
   Bitmoji Stack & Waitlist Count (Ref 2)
   ========================================================= */
.social-proof {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.bitmoji-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 10px;
}

.bitmoji-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  margin-left: -10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(16, 26, 18, 0.11);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  background-size: cover;
}

.bitmoji-avatar:hover {
  transform: translateY(-5px) scale(1.1);
  z-index: 10;
}

.bitmoji-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bg-mint { background-color: #b8f3c8; }
.bg-sky { background-color: #c5dcfa; }
.bg-lavender { background-color: #dcd3fa; }
.bg-pink { background-color: #fbcfe8; }
.bg-peach { background-color: #fde68a; }

.social-proof-text {
  font-size: 0.84rem;
  font-weight: 500;
  color: #4b524c;
  letter-spacing: -0.01em;
}

#waitlistCountText {
  font-weight: 600;
  color: var(--ink-primary);
}

/* =========================================================
   Clean Single Input + Button Pill (Ref 3 + Ref 4)
   ========================================================= */
.waitlist-form {
  margin-top: 20px;
  width: 100%;
  max-width: 468px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-pill-wrapper {
  width: 100%;
  height: 56px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid #222723;
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  /* Crisp Halftone Print Offset Shadow */
  box-shadow:
    0 10px 28px rgba(15, 25, 16, 0.07),
    4px 4px 0px rgba(17, 22, 18, 0.9);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.input-pill-wrapper:focus-within {
  border-color: #111412;
  transform: translate(-1px, -1px);
  box-shadow:
    0 14px 32px rgba(68, 195, 36, 0.16),
    5px 5px 0px #6ee727;
}

.input-pill-wrapper.has-error {
  border-color: #dc2626;
  box-shadow: 4px 4px 0px rgba(220, 38, 38, 0.85);
  animation: shakePill 0.34s ease;
}

@keyframes shakePill {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.email-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--ink-primary);
}

.email-input::placeholder {
  color: #7c847e;
}

.join-btn {
  position: relative;
  height: 42px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background-color: #141715;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.16s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Tactile Halftone Dot Sweep on Hover */
.join-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(130, 255, 54, 0.28) 1.25px, transparent 1.25px);
  background-size: 6px 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.join-btn span {
  position: relative;
  z-index: 1;
}

.join-btn:hover {
  background-color: #0b0d0c;
  transform: scale(1.02);
}

.join-btn:hover::before {
  opacity: 1;
}

.join-btn:active {
  transform: scale(0.98);
}

.join-btn:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.form-error {
  min-height: 20px;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #dc2626;
}

/* =========================================================
   Exact Waitlist Success View / Box (Ref 1)
   ========================================================= */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  /* Exact vibrant green gradient from Ref 1 */
  background: linear-gradient(135deg, #67f669 0%, #4ee451 52%, #3cd63f 100%);
  animation: overlayFadeIn 0.28s ease-out both;
}

.success-overlay[hidden] {
  display: none;
}

/* Subtle Halftone Texture on Green Backdrop */
.success-backdrop-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.4px, transparent 1.4px);
  background-size: 18px 18px;
  mask-image: radial-gradient(circle at center, transparent 32%, black 95%);
  -webkit-mask-image: radial-gradient(circle at center, transparent 32%, black 95%);
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.success-box {
  position: relative;
  width: min(556px, 94vw);
  background: #ffffff;
  border-radius: 18px;
  padding: 46px 36px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 24px 60px rgba(12, 95, 20, 0.18),
    0 4px 14px rgba(12, 95, 20, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.92);
  animation: boxPopIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

@keyframes boxPopIn {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Top-Right Rounded Square Close Button */
.success-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: none;
  background: #f3f5f3;
  color: #262b27;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.success-close-btn:hover {
  background: #e6ebe7;
  transform: scale(1.05);
}

/* Layered Green Tick with Inner Gloss & Success Shadow (Exact Ref 1) */
.success-badge-outer {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #e7faea;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}

.success-badge-squircle {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #8be996;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(74, 215, 95, 0.25);
}

.success-badge-circle {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  /* Rich 3D glossy green sphere + dark bottom success shadow */
  background: radial-gradient(circle at 38% 26%, #2ce041 0%, #109a22 56%, #05550f 100%);
  box-shadow:
    0 4px 9px rgba(5, 85, 15, 0.38),
    inset 0 -3px 5px rgba(2, 42, 7, 0.58),
    inset 0 2px 3px rgba(196, 255, 203, 0.52);
  display: grid;
  place-items: center;
  animation: tickBounce 0.5s 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes tickBounce {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-title {
  position: relative;
  z-index: 2;
  font-size: clamp(1.62rem, 2.7vw, 2.12rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.028em;
  color: #111512;
}

.success-highlight {
  color: var(--success-green);
}

.success-subtitle {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  font-size: 0.91rem;
  font-weight: 400;
  line-height: 1.56;
  color: #313833;
}

/* Avatars + "You're not alone, 1,500+ people joined!" inside Success Card */
.success-social {
  position: relative;
  z-index: 2;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.success-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
}

.success-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  margin-left: -8px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.success-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.success-social-text {
  font-size: 0.72rem;
  font-weight: 400;
  color: #4b544d;
}

.success-count {
  color: var(--success-green);
  font-weight: 600;
}

/* Bottom Halftone Dot Grid inside White Success Card (Exact Ref 1 Layout) */
.success-card-dots {
  width: 100%;
  margin-top: -64px;
  padding-top: 12px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  row-gap: 34px;
  justify-items: center;
  pointer-events: none;
  z-index: 1;
}

.success-card-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bbf7c6;
}

/* Row 1 (indices 1..8): subtle outer dots, clear center behind subtitle */
.success-card-dots span:nth-child(-n + 8) {
  opacity: 0.34;
}
.success-card-dots span:nth-child(3),
.success-card-dots span:nth-child(4),
.success-card-dots span:nth-child(5),
.success-card-dots span:nth-child(6) {
  opacity: 0;
}

/* Row 2 (indices 9..16): medium outer dots, clear center behind avatars */
.success-card-dots span:nth-child(n + 9):nth-child(-n + 16) {
  opacity: 0.44;
}
.success-card-dots span:nth-child(11),
.success-card-dots span:nth-child(12),
.success-card-dots span:nth-child(13),
.success-card-dots span:nth-child(14) {
  opacity: 0;
}

/* Row 3 (indices 17..24): full row of soft green halftone dots across bottom */
.success-card-dots span:nth-child(n + 17) {
  opacity: 0.68;
}

/* =========================================================
   Responsive Polish (Mobile & Short Viewports)
   ========================================================= */
@media (max-width: 560px) {
  .waitlist-viewport {
    height: auto;
    min-height: 100dvh;
    padding: 40px 18px;
  }

  .hero-card {
    transform: translateY(-6px);
  }

  .input-pill-wrapper {
    height: auto;
    border-radius: 20px;
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .email-input {
    padding: 10px 14px;
    text-align: center;
  }

  .join-btn {
    width: 100%;
    height: 44px;
    border-radius: 14px;
  }

  .success-box {
    padding: 40px 22px 22px;
  }

  .success-subtitle br {
    display: none;
  }
}

@media (max-height: 670px) {
  .waitlist-viewport {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }
}

/* =========================================================
   Subtle Waitlist Corner Legal Links + Legal Pages
   ========================================================= */
.waitlist-mini-legal {
  position: absolute;
  bottom: 20px;
  right: 48px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(15, 19, 16, 0.5);
}

.waitlist-mini-legal a {
  color: inherit;
  text-decoration: none;
  transition: color 0.16s ease;
}

.waitlist-mini-legal a:hover {
  color: var(--ink-primary);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .waitlist-mini-legal {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: 28px;
  }

  .waitlist-viewport {
    flex-direction: column;
  }
}

/* Standalone Legal Pages (Privacy & Terms) */
.legal-body {
  height: auto;
  min-height: 100dvh;
  background-color: var(--bg-paper);
  background-image: radial-gradient(rgba(18, 30, 20, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 40px 20px 64px;
}

.legal-container {
  max-width: 720px;
  margin: 0 auto;
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.legal-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 1.5px solid #1b201c;
  box-shadow: 3px 3px 0px #1b201c;
  color: var(--ink-primary);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.legal-back-pill:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px #6ee727;
}

.legal-domain-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.legal-card {
  background: #ffffff;
  border: 1.5px solid #1b201c;
  border-radius: 20px;
  padding: 40px 38px;
  box-shadow:
    0 16px 40px rgba(15, 25, 16, 0.06),
    6px 6px 0px #82ff36;
}

.legal-updated {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2f8e3b;
  background: #e9fbed;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.legal-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  margin-bottom: 12px;
}

.legal-lead {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  padding-bottom: 22px;
  border-bottom: 1px solid #ebeeec;
}

.legal-section {
  margin-top: 24px;
}

.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.legal-section p,
.legal-section li {
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--ink-secondary);
}

.legal-section p + p {
  margin-top: 10px;
}

.legal-section ul {
  margin: 8px 0 10px 20px;
}

.legal-section li + li {
  margin-top: 6px;
}

.legal-section a {
  color: #2c8f38;
  font-weight: 500;
  text-decoration: underline;
}

.legal-section code {
  font-size: 0.82rem;
  background: #f2f5f2;
  padding: 2px 6px;
  border-radius: 5px;
}

.legal-bottom-nav {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.legal-bottom-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
}

.legal-bottom-nav a:hover {
  color: var(--ink-primary);
  text-decoration: underline;
}

@media (max-width: 560px) {
  .legal-card {
    padding: 28px 22px;
  }
}
