/* Both sales routes render their content in a full-page document. */
html.sales-home {
  background: #1f0608;
}

/* The existing meter fills its track through the --scroll custom property. */
#ka-page #ka-thrive-fullwidth-root #progress {
  width: 100% !important;
}

#ka-page #ka-thrive-fullwidth-root .final-h {
  width: min(100%, 18ch) !important;
  max-width: 100% !important;
  font-size: clamp(2.25rem, min(6.35vw, 10svh), 6.5rem) !important;
  line-height: 0.99 !important;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

#ka-page #ka-thrive-fullwidth-root .final-h em {
  font-size: inherit !important;
}

#ka-page #ka-thrive-fullwidth-root .engine-word {
  text-wrap: balance;
}

.sales-course .sec.close h2 {
  font-size: clamp(2rem, min(4.9vw, 9svh), 4rem);
  overflow-wrap: anywhere;
}

.sales-progress {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #d35b32, #f0ab4c);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* Explicit book and reader heights keep the page still as the app loads. */
.library-frame {
  --frame-height: clamp(29rem, 74svh, 43rem);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 1.25rem;
  background: #f7ece0;
  box-shadow: 0 1.5rem 4rem -2.5rem #050305;
}

.library-frame[data-library-kind="song"] {
  --frame-height: clamp(31rem, 72svh, 43rem);
  background: #2b120f;
}

.library-frame[data-library-kind="cards"] {
  --frame-height: 39rem;
  max-width: 38rem;
  margin-inline: auto;
}

.library-frame iframe {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: var(--frame-height);
  border: 0;
}

.library-link {
  display: inline-flex;
  margin-top: 0.75rem;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.4em;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  font-size: 0.9375rem;
}

#ka-page .library-link {
  margin-top: 0.75rem;
  min-height: 2.75rem;
  text-decoration: underline;
  font-size: 0.9375rem;
}

.library-link:focus-visible,
.library-frame iframe:focus-visible {
  outline: 2px solid #e38b33;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .library-frame {
    --frame-height: 36rem;
    border-radius: 0.9rem;
  }

  .library-frame[data-library-kind="song"] {
    --frame-height: 32rem;
  }
}

/* Allow the preview column to shrink below an iframe's intrinsic width. */
.sales-course .lib-part .split > * {
  min-width: 0;
}

html.sales-home.ka-modal-lock {
  overflow: hidden !important;
}

#ka-page #kaRegisterModal {
  z-index: 10000;
}

#ka-page #kaRegisterModal .ka-modal-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  max-height: min(760px, 100%) !important;
}

#ka-page #kaRegisterModal .ka-modal-grid {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 1rem;
}

#ka-page #kaRegisterModal .ka-modal-schedule {
  margin-bottom: 0 !important;
  color: var(--gold);
  font: 600 0.9375rem/1.4 var(--display);
}

#ka-page #kaRegisterModal .ka-modal-details {
  display: grid;
  align-self: start;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
}

#ka-page #kaRegisterModal .ka-modal-details li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: rgb(242 237 226 / 86%);
  font: 500 0.9375rem/1.4 var(--display);
}

#ka-page #kaRegisterModal .ka-modal-details li::before {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

@media (min-width: 761px) {
  #ka-page #kaRegisterModal .ka-modal-grid {
    row-gap: 0.625rem;
  }

  #ka-page #kaRegisterModal .ka-modal-copy {
    align-self: end;
  }

  #ka-page #kaRegisterModal .ka-modal-grid .ka-mc-form {
    grid-area: 1 / 2 / 3 / 3;
  }
}

#ka-page #kaShotLightbox {
  --testimonial-pad: clamp(0.75rem, 4vw, 1.25rem);
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(56rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid #ddcdbb;
  border-radius: 1rem;
  cursor: auto !important;
  background: #fff8ef;
  color: #321c1b;
  box-shadow: 0 1.5rem 5rem -1rem rgb(0 0 0 / 55%);
}

#ka-page #kaShotLightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

#ka-page #kaShotLightbox::backdrop {
  background: rgb(31 6 8 / 82%);
  backdrop-filter: blur(8px);
}

#ka-page #kaShotLightbox .ka-testimonial-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem var(--testimonial-pad);
  border-bottom: 1px solid #ddcdbb;
}

#ka-page #kaShotLightbox button {
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border: 1px solid #ddcdbb;
  border-radius: 999px;
  background: #fffaf4;
  color: #681d28;
  font: 600 0.9375rem/1.25 var(--display);
  cursor: pointer !important;
}

#ka-page #kaShotLightbox .ka-testimonial-close {
  flex: 0 0 44px;
  width: 44px;
  padding: 0;
  font-size: 1.5rem;
}

#ka-page #kaShotLightbox .ka-testimonial-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--testimonial-pad);
}

#ka-page #kaShotLightbox #kaTestimonialText {
  max-width: 63ch;
  margin-inline: auto;
  font: 400 clamp(1rem, 3.8vw, 1.125rem)/1.6 var(--display);
  overflow-wrap: anywhere;
}

#ka-page #kaShotLightbox img {
  width: 100%;
  height: auto;
  max-width: 100%;
}

#ka-page #kaShotLightbox [hidden] {
  display: none;
}

#ka-page #kaShotLightbox :focus-visible,
#ka-page .ka-sound-toggle:focus-visible,
.ka-sound-toggle:focus-visible {
  outline: 2px solid #a52c3c;
  outline-offset: 2px;
}

#ka-page #kaShotLightbox .ka-testimonial-content:focus-visible {
  outline-offset: -3px;
}

.ka-sound-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9998;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: rgb(25 25 30 / 62%);
  color: #fff;
  box-shadow: 0 4px 16px rgb(0 0 0 / 28%);
  cursor: pointer;
}

.ka-sound-toggle:hover {
  background: rgb(25 25 30 / 82%);
}

@media (max-width: 760px) {
  /* Keep site controls above the hosting badge at the bottom of the viewport. */
  :is(html.sales-home, html.sales-course) {
    --sales-bottom-gap: calc(50px + env(safe-area-inset-bottom, 0px));
  }

  #ka-page #ka-thrive-fullwidth-root .nav {
    gap: 0.5rem;
  }

  #ka-page #ka-thrive-fullwidth-root .nav .brand {
    flex: 0 1 78px;
    min-width: 0;
  }

  #ka-page #ka-thrive-fullwidth-root .nav .brand-img {
    width: 100% !important;
    height: auto !important;
  }

  #ka-page #ka-thrive-fullwidth-root .nav-right {
    flex: none;
    gap: 0.5rem;
  }

  #ka-page #ka-thrive-fullwidth-root .nav-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
  }

  #ka-page #ka-thrive-fullwidth-root .ka-sound-toggle {
    position: static;
    flex: 0 0 44px;
    border: 1px solid #e8d7c9;
    border-radius: 50%;
    background: #faf0e4;
    color: #681d28;
    box-shadow: none;
  }

  #ka-page .ka-sticky-cta,
  .sales-course .mbar {
    bottom: var(--sales-bottom-gap);
  }

  #ka-page .ka-sticky-cta:not(.show),
  .sales-course .mbar:not(.on) {
    visibility: hidden;
  }

  #ka-page .ka-sticky-cta {
    width: auto;
    max-width: calc(100% - 20px);
  }

  #ka-page #kaRegisterModal {
    top: var(--ka-register-top, 0px) !important;
    height: var(--ka-register-height, 100dvh) !important;
    min-height: 0 !important;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px var(--sales-bottom-gap);
  }

  #ka-page #kaRegisterModal .ka-modal-card {
    width: min(100%, 35rem) !important;
  }

  #ka-page #kaRegisterModal .ka-modal-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.875rem !important;
    padding: 1.125rem !important;
  }

  #ka-page #kaRegisterModal .ka-modal-kicker {
    margin-bottom: 0.5rem !important;
    padding-right: 2.5rem;
  }

  #ka-page #kaRegisterModal #kaModalTitle {
    margin-bottom: 0.625rem !important;
    font-size: clamp(1.75rem, 7.6vw, 2.375rem) !important;
    max-width: 16ch !important;
  }

  #ka-page #kaRegisterModal .ka-modal-copy p {
    margin-bottom: 0.75rem !important;
    line-height: 1.45;
  }

  #ka-page #kaRegisterModal .ka-modal-details {
    gap: 0.375rem;
  }

  #ka-page #kaRegisterModal .ka-modal-details li {
    font-size: 0.875rem;
  }

  #ka-page #kaRegisterModal .ka-mc-form {
    min-width: 0;
    padding: 0.875rem;
  }

  #ka-page #kaRegisterModal .ka-mc-form input[type="email"] {
    height: 48px;
    padding-inline: 0.75rem;
    font-size: 1rem;
  }

  #ka-page #kaRegisterModal .ka-consent {
    padding: 0.625rem;
  }

  #ka-page #kaRegisterModal .ka-submit {
    height: auto;
    min-height: 48px;
    margin-top: 0.625rem;
    padding: 0.5rem;
  }

  #ka-page #kaRegisterModal .ka-modal-close {
    width: 44px !important;
    height: 44px !important;
    top: 6px !important;
    right: 6px !important;
  }

  #ka-page #kaShotLightbox {
    bottom: var(--sales-bottom-gap);
    top: max(12px, env(safe-area-inset-top, 0px));
    max-height: calc(100dvh - var(--sales-bottom-gap) - max(12px, env(safe-area-inset-top, 0px)));
  }
}

@media (max-width: 760px) and (max-height: 700px) {
  #ka-page #kaRegisterModal .ka-modal-grid {
    gap: 0.625rem !important;
    padding: 0.875rem !important;
  }

  #ka-page #kaRegisterModal .ka-modal-kicker {
    margin-bottom: 0.25rem !important;
  }

  #ka-page #kaRegisterModal #kaModalTitle {
    margin-bottom: 0.375rem !important;
    font-size: 1.75rem !important;
  }

  #ka-page #kaRegisterModal .ka-modal-copy > p {
    margin-bottom: 0.5rem !important;
    font-size: 0.9375rem;
    line-height: 1.4;
  }

  #ka-page #kaRegisterModal .ka-modal-copy .ka-modal-schedule {
    margin-bottom: 0 !important;
    font-size: 0.8125rem;
  }

  #ka-page #kaRegisterModal .ka-mc-form {
    padding: 0.75rem;
  }

  #ka-page #kaRegisterModal .ka-consent {
    margin-block: 0.625rem 0;
    padding: 0.5rem;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ki-colibri video,
    .sales-course .lib-part video[data-sm-loop] {
      animation: library-art linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 34%;
    }
    @keyframes library-art {
      from {
        scale: 1.045;
      }
      to {
        scale: 1;
      }
    }
  }
}

/* The same continuously scrolling classroom photos on both pages. */
.photo-gallery {
  min-width: 0;
  margin-block-start: clamp(2rem, 5vw, 4rem);
}
#ka-page .photo-gallery {
  margin-block: 0;
  padding-block: clamp(1.5rem, 4vw, 3rem);
  color: #3a2320;
  background: #f3ebd8;
}
.photo-gallery-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}
#ka-page .photo-gallery-header {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 3rem);
}
.photo-gallery-header p { margin: 0; }
.photo-gallery-header button {
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border: 1px solid #aa8575;
  border-radius: 999px;
  color: #562b25;
  background: #fff8ec;
  font: inherit;
  cursor: pointer;
}
.photo-gallery-header button:focus-visible,
.photo-gallery-window:focus-visible {
  outline: 2px solid #b80e26;
  outline-offset: -2px;
}
.photo-gallery-window {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.photo-gallery-window::-webkit-scrollbar { display: none; }
.photo-gallery-track {
  display: flex;
  width: max-content;
  gap: clamp(12px, 1.5vw, 20px);
}
.photo-gallery-item {
  flex: none;
  width: clamp(215px, 74vw, 280px);
  aspect-ratio: 7 / 5;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #e9dcc0;
}
.photo-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-gallery-item--poster img { object-position: 50% 43%; }

#ka-page .compact-foot-logo img {
  width: auto !important;
  height: 43px !important;
  max-width: 100%;
}

#ka-page .ki-lib .library-invite {
  margin-bottom: 1.3rem;
}
.library-disclosure {
  min-width: 0;
}
#ka-page .library-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  min-height: 60px;
  padding: 0.82rem clamp(1.15rem, 4vw, 1.75rem);
  border: 1px solid #e07a83;
  border-radius: 1rem;
  color: #fff8ea;
  background: linear-gradient(145deg, #bd1737, #9d0c28);
  box-shadow: inset 0 1px rgb(255 255 255 / 25%), 0 12px 26px -14px #8b1430;
  font-size: clamp(1.05rem, 2.65vw, 1.45rem);
  font-weight: 700;
  line-height: 1.18;
  cursor: pointer;
  list-style: none;
}
.library-disclosure > summary::-webkit-details-marker { display: none; }
#ka-page .library-disclosure > summary:hover {
  background: linear-gradient(145deg, #a71130, #860919);
}
.library-disclosure > summary:focus-visible {
  outline: 2px solid #791831;
  outline-offset: 3px;
}
.library-disclosure-mark {
  display: grid;
  place-items: center;
  flex: 0 0 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #9d0c28;
  background: #fff6e5;
}
.library-disclosure-mark::before { content: "+"; }
.library-disclosure[open] .library-disclosure-mark::before { content: "−"; }
.library-disclosure-body { padding-top: clamp(1.3rem, 4vw, 2.5rem); }
#ka-page .library-access-copy {
  max-width: 67ch;
  margin: 0 0 1.5rem;
  color: #55342d;
}
