/* Book launch modal — scoped styles */
.kb-launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.kb-launch-overlay.kb-launch-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kb-launch-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 22, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.kb-launch-dialog {
  position: relative;
  width: 100%;
  max-width: min(96vw, 560px);
  max-height: min(94vh, 720px);
  overflow-y: auto;
  border-radius: 28px;
  padding: 2.5rem 2rem 2.25rem;
  background: linear-gradient(
    165deg,
    #0c2f36 0%,
    #134e56 38%,
    #2a5f66 72%,
    #3d6d72 100%
  );
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  text-align: center;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.kb-launch-overlay.kb-launch-visible .kb-launch-dialog {
  transform: scale(1) translateY(0);
}

.kb-launch-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.kb-launch-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.05);
}

.kb-launch-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.kb-launch-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.kb-launch-book-wrap {
  perspective: 880px;
  margin-bottom: 0.5rem;
}

.kb-launch-book {
  max-height: clamp(200px, 32vh, 320px);
  width: auto;
  max-width: min(85%, 280px);
  height: auto;
  border-radius: 4px 6px 6px 4px;
  transform: rotateY(-14deg) rotateX(6deg);
  transform-style: preserve-3d;
  box-shadow:
    -12px 16px 40px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.25);
  object-fit: contain;
}

.kb-launch-script {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.5rem, 4.5vw, 3.65rem);
  font-weight: 400;
  color: #fff;
  margin: 0.75rem 0 0.85rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.kb-launch-lead {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 1.35rem;
  max-width: min(34rem, 92%);
}

.kb-launch-countdown {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.kb-launch-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.kb-launch-digit-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.kb-launch-digit-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  background: #fff;
  color: #1c2e30;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kb-launch-label {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.kb-launch-colon {
  font-family: "DM Sans", sans-serif;
  font-size: 1.35rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  padding: 0 0.1rem 1.65rem;
  line-height: 1;
}

.kb-launch-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.85rem 2.25rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  color: #fff;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.25s ease;
}

.kb-launch-cta:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.kb-launch-cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .kb-launch-overlay,
  .kb-launch-dialog,
  .kb-launch-close,
  .kb-launch-cta {
    transition: none;
  }

  .kb-launch-overlay.kb-launch-visible .kb-launch-dialog {
    transform: none;
  }
}

@media (min-width: 768px) {
  .kb-launch-dialog {
    max-width: min(92vw, 600px);
    padding: 2.75rem 2.35rem 2.5rem;
    border-radius: 32px;
  }

  .kb-launch-close {
    width: 44px;
    height: 44px;
    top: 18px;
    right: 18px;
  }
}

@media (min-width: 1200px) {
  .kb-launch-dialog {
    max-width: min(90vw, 640px);
  }
}

@media (max-width: 380px) {
  .kb-launch-dialog {
    padding: 2rem 1.25rem 1.65rem;
    border-radius: 22px;
  }

  .kb-launch-digit-box {
    min-width: 1.85rem;
    font-size: 1rem;
  }

  .kb-launch-colon {
    padding-bottom: 1.4rem;
  }
}
