/* Load after styles.css, cinematic.css, and video-sequence.css. */
body.video-entry-page .entry-video-host {
  z-index: 0;
  opacity: 0;
  /* All three crops match at their joins. Real portrait exports can replace
     these later; landscape video is never stretched to a phone's ratio. */
  --qvs-object-position: 50% 50%;
  --qvs-idle-desktop-position: 50% 50%;
  --qvs-transition-desktop-position: 50% 50%;
  --qvs-destination-desktop-position: 50% 50%;
  --qvs-idle-mobile-position: 50% 50%;
  --qvs-transition-mobile-position: 50% 50%;
  --qvs-destination-mobile-position: 50% 50%;
  --qvs-idle-position: var(--qvs-idle-desktop-position);
  --qvs-transition-position: var(--qvs-transition-desktop-position);
  --qvs-destination-position: var(--qvs-destination-desktop-position);
}

body.video-entry-page .entry-video-host .qvs-video-idle {
  object-position: var(--qvs-idle-position);
}

body.video-entry-page .entry-video-host .qvs-video-transition {
  object-position: var(--qvs-transition-position);
}

body.video-entry-page .entry-video-host .qvs-video-destination {
  object-position: var(--qvs-destination-position);
}

body.video-entry-page:not(.is-authenticated) {
  overflow: hidden;
}

body.video-entry-page.video-scene-ready .entry-video-host {
  opacity: 1;
}

body.video-entry-page #cinematicBackdrop[hidden] {
  display: none;
}

body.video-entry-page .cinematic-camera {
  inset: 0;
  transform: none;
  will-change: auto;
}

body.video-entry-page .cinematic-landscape {
  object-position: 50% 50%;
}

body.video-entry-page .cinematic-copy {
  top: 49%;
  right: auto;
  left: max(clamp(32px, 6.5vw, 120px), env(safe-area-inset-left));
  width: min(340px, 29vw);
  text-align: left;
  transform: translateY(-50%);
  transition: opacity 140ms ease;
  text-shadow: 0 2px 20px rgba(14, 48, 47, .28);
}

body.video-entry-page .cinematic-copy h1 {
  font-size: clamp(60px, 6vw, 96px);
  letter-spacing: .2em;
  text-indent: 0;
}

body.video-entry-page .cinematic-kicker {
  margin-bottom: 15px;
  text-indent: 0;
  font-size: 9px;
  letter-spacing: .25em;
}

body.video-entry-page .cinematic-subtitle {
  max-width: 25em;
  margin: 18px 0 28px;
  font-size: 12px;
  letter-spacing: .07em;
}

body.video-entry-page .cinematic-enter {
  min-height: 48px;
  min-width: 172px;
  background: rgba(15, 47, 43, .12);
  border-color: rgba(255, 255, 255, .68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

body.video-entry-page .cinematic-enter:hover,
body.video-entry-page .cinematic-enter:active,
body.video-entry-page .cinematic-enter:hover svg {
  transform: none;
}

body.video-entry-page .cinematic-bottom {
  display: none;
}

body.video-entry-page.is-entering .cinematic-copy {
  transform: translateY(-50%);
}

.video-entry-help {
  margin-top: 12px;
  max-width: 28em;
}

.video-entry-message {
  margin: 0;
  color: rgba(255, 255, 255, .94);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: .02em;
}

.video-entry-message:empty {
  display: none;
}

.video-entry-skip {
  display: inline-block;
  min-height: 36px;
  padding: 5px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, .86);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 11px;
  letter-spacing: .05em;
  -webkit-tap-highlight-color: transparent;
}

.video-entry-skip[hidden] {
  display: none;
}

.video-entry-skip:focus-visible {
  outline: 2px solid white;
  outline-offset: 5px;
}

body.video-entry-page .auth-gate {
  top: var(--qiyu-auth-viewport-top, 0px);
  bottom: auto;
  min-height: 0;
  height: var(--qiyu-auth-viewport-height, 100%);
  align-items: center;
  justify-items: end;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(24px, env(safe-area-inset-top))
    max(clamp(24px, 7vw, 136px), env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

body.video-entry-page .auth-gate .modal {
  width: min(350px, 100%);
  max-height: calc(var(--qiyu-auth-viewport-height, 100dvh) - 48px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 22px;
  background: rgba(255, 253, 251, .75);
  box-shadow: 0 14px 55px rgba(37, 67, 70, .12), inset 0 1px 0 rgba(255, 255, 255, .66);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

body.video-entry-page .auth-gate .modal-mark,
body.video-entry-page .auth-gate .eyebrow {
  display: none;
}

body.video-entry-page .auth-gate h2 {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: .14em;
  color: #3f5353;
}

body.video-entry-page .auth-gate .modal-copy {
  font-size: 12px;
  line-height: 1.7;
  color: #788884;
  margin: 8px 0 22px;
}

body.video-entry-page .auth-gate form {
  gap: 13px;
}

body.video-entry-page .auth-gate form > label {
  font-size: 12px;
  gap: 6px;
  color: #677974;
}

body.video-entry-page .auth-gate input {
  min-height: 44px;
  height: 44px;
  font-size: 16px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(137, 158, 149, .25);
  border-radius: 10px;
  color: #40534e;
}

body.video-entry-page .auth-gate input::placeholder {
  color: #a1aaa4;
  font-size: 13px;
}

body.video-entry-page .auth-gate .modal-submit {
  min-height: 44px;
  height: 44px;
  margin-top: 4px;
  border-radius: 10px;
  font-size: 14px;
  background: #cf8f9d;
  box-shadow: 0 5px 16px rgba(162, 92, 111, .13);
}

body.video-entry-page .auth-gate .form-message:not(:empty) {
  margin: 12px 0 0;
  font-size: 12px;
}

body.video-entry-page .auth-gate h2:focus {
  outline: none;
}

body.video-entry-page .auth-gate .modal,
body.video-entry-page .auth-gate,
body.video-entry-page .app-shell {
  transition-property: opacity;
  transition-duration: 420ms;
}

body.video-entry-page.entry-active .auth-gate .modal,
body.video-entry-page.is-entering .auth-gate .modal {
  transform: none;
}

body.video-entry-page.has-entered.is-authenticated .app-shell {
  background: linear-gradient(118deg, rgba(255, 247, 245, .84), rgba(245, 250, 247, .82));
}

@media (max-width: 760px) {
  body.video-entry-page .entry-video-host {
    --qvs-idle-position: var(--qvs-idle-mobile-position);
    --qvs-transition-position: var(--qvs-transition-mobile-position);
    --qvs-destination-position: var(--qvs-destination-mobile-position);
  }

  body.video-entry-page .cinematic-copy,
  body.video-entry-page.is-entering .cinematic-copy {
    top: auto;
    right: max(22px, env(safe-area-inset-right));
    bottom: max(6.5svh, calc(env(safe-area-inset-bottom) + 24px));
    left: max(22px, env(safe-area-inset-left));
    width: auto;
    text-align: center;
    transform: none;
  }

  body.video-entry-page .cinematic-copy h1 {
    font-size: clamp(42px, 12vw, 58px);
    line-height: 1.2;
    letter-spacing: .2em;
    text-indent: .2em;
  }

  body.video-entry-page .cinematic-kicker {
    margin-bottom: 10px;
    font-size: 8px;
    letter-spacing: .24em;
  }

  body.video-entry-page .cinematic-subtitle {
    max-width: none;
    margin: 12px 0 20px;
    font-size: 11px;
  }

  body.video-entry-page .cinematic-enter {
    min-height: 46px;
    min-width: 164px;
  }

  .video-entry-help {
    max-width: none;
    margin-top: 7px;
  }

  .video-entry-message {
    font-size: 11px;
  }

  body.video-entry-page .auth-gate {
    justify-items: center;
    align-items: end;
    padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
      max(20px, calc(env(safe-area-inset-bottom) + 10px)) max(14px, env(safe-area-inset-left));
  }

  body.video-entry-page .auth-gate .modal {
    width: min(350px, 100%);
    max-height: calc(var(--qiyu-auth-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 36px);
    padding: 20px 23px;
    border-radius: 22px;
    background: rgba(255, 253, 251, .78);
    backdrop-filter: blur(12px) saturate(1.05);
    -webkit-backdrop-filter: blur(12px) saturate(1.05);
  }

  body.video-entry-page .auth-gate h2 {
    font-size: 25px;
    line-height: 1.35;
  }

  body.video-entry-page .auth-gate .modal-copy {
    margin: 6px 0 15px;
    font-size: 11px;
  }

  body.video-entry-page .auth-gate form {
    gap: 10px;
  }

  body.video-entry-page .auth-gate form > label {
    font-size: 11px;
    gap: 5px;
  }

  body.video-entry-page .auth-gate .modal-submit {
    margin-top: 2px;
  }
}

@media (max-width: 760px) {
  body.video-entry-page .cinematic-landscape {
    object-position: 40% 50%;
  }
}

/* A focused keyboard leaves the card scrollable inside the remaining visual
   viewport instead of pushing a fixed, full-height dialog offscreen. */
@media (max-width: 760px) and (max-height: 570px) {
  body.video-entry-page .auth-gate {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  body.video-entry-page .auth-gate .modal {
    padding: 16px 20px;
    max-height: calc(var(--qiyu-auth-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);
  }

  body.video-entry-page .auth-gate .modal-copy {
    margin-bottom: 10px;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  body.video-entry-page .cinematic-copy,
  body.video-entry-page.is-entering .cinematic-copy {
    top: 50%;
    bottom: auto;
    right: auto;
    left: max(24px, env(safe-area-inset-left));
    width: min(250px, 32vw);
    text-align: left;
    transform: translateY(-50%);
  }

  body.video-entry-page .cinematic-copy h1 {
    font-size: 46px;
    text-indent: 0;
  }

  body.video-entry-page .cinematic-kicker {
    margin-bottom: 8px;
  }

  body.video-entry-page .cinematic-subtitle {
    margin: 10px 0 15px;
    font-size: 10px;
  }

  body.video-entry-page .cinematic-enter {
    min-height: 42px;
    min-width: 150px;
    padding: 8px 16px;
  }

  body.video-entry-page .auth-gate {
    align-items: center;
    justify-items: end;
    padding: max(12px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  }

  body.video-entry-page .auth-gate .modal {
    width: min(330px, 48vw);
    max-height: calc(var(--qiyu-auth-viewport-height, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    padding: 18px 23px;
  }

  body.video-entry-page .auth-gate .modal-copy {
    margin-bottom: 12px;
  }

  body.video-entry-page .auth-gate form {
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.video-entry-page .cinematic-copy,
  body.video-entry-page .auth-gate,
  body.video-entry-page .auth-gate .modal,
  body.video-entry-page .app-shell {
    transition: none;
  }
}
